(a) **Atkins**, a low-carb diet, (b) **Zone**, a 4-4-3 ratio of carbs-protein-fat,

(c) **Ornish**, a low-fat diet, or (d) **Weight Watchers**.

Subjects were educated on their assigned diet and were monitored as they stayed on the diet for one year. At the end of the year, researchers calculated the **changes in weight** for each subject.

(a) Suppose used t-tests (with $\alpha=0.05$ fir each test) to compare all possible pairs of group means. Calculate the overall probability of making at least one Type I error across all the t-tests.

(b) Check the conditions necessary to conduct an ANOVA. Choose your methods and interpret the results.

(c) Conduct an ANOVA on this data (with or without the equal variance assumption) and write out any conclusions you can draw.

(d) Calculate eta-squared and omega-squared.

(e) Conduct a randomized test of the SAD (or MAD) statistic for this data. Estimate the p-value.

The `diet` dataframe has been loaded.

The variables are `Diet` (a factor variable identifying which diet each subject is assigned to) and `Weightloss` (the number of pounds lost by each subject by the end of the study).

A summary of the data is displayed below. Notice the variables begin with **Capital** letters and that negative values of the **Weightloss** variable indicate subjects who *gained* weight. ![](dietdata.png)

![](Transparent.gif)

### Load data
```{r 'load-data'}
# The data are loaded into a data.frame called "diet"
diet <- read.csv("http://www.bradthiessen.com/html5/data/diet.csv")
head(diet)
## Notice the capital L in the WeightLoss variable. If you forget that upper-case L, you'll get an error message.
# Density plot to see the distribution of weightloss values within each group
densityplot(~WeightLoss|Diet, data=diet, lwd=3,
main="Weight loss by diet", xlab="Pounds lost", layout=c(2,2))
# Error bars showing mean and standard errors
ggplot(diet, aes(Diet, WeightLoss)) +
stat_summary(fun.y = mean, geom = "point") +
stat_summary(fun.y = mean, geom = "line", aes(group = 1),
colour = "Blue", linetype = "dashed") +
stat_summary(fun.data = mean_cl_boot, geom = "errorbar", width = 0.2) +
labs(x = "Diet", y = "mean Weightloss")
```
### (a)
```{r 'part-a'}
# Use this space for calculations
# Write your answers as comments (with a "#" before each line)
```
### (b) ```{r 'part-b'} # Check assumptions here # You can write your interpretations as comments ```

### (c) ```{r 'part-c'} # Conduct an ANOVA here. # Write conclusions as comments ```

### (d) ```{r 'part-d'} # Calculate eta-squared and omega-squared ```

### (e) ```{r 'part-e'} # Conduct the randomization-based test of SAD (or MAD) # Estimate the p-value (and plot the distribution, if you'd like) ```

![](Transparent.gif)

You're done!