-1

When I run ANOVA for the regression models which I develop, this error appears:

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

What is the meaning of this error?

It should be mentioned that when I run summary of model, I see just parameters estimated for the model and no other statistical parameters. Does it mean that the model still needs modification and that is not the final model? please look at the instruction of my model, and the summary and ANOVA:

 model3 = nls(Height ~ 1.30 + a*(I(1- exp(-b*Diameter))^c), data = dat1, start = list(a=48,b=0.012,c=0.491), algorithm="port")

 summary(model3)
 anova(model3)

Here are the result:

model3 = nls(Height ~ 1.30 + a*(I(1- exp(-b*Diameter))^c), data = dat1, start = list(a=48,b=0.012,c=0.491), algorithm="port")
summary(model3)

Formula: Height ~ 1.3 + a * (I(1 - exp(-b * Diameter))^c)

Parameters:
   Estimate Std. Error t value Pr(>|t|)    
a 43.121923   1.653027  26.087  < 2e-16 ***

b  0.022037   0.003811   5.783 1.38e-08 ***

c  0.914263   0.116202   7.868 2.75e-14 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Residual standard error: 5.369 on 446 degrees of freedom

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

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

I am a beginner in R. Is there somebody who help me? Thank you

David Arenburg
  • 91,361
  • 17
  • 137
  • 196
user3713988
  • 13
  • 1
  • 7

1 Answers1

0

The error message means you need to specify a sub-model - for non-linear regression, there's no obvious choice, and so you'll need to do anova(model3, model0) where model0 corresponds to a fit of another model - probably where one or more of your parameters are held constant.

Gavin Kelly
  • 2,374
  • 1
  • 10
  • 13
  • Thank you for the anova. Don't you think that the summary of the model is not completed? I need to know R squared and adjusted R squared too. when I run the summary of a linear model, it included adjusted R squared but not in this model. – user3713988 Jul 15 '14 at 18:16
  • I run "summary(model3)$adj.r.squared" for the model above. But the result is "NULL". Why? – user3713988 Jul 15 '14 at 19:05
  • It's a reasonably well-accepted opinion that although an r-squared value for non linear regression _can_ be calculated, it doesn't mean what anyone would expect, so R has protected us from the temptation to give it a meaning by not calculating it. I suggest you use and adjusted AIC or BIC measure, and get the person who suggested r-squared to think a bit more deeply about what they're trying to infer. – Gavin Kelly Jul 17 '14 at 08:33