View source: R/fit_growth_rate.R
fit_growth_rate | R Documentation |
This function fits a growth rate model to time series observations and provides parameter estimates along with confidence intervals.
fit_growth_rate(
observations,
level = 0.95,
family = c("poisson", "quasipoisson")
)
observations |
A numeric vector containing the time series observations. |
level |
The confidence level for parameter estimates, a numeric value between 0 and 1. |
family |
A character string specifying the family for modeling. Choose between "poisson," or "quasipoisson". |
A list containing:
'fit': The fitted growth rate model.
'estimate': A numeric vector with parameter estimates, including the growth rate and its confidence interval.
'level': The confidence level used for estimating parameter confidence intervals.
# Fit a growth rate model to a time series of counts
# (e.g., population growth)
data <- c(100, 120, 150, 180, 220, 270)
fit_growth_rate(
observations = data,
level = 0.95,
family = "poisson"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.