anova_nlslist: Anova for nlsList

Description Usage Arguments Examples

Description

Applies an F-test to a non-linear regression model that includes a grouping variable (fit with nlsList), comparing it to a model without a grouping variable. This is a convenient way to test whether there is an overall effect of the grouping variable on the non-linear relationship.

Usage

1
anova_nlslist(nlsfull, nlsreduc)

Arguments

nlsfull

The full model, an object returned by nlsList

nlsreduc

The reduced model, which is identical to the full model except the grouping variable has been removed, and it was fit with nls

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
chick <- as.data.frame(ChickWeight)

# Fit a simple model with nls
fit0 <- nls(weight ~ a*Time^b, data=chick, start=list(a=10, b=1.1))

# Fit an nlsList model, with a grouping variable (Diet)
fit1 <- nlsList(weight ~ a*Time^b | Diet, data=chick, start=list(a=10, b=1.1))

# Using an F-test, test whether the fit is significantly better when adding
# a grouping variable
anova_nlslist(fit1, fit0)

RemkoDuursma/nlshelper documentation built on May 9, 2019, 9:39 a.m.