# you need to set your default directory to the folder containing the file Tunjai_regeneration.txt # OR paste the path to the file in addition to the file name tj<-read.table(file="Tunjai_regeneration.txt", header=TRUE) tj colnames(tj)[9]<- "PercentEstab" arcsine_establishment<- asin(sqrt(tj$PercentEstab /100)) tj<-cbind(tj, arcsine_establishment) levels(tj$Size_categ) levels(tj$Coat) levels(tj$Shape) ### Arcsine squareroot transformation is.ordered(tj$Size_categ) tj$Size_categ<-ordered(tj$Size_categ, levels=c("S" ,"I", "L")) tj$Coat<-ordered(tj$Coat, levels=c("Tn" ,"M", "Tk")) is.ordered(tj$Size_categ) boxplot(tj$arcsine_establishment ~ tj$Size_categ) #modelA2<-aov(tj$arcsine_establishment ~ tj$Size_categ) modelA<-lm(tj$arcsine_establishment ~ tj$Size_categ) par(mfrow=c(2,2)) plot(modelA) summary(modelA) #modelA2<-aov(tj$arcsine_establishment ~ tj$Size_categ) #modelA3<-aov(log(tj$arcsine_establishment) ~ tj$Size_categ) modelB<-aov (tj$PercentEstab ~ tj$Size_categ) summary(modelB) ### Logit transformation tj$logit_establishment<-with(tj, log((PercentEstab/100)/(1-(PercentEstab/100)))) modelC<-aov(tj$logit_establishment ~ tj$Size_categ) par(mfrow=c(2,2)) plot(modelC) summary(modelC)