rm(list=ls()) setwd("C:/Users/wdbeavis/Desktop/PBEA/QG/Module 7/") options(max.print=1000000) #Next load in the data set from a spreadsheet (excel.csv) # and ds <-read.csv("QG_Mod7_ALA7.1_ds.csv",header=T) summary(ds) ds$sample<-factor(ds$sample) ds$field<-factor(ds$field) ds$cooperator<-factor(ds$cooperator) summary(ds) ######################################################################################## # next consider conducting EDA # do this so that you have estimates of experimental # variability that can be used to make decisions about # the quality of the data # the model for ANOVA is y = mean + coop + coop(field) + g ==sample + residual # in this case, the model represents an RCBD ######################################################################################## attach(ds) hist(ds$yield,col="beige",main="Frequency of yield ", xlab="yield") boxplot(ds$yield~ds$sample,main="Boxplot by tc entry", xlab="Sample",ylab="Yield") boxplot(ds$yield~ds$cooperator,main="Boxplot by Cooperator", xlab="Cooperator",ylab="Yield") anova(lm(yield~cooperator+field/cooperator + sample)) detach(ds)