#boxplotboxplot(gain~supp+temp,col=c("red","orange"),ylab="Body weight gain",xlab="supplement and temperature",data=data)libraray(ggplot2)ggplot(data,aes(x=supp,y=gain,col=temp))+geom_boxplot()
# class by supp and temp, and then count means and standard errorlibrary(reshape);library(agricolae)mystats<-function(x){c(n=length(x),mean=mean(x,na.rm=T),sd=sd(x))}dfm<-melt(data,measure.vars="gain",id.vars=c("supp","temp"))cast(dfm,supp+temp+variable~.,mystates)
# main effect ANOVA with no interactionmodel_aov<-aov(data=data,gain~supp+temp)summary(model_aov)model_aov$cofficients# if we don't care supp and temp, mean of gain is 12.455 # if suppOJ = 0. and then suppVC = -3.7