From: Levi Waldron <leviwaldron_at_gmail.com>

Date: Thu, 05 Jun 2008 18:25:37 -0400

R-help_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Fri 06 Jun 2008 - 00:26:19 GMT

Date: Thu, 05 Jun 2008 18:25:37 -0400

I am trying to model the observed leaching of wood preservative chemicals
from treated wood during an outdoor experiment where leaching is caused by
rainfall events. For each rainfall event, the amount of rainfall was
recorded as well as the amount of preservative chemical leached. A number
of climatic variables were measured, but the most important is the amount of
rainfall.

leach.lm <- lm(leachate~rainmm-1,data=leachdata)

library(MASS)

boxcox(leach.lm,plotit=T,lambda=seq(0,0.4,by=0.01))

png("boxcox-dianostics.png",height=1200,width=700)
par(mfrow=c(3,2))

logleach.lm <- lm(boxtran(leachate,0.21)~rainmm-1,data=leachdata)
plot(leachate~rainmm,data=leachdata,main="Data and fitted line")
x <- leachdata$rainmm

y <- boxtran(predict(logleach.lm),0.21,T)
xy <- cbind(x,y)[order(x),]

lines(xy)

plot(y~leachdata$leachate,xlim=c(0,12),ylim=c(0,12),main="predicted vs.
observed leaching amount",xlab="observed leaching",ylab="predicted
leaching")

abline(a=0,b=1)

plot(logleach.lm)

dev.off()

R-help_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.2.0, at Fri 06 Jun 2008 - 19:30:39 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*