Learn R Programming

pcvr (version 1.2.0)

fitGrowth: Ease of use wrapper function for fitting various growth models specified by growthSS

Description

Ease of use wrapper function for fitting various growth models specified by growthSS

Usage

fitGrowth(ss, ...)

Value

A fit model from the selected type.

Arguments

ss

A list generated by growthSS.

...

Additional arguments passed to model fitting functions determined by ss$type. For type = "nlme" these are passed to nlme::nlmeControl, not nlme::nlme. Additional arguments are documented in fitGrowthbrms, fitGrowthnlme, fitGrowthnls, fitGrowthnlrq, fitGrowthmgcvgam, fitGrowthsurvreg, fitGrowthflexsurv.

See Also

growthPlot for model visualization, testGrowth for hypothesis testing, barg for Bayesian model reporting metrics.

Examples

Run this code

simdf <- growthSim("logistic",
  n = 20, t = 25,
  params = list("A" = c(200, 160), "B" = c(13, 11), "C" = c(3, 3.5))
)
ss <- growthSS(
  model = "logistic", form = y ~ time | group,
  df = simdf, type = "nls"
)
fitGrowth(ss)
ss <- growthSS(
  model = "gam", form = y ~ time | group,
  df = simdf, type = "nls"
)
fitGrowth(ss)

Run the code above in your browser using DataLab