[R] Odp: R square in NLS-urgent help

Petr PIKAL petr.pikal at precheza.cz
Mon Dec 14 17:15:58 CET 2009


Hi

I believe it was answered several times and if I remember correctly R 
squared in nonlinear models is not so simple (from statistical point of 
wiev).
Here you have some insights from help archive, which you could probably 
get as easy as myself if you had used search facilities offered to you on 
CRAN.

I searched      nls r squared 

----- Original Message ----- 
From: "Douglas Bates" <bates at stat.wisc.edu> 
Sent: Wednesday, May 01, 2002 2:40 PM 
Subject: Re: [R] coefficient of determination on a nls regression 
There is a good reason that an nls model fit in R does not provide 
r-squared - r-squared doesn't make sense for a general nls model. 
One way of thinking of r-squared is as a comparison of the residual 
sum of squares for the fitted model to the residual sum of squares for 
a trivial model that consists of a constant only. You cannot 
guarantee that this is a comparison of nested models when dealing with 
an nls model. If the models aren't nested this comparison is not 
terribly meaningful. 
 So the answer is that you probably don't want to do this in the first 
place. 


From: Gabor Grothendieck <ggrothendieck_at_gmail.com> 
Date: Mon 06 Jun 2005 - 10:22:05 EST
On 6/5/05, James Salsman <james at bovik.org> wrote: 
> Why doesn't nls() produce any kind of R-squared value? In the absence 
> of such information, how are we supposed to compare one fit to another 
> when the y-axis scale changes? 
> 
> > sm <- nls(y ~ SSfpl(x, miny, maxy, midx, grad)) 
> > summary(sm) 
> 
> Formula: y ~ SSfpl(x, miny, maxy, midx, grad) 
> 
> Parameters: 
> Estimate Std. Error t value Pr(>|t|) 
> miny -0.5845 4.6104 -0.127 0.90524 
> maxy 7.2680 1.5512 4.686 0.00941 ** 
> midx 16.9187 2.2340 7.573 0.00163 ** 
> grad 1.7283 1.9150 0.903 0.41782 
> --- 
> Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 
> 
> Residual standard error: 1.13 on 4 degrees of freedom 
> 
> Correlation of Parameter Estimates: 
> miny maxy midx 
> maxy -0.6654 
> midx 0.8936 -0.3221 
> grad -0.9068 0.8477 -0.6865 
> 
One uses anova (which has an anova.nls method) to compare two nls models.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Regards
Petr



r-help-bounces at r-project.org napsal dne 14.12.2009 09:42:51:

> Hello
> 
> I need one urgent help
> I am trying to fit the Sigmod curve of logistic growth model using NLS
> estimation.
> But i do not get the R square value in that even after getting the 
"Summary"
> In that case how to compare the fit for 3 models and find which one is
> better fit??
> 
> How to get this R Square value when using NLS estimation?
> 
> Thanks
> Ruchita
> 
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> 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.




More information about the R-help mailing list