Anova test in R

Fluid Types Life

The effective life of insulating fluids at an accelerated load of 35kV is being studied. Test data have been obtained for the four types of fluid.
We tested the hypothesis that the life of fluids is the same against the alternative that they differ at an alpha=0.05 level of significance

\[ Ho:\mu_1=\mu_2=\mu_3=\mu_4\] \[ Ha:\mu_1\neq\mu_2\neq\mu_3\neq\mu_4\]

Two way ANOVA type 2

FT<-c(rep(1,6),rep(2,6),rep(3,6),rep(4,6))
SMPL<-c(17.6,18.9,16.3,17.4,20.1,21.6,16.9,15.3,18.6,17.1,19.5,20.3,21.4,23.6,19.4,18.5,20.5,22.3,19.3,21.1,16.9,17.5,18.3,19.8)

d2<-cbind(FT,SMPL)
d3<-as.data.frame(d2)

?lm
## starting httpd help server ... done
lm.model<-lm(SMPL~FT, data=d3)
Anova(lm.model, type=2)
## Anova Table (Type II tests)
## 
## Response: SMPL
##           Sum Sq Df F value Pr(>F)
## FT         3.675  1  0.8742 0.3599
## Residuals 92.483 22

Conclusion

Because the p-value is greater than 0.05, we fail to reject H0, what means that the Ms are almost equal.

¿Is the model adequate?

plot(lm.model, which = 1)

After analyzing the plots we conclude that the model is adequate, because the residuals indicate that the variances are similar.

Observations

Given four normal populations with means of μ1=50, μ2=60, μ3=50, and μ4=60, we tested how many observations should be taken from each population to reject the null hypothesis of equal population means. We assumed that α=0.05, that power=0.90 and that a reasonable estimate of the error variance is σ2=25.

Power test

pwr.anova.test(k=4, n=NULL, f=2, sig.level=0.05, power=0.90)
## 
##      Balanced one-way analysis of variance power calculation 
## 
##               k = 4
##               n = 2.170367
##               f = 2
##       sig.level = 0.05
##           power = 0.9
## 
## NOTE: n is number in each group

Conclusion

The power test result indicates that we need to take 3 observations of each population to reject the null hypothesis.