# NOT RUN {
#analysis original data
data_o <- data.frame(y=ChickWeight$weight,g=ChickWeight$Diet)
g.m <- rep(mean(data_o$y),3)
#compute pooled sd
sd.g <- aggregate(data_o$y,by=list(data_o$g),sd)[,2]
n.g <- table(data_o$g)
p.sd<- pooled.sd(data_o)
means <- aggregate(data_o$y,by=list(data_o$g),mean)[,2]
post <- Gibbs.ANOVA(data_o)
power.calc(n.r=c(20,21,22,23),posterior=post$posterior,g.m=g.m,p.sd=p.sd,
statistic="exact",exact=means,alpha=.05)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab