nests<-c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1,1,2,2,2,2,2,4,5,5,7,7,9,11,15,20,24,30)
total_damage_percent<-c(3.72,3.11,2.15,1.40,1.12,0.94,0.55,0.59,0.73, 0.83,0.19,0.44,0.19,0.64,0.66,0.68,1.03,0.19,0.20,0.13,0.10,0.59,0.09,0.05,0.06,0.06,0.04,0.14)
leafbeetle_damage_percent<-c(0.44,0.49,0.59,0.70,0.73,0.94,1.03,1.09, 1.42,2.10,0.19,0.39,0.03,0.04,0.19,0.36,0.42,0.20,0.21,0.09,0.05,0.16,0.07,0.05,0.06,0.06,0.01,0.14)
plot(nests,total_damage_percent,xlab= "Number of weaver ant nests",ylab= "Percentage leaf damage",pch=1)
points(nests,leafbeetle_damage_percent,pch=4)
modelA<-lm(leafbeetle_damage_percent ~ nests)
plot(modelA)
####
modelB<-lm(leafbeetle_damage_percent ~ log(nests+1))
plot(modelB)
####
plot(log(nests+1),total_damage_percent^0.333,xlab= "ln(weaver ant nests+1)",ylab="Percentage leaf damage ^0.33",pch=1,col="red")
points(log(nests+1),leafbeetle_damage_percent^0.333,pch=4,col="green")
modelC<-lm(total_damage_percent^(1/3) ~ log(nests + 1))
summary(modelC)
modelT<-lm(leafbeetle_damage_percent^(1/3) ~ log(nests + 1))
summary(modelT)
abline(lm(total_damage_percent^(1/3) ~ log(nests + 1)),lwd=2,col= "red")
abline(modelT,lwd=2,col= "green")