In: Statistics and Probability
Location Mean leaf length
1 |
5.7 |
6.3 |
6.1 |
6 |
5.8 |
6.2 |
2 |
6.2 |
5.3 |
5.7 |
6 |
5.2 |
5.5 |
3 |
5.4 |
5 |
6 |
5.6 |
4.9 |
5.2 |
4 |
3.7 |
3.2 |
3.9 |
4 |
3.5 |
3.6 |
i) the factor of interest in this experiment: location
ii)an experimental unit: plant of each of four swampy undeveloped sites
the response variable: leaf length
iii)ANOVA table:
Df | Sum Sq | Mean Sq | F value | Pr(>F) | |
group | 3 | 19.74 | 6.58 | 57.38 | 5.25E-10 |
Residuals | 20 | 2.293 | 0.115 | ||
Total | 23 | 22.033 |
Since p-value is almost 0, we can claim that we have enough evidence to conclude that the mean growth rates at the four sites are not the same.
iv)p-value = 0.4236>0.05 hence we can claim that the normality assumption for the residuals is satisfied.
v)p-value = 0.5999>0.05 hence we can say that there is insufficient evidence to support the claim that the population variances are not same. Hence assumption of homogeneity is satisfied.
vi)Pair of locations (1,2) and (1,3) have same growth rates since p-value for each pair is quite high.
R CODE and OUTPUT:
>
data=read.csv("C:/Users/cssc/Desktop/b1.csv",header=TRUE)
> # the analysis of variance
> a <- aov(length ~ group, data = data)
> # Summary of analysis
> summary(a)
> # Extracting residuals
> res <- residuals(object = a )
> # Shapiro test
> shapiro.test(x = res)
Shapiro-Wilk normality test
data: res
W = 0.95926, p-value = 0.4236
> # Bartlett test
> bartlett.test(length ~ group, data = data)
Bartlett test of homogeneity of variances
data: length by group
Bartlett's K-squared = 1.8695, df = 3, p-value = 0.5999
> #Tukey's comparison
> TukeyHSD(a)
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = length ~ group, data = data)
$group
diff lwr upr p adj
l2-l1 -0.3666667 -0.9138728 0.1805395 0.2696656
l3-l1 -0.6666667 -1.2138728 -0.1194605 0.0135850
l4-l1 -2.3666667 -2.9138728 -1.8194605 0.0000000
l3-l2 -0.3000000 -0.8472061 0.2472061 0.4366710
l4-l2 -2.0000000 -2.5472061 -1.4527939 0.0000000
l4-l3 -1.7000000 -2.2472061 -1.1527939 0.0000002