anova.gnm | R Documentation |
Allows to use the likelihood-ratio test to compare nested models in generalized nonlinear models.
## S3 method for class 'gnm'
anova(object, ..., verbose = TRUE)
object |
an object of the class gnm. |
... |
another objects of the class gnm. |
verbose |
an (optional) logical indicating if should the report of results be printed. As default, |
A matrix with the following three columns:
Chi | The value of the statistic of the test, |
Df | The number of degrees of freedom, |
Pr(>Chi) | The p-value of the test -type test computed using the Chi-square distribution. |
###### Example: The effects of fertilizers on coastal Bermuda grass
data(Grass)
fit1 <- gnm(Yield ~ b0 + b1/(Nitrogen + a1) + b2/(Phosphorus + a2) + b3/(Potassium + a3),
family=gaussian(inverse), start=c(b0=0.1,b1=13,b2=1,b3=1,a1=45,a2=15,a3=30), data=Grass)
fit2 <- update(fit1,Yield ~ I(b0 + b2/(Phosphorus + a2) + b3/(Potassium + a3)),
start=c(b0=0.1,b2=1,b3=1,a2=15,a3=30))
anova(fit2,fit1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.