Dear all,
I wanted to plot the mean and standard error on the regression equation
(instead of individual data points) in the following code, but I could not
find the right code in the help files. Could someone please show how to do
this.
Thank you very much.
temp <- c(16,16,16,16,16, 20,20,20,20,20, 24,24,24,24,24, 28,28,28,28,28,
32,32,32,32,32)
dev1hr <- c(36.2, 34, 32.2, 36.4, 36, 23.8, 24.4, 24, 23, 23.25, 17.5,
18.37, 20.25, 21, 19.47, 14.37, 15, 13.42, 12, 13.2, 8, 8, 7.15, 7, 8.25)
predict(lm(dev1hr ~ temp+I(temp^2)+I(temp^3)))
new <- data.frame(temp = seq(16, 32, 0.5))
predict(lm(dev1hr ~ temp+I(temp^2)), new, se.fit = TRUE)
pred.w.plim <- predict(lm(dev1hr ~ temp+I(temp^2)+I(temp^3)), new,
interval="prediction")
pred.w.clim <- predict(lm(dev1hr ~ temp+I(temp^2)+I(temp^3)), new,
interval="confidence")
plot.new()
plot.window(xlim=range(temp),ylim = range(pred.w.plim[,-1]))
axis(1,at=seq(16,32,by=4),tck=.03,font.axis=6,labels=FALSE)
axis(2,at=seq(5,40,by=8),tck=.03,las=1,font.axis=6)
title (ylab="Development time (Days)",cex.lab=1.5,font.lab=6)
matpoints(new$temp,cbind(pred.w.clim, pred.w.plim[,-1]),
lty=c(1,3,3,4,4), type="l", col = "black", lwd = 1.5)
points(temp, pch="o", dev1hr)
mtext("A:1 h",line=-3,cex=.8,font=6,adj=.9)
box(bty="L")
____________________
Sivakumar Mohandass,
Department of Entomology,
Kansas State University
[[alternative HTML version deleted]]