Yes! Thank you. * * *Ben Caldwell*
On Thu, May 31, 2012 at 4:03 PM, peter dalgaard <pda...@gmail.com> wrote: > > On Jun 1, 2012, at 00:14 , Benjamin Caldwell wrote: > > > temppow<-lm(log(y)~log(x)) > > plot(log(y)~log(x)) > > plot(residuals(temppow), main="pow") > > abline(temppow) > > plot(y~x, main="pow") > > tempsum<-summary(temppow)$adj.r.squared > > tempint<-summary(temppow)$coefficients[1,1] #intercept of power function > > tempslope<-summary(temppow)$coefficients[2,1] #slope of power function > > tempmin<-min(x) > > tempmax<-max(x) > > lngth<-c(tempmin:tempmax) # vector from the minimum to the maximum values > > of independent variable > > > prediction<-exp(tempint)*((lngth)^tempslope)*exp((summary(temppow)$sigma^2)/2) > > # exp((summary(temppow)$sigma^2)/2) is the bias correction > > > #prediction<-exp(tempint+tempslope*log(lngth))*exp((summary(temppow)$sigma^2)/2) > > lines(prediction) > > It does help considerably to use lines(length, prediction)! > > (And that bias correction looks really dubious to me, but let's not go > there...) > > -- > Peter Dalgaard, Professor, > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Email: pd....@cbs.dk Priv: pda...@gmail.com > > > > > > > > > [[alternative HTML version deleted]] ______________________________________________ R-help@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.