tidy.nlsList: Tidy method for nlsList

Description Usage Arguments Examples

View source: R/tidy.nlslist.R

Description

Adds a method to tidy (broom package), so that we can use it for models fitted with nlsList.

Usage

1
2
3
## S3 method for class 'nlsList'
tidy(x, conf.int = FALSE, conf.level = 0.95,
  quick = FALSE, ...)

Arguments

x

An object returned by nlsList

conf.int

Whether to calculate confidence intervals

conf.level

The level of the confidence interval

quick

If TRUE, only returns the coefficients.

...

Further arguments passed to tidy

Examples

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

# 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))

# Collect coefficients
tidy(fit1)

# ... and confidence intervals
tidy(fit1, conf.int=TRUE)

Example output

Loading required package: nlme
Loading required package: broom
Loading required package: dplyr

Attaching package: 'dplyr'

The following object is masked from 'package:nlme':

    collapse

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

Loading required package: mgcv
This is mgcv 1.8-28. For overview type 'help("mgcv-package")'.
Loading required package: magicaxis
Warning message:
no DISPLAY variable so Tk is not available 
  group term   estimate  std.error statistic      p.value
1     1    a 18.4989911 2.66565190  6.939762 4.426495e-11
2     1    b  0.7351651 0.05285851 13.908168 6.707721e-32
3     2    a 17.9846382 3.89471928  4.617698 9.958277e-06
4     2    b  0.8059778 0.07839610 10.280842 4.316826e-18
5     3    a 12.7337123 2.43988347  5.218984 7.805268e-07
6     3    b  0.9970547 0.06837750 14.581619 3.624890e-28
7     4    a 20.8000186 2.29260230  9.072668 3.522330e-15
8     4    b  0.7939098 0.04010095 19.797781 5.306758e-39
  group term   estimate  std.error statistic      p.value   conf.low  conf.high
1     1    a 18.4989911 2.66565190  6.939762 4.426495e-11 13.5115741 24.5775534
2     1    b  0.7351651 0.05285851 13.908168 6.707721e-32  0.6299693  0.8496396
3     2    a 17.9846382 3.89471928  4.617698 9.958277e-06 11.1005720 27.3228985
4     2    b  0.8059778 0.07839610 10.280842 4.316826e-18  0.6528925  0.9791066
5     3    a 12.7337123 2.43988347  5.218984 7.805268e-07  8.3197175 18.6312762
6     3    b  0.9970547 0.06837750 14.581619 3.624890e-28  0.8602027  1.1480739
7     4    a 20.8000186 2.29260230  9.072668 3.522330e-15 16.4615849 25.8570850
8     4    b  0.7939098 0.04010095 19.797781 5.306758e-39  0.7142537  0.8786343

nlshelper documentation built on May 2, 2019, 10:22 a.m.