# NOT RUN {
library(pbANOVA)
data(fedata)
fedata$depth <- factor(fedata$depth)
library(Rmisc)
summarySE(fedata, "Y", "depth")
feNs <- summarySE(fedata, "Y", "depth")$N
feYs <- summarySE(fedata, "Y", "depth")$Y
fes2 <- (summarySE(fedata, "Y", "depth")$sd)^2
anova(lm(Y~depth, data=fedata)) #F-test significant
#we saw in the dunnett's example that the equal variance assumption is violated
library(MASS) #need MASS for ginv function for all the interaction and main effects algorithms
alg.A1(ns=feNs, ybars=feYs, s2=fes2, a=6, L=5000)
#p=0.0038
#multiple comparisons
Q.Amc_oneway(L = 5000, ns=feNs, means=feYs, s2=fes2, alpha = 0.05)
#compare to Tukey's test
TukeyHSD(aov(Y~depth, data=fedata))
#results agree only for some levels.
# }
Run the code above in your browser using DataLab