Regarding anova result

View: New views
3 Messages — Rating Filter:   Alert me  

Regarding anova result

by Guru S :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

  
 
Hi,

I fitted tree growth data with Chapman-Richards growth function using nls.

summary(fit.nls)

Formula:

Parameters:

  Estimate Std. Error t value Pr

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 1.879 on 713 degrees of freedom

Algorithm "port", convergence message: relative convergence (4)

When I try to run the anova() function I get this:

anova(fit.nls)
Error in anova.nls(fit.nls) : anova is only defined for sequences of "nls" objects

Could you tell me what the problem is?

Thanks & Regards,
Guru S
        [[alternative HTML version deleted]]


______________________________________________
R-help@... 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.

Parent Message unknown Re: Regarding anova result

by S Ellison :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



>>> "Guru S" <guru.rcom@...> 09/05/2008 08:18 >>>
>I fitted tree growth data with Chapman-Richards growth function using
nls.
>When I try to run the anova() function I get this:
>Error in anova.nls(fit.nls) : anova is only defined for sequences of
"nls" objects

There seem to be two problems.
The first is that your summary is empty. I don't know why that is;
you'd have to supply the nls() command and data.
The second is exactly what the error message says; there is no anova
method for a single nls object.
anova in R works two ways; on a single fit, in which case individual
term sums of squares are calculated, or on a sequence of fits, in which
case anova compares the SS for the different fits.

Using the example from the nls help:

 x <- 1:10
 y <- 2*x + 3                            # perfect fit
yeps <- y + rnorm(length(y), sd = 0.01) # added noise
y.nls1<-     nls(yeps ~ a + b*x, start = list(a = 0.12345, b =
0.54321),
         trace = TRUE)

y.nls2<-     nls(yeps ~ a + b*x+c*x^2, start = list(a = 0.12345, b =
0.54321, c=0.01),
         trace = TRUE)

anova(y.nls1) #Returns your error message

anova(y.nls1, y.nls2) #Returns a test of one fit against the other

Hope that helps

Steve E



*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}

______________________________________________
R-help@... 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.

Parent Message unknown Re: Regarding anova result

by Guru S :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi S Ellison,

 Thanks for your response,
 you said anova in R works two ways;
 one is single fit, another one is sequence of fits.
Single fit is used to fit single nls() model result.  If  I am wrong plz advice me.
 I want to use single fit. How to do that? In your example, why the anova(y.nls1) is generating error? How to get anova result for "anova(y.nls1)"
Thanks in advance,
With Regards,
Guru S

On Fri, 09 May 2008 S Ellison wrote :

>
>
> >>> "Guru S" <guru.rcom@...> 09/05/2008 08:18 >>>
> >I fitted tree growth data with Chapman-Richards growth function using
>nls.
> >When I try to run the anova() function I get this:
> >Error in anova.nls(fit.nls) : anova is only defined for sequences of
>"nls" objects
>
>There seem to be two problems.
>The first is that your summary is empty. I don't know why that is;
>you'd have to supply the nls() command and data.
>The second is exactly what the error message says; there is no anova
>method for a single nls object.
>anova in R works two ways; on a single fit, in which case individual
>term sums of squares are calculated, or on a sequence of fits, in which
>case anova compares the SS for the different fits.
>
>Using the example from the nls help:
>
>  x <- 1:10
>  y <- 2*x + 3                            # perfect fit
>yeps <- y + rnorm(length(y), sd = 0.01) # added noise
>y.nls1<-     nls(yeps ~ a + b*x, start = list(a = 0.12345, b =
>0.54321),
>          trace = TRUE)
>
>y.nls2<-     nls(yeps ~ a + b*x+c*x^2, start = list(a = 0.12345, b =
>0.54321, c=0.01),
>          trace = TRUE)
>
>anova(y.nls1) #Returns your error message
>
>anova(y.nls1, y.nls2) #Returns a test of one fit against the other
>
>Hope that helps
>
>Steve E
>
>
>
>*******************************************************************
>This email and any attachments are confidential. Any use, copying or
>disclosure other than by the intended recipient is unauthorised. If
>you have received this message in error, please notify the sender
>immediately via +44(0)20 8943 7000 or notify postmaster@...
>and delete this message and any copies from your computer and network.
>LGC Limited. Registered in England 2991879.
>Registered office: Queens Road, Teddington, Middlesex, TW11 0LY, UK

        [[alternative HTML version deleted]]

______________________________________________
R-help@... 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.