anova.gsl_nls {gslnls}R Documentation

Anova tables

Description

Returns the analysis of variance (or deviance) tables for two or more fitted "gsl_nls" objects.

Usage

## S3 method for class 'gsl_nls'
anova(object, ...)

Arguments

object

An object inheriting from class "gsl_nls".

...

Additional objects inheriting from class "gsl_nls".

Value

A data.frame object of class "anova" similar to anova representing the analysis-of-variance table of the fitted model objects when printed.

See Also

anova

Examples

## data
set.seed(1)
n <- 25
xy <- data.frame(
  x = (1:n) / n,
  y = 2.5 * exp(-1.5 * (1:n) / n) + 1 + rnorm(n, sd = 0.1)
)
## model
obj1 <- gsl_nls(fn = y ~ A * exp(-lam * x), data = xy, start = c(A = 1, lam = 1))
obj2 <- gsl_nls(fn = y ~ A * exp(-lam * x) + b, data = xy,
    start = c(A = 1, lam = 1, b = 0))

anova(obj1, obj2)

[Package gslnls version 1.3.2 Index]