hw9

A. Fill in the values missing from the table
Source
DF
SS
MS
F
Type
2
37.51
19
5.1
Error
9
33
3.7
Total
11
70.60
B. What does the MS for county type tell you?
The variability in the mean of number of meth labs for different countries is not due to chance.
C. Find the p value for the F test in the table
p < .05
5.28
A. Two variables given in the dataset Olives are fenthion and time. Which variable
is the response variable and which variable is the explanatory variable? Explain.
-Response: Amount of Fenthion residue in the group of olives
-Explanatory: Time of sample taken
The research question asks how much fenthion residue is left in olives depending on the group
the olives are in. We are measuring the fenthion as a result of time. The time describes the
sample and the sample is the amount of residue.
B. Check the conditions necessary for conducting an ANOVA to analyze the amount of fenthion
present in the samples. If the conditions are met, report the results of the analysis
-Constant Variance:
The data does not look like it has constant variance -- the residuals are not fitted to the line very
closely. When the standard deviations are examined, the standard deviation is twice as large in
groups 3 and 4, so the variance is not constant -- the data is skewed. A transformation is
suggested, or, at the least, reporting the skewness along with all results.
> tapply(Fenthion,Time,sd)
0
3
4
0.0677 0.1206 0.1727
-Normality: The residuals do not seem to veer from the line of fit too drastically, so it’s safe to
say that these data do not violate the condition of normality.
-Zero Mean + Independence: The sample was randomly collected so both conditions are met.
If we were to ignore and report the violated condition of constant variance, here is the results of
analysis:
> FenAN
Call:
aov(formula = Fenthion ~ Time)
Terms:
Time Residuals
Sum of Squares 2.891
0.261
Deg. of Freedom
1
16
Residual standard error: 0.128
Estimated effects may be unbalanced
> summary(FenAN)
Df Sum Sq Mean Sq F value Pr(>F)
Time
1 2.891
2.891
177 4.5e-10 ***
Residuals
16 0.261
0.016
--Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
While the condition of constant variance is violated, we reject the null hypothesis that Fenthion
and Time are related by chance.
C. Transform the amount of fenthion using the exponential. Check the conditions necessary for
conducting an ANOVA to analyze the exponential of the amount of fenthion present in the
samples. if the conditions are met, report the results of analysis.
Constant Variance:
While the residuals do not follow the line of fit closely, the standard deviation values are much
closer to each other; the transformation assisted the skewed data.
> tapply(exp(Fenthion),Time,sd)
0
3
4
0.481 0.448 0.443
Normality:
-Zero Mean + Independence:
Call:
aov(formula = exp(Fenthion) ~ Time)
Terms:
Time Residuals
Sum of Squares 65.2
3.2
Deg. of Freedom
1
16
Residual standard error: 0.447
Estimated effects may be unbalanced
> summary(aov(exp(Fenthion)~Time))
Df Sum Sq Mean Sq F value Pr(>F)
Time
1
65.2
65.2
326 4.6e-12 ***
Residuals
16
3.2
0.2
--Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
5.34
0=normal
1=overweight
2=obese
A. Why should we not use two sample t tests to see what differences there are between the
means of these three groups?
We should not use a two-sample t-test to see what differences there are between the three groups
because we will increase our risk of type I error by doing 3 separate t-tests to compare the three
groups with each other. ANOVA has more power, and we can test three samples at once with
great confidence if conditions are satisfied.
B. Compute an ANOVA table to test for differences in systolic blood pressure between normal,
overweight, and obese people.
> bloodaov
Call:
aov(formula = SystolicBP ~ Overwt)
Terms:
Sum of Squares
Deg. of Freedom
Overwt Residuals
27788
363286
1
498
Residual standard error: 27
> summary(bloodaov)
Df Sum Sq Mean Sq F value Pr(>F)
Overwt
1 27788
27788
38.1 1.4e-09 ***
Residuals
498 363286
729
--Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
C. Use Fisher’s LSD to find any differences that exist between these three groups’ mean systolic
blood pressures. Comment on your findings.
(0-1, 0-2, 1-2)