[R] nonlinear regression-getting the explained variation

inaki at goisolutions.net inaki at goisolutions.net
Thu Nov 23 18:01:01 CET 2006


Hi,

I'm trying to teach myself R, and by the way, re-learning statistics using
Crawley's "Statistics: an introduction using R".
I've reached the regression chapter, and when it deals with non-linear
regresion using the nls library I face the following problem:

I follow the steps---
>deer<-read.table("c:\\temp\\jaws.txt",header=T)
---data available at
http://www.bio.ic.ac.uk/research/crawley/statistics/data/
>attach(deer)
>names(deer)
>library(nls)
>model2<-nls(bone~a*(1-exp(-c*age)),start=list(a=120,c=0.064))
>summary(model2)
I've taken away those steps that regard plotting.
And everything goes fine, I understand the steps taken and so, but on the
text Crawley says "the model... and explained 84.6% of the total variation
in bone lenght".
I guess this is linked to the adjusted squared R for linear models, but I
just can't find how to get it in this case...
I've tried in Statgraphics, and it plots the anova table and r^2 right the
way, how could I do so in R?
Thanks in advance, and sorry to bother
Iñaki



More information about the R-help mailing list