Description Usage Arguments Value Examples
This meta-function takes a time series of abundance, and attempts to extract an estimate of exponential growth rate, using one or more of a suite of possible methods. These methods allow for the possibility that exponential growth may lag or saturate, or both, over the course of the time series. All selected methods are used to fit models to the time series. Subsequently, model comparison (based on AIC) is used to determine which model best fits the focal data.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
x |
Time steps |
y |
ln(abundance) |
id |
Label corresponding to the population/strain/species of interest; used to determine the title and file name of saved plot, if any. |
plot.best.Q |
logical; should the best fitting model be plotted? |
fpath |
character; if best model is to be plotted, provide the file path for saving the plot |
methods |
Must be a character vector containing one or more of |
model.selection |
control parameter to specify which IC metric to use in model selection; default is AICc, which corrects for small sample sizes and converges asymptotically on AIC. |
min.exp.obs |
control parameter specifying the minimum number of observations that must fall within the estimated exponential phase in order to consider lag, sat, lagsat, and flr models; defaults to 3. |
internal.r2.cutoff |
control parameter specifying the R2 criteria that may be applied to drop fits where the number of observations in the exponential portion is equal to 3. The default value of zero permits all fits of 3 obs to be considered. |
verbose |
logical; display or suppress diagnostics |
zero.time |
if TRUE, shift time axis so that each time series starts at time = 0 |
A data frame containing the identity of the best model, the content of the best model, the estimated slopes of the increasing linear portion of the regressions (ie, exponential growth rate), the standard errors associated with these slopes, the IC table used to determine the best model, and the full list of all models fit. See vignette for details.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | sdat<-data.frame(trt=c(rep('A',10),rep('B',10),rep('C',10),rep('D',10)),
dtime=rep(seq(1,10),4),
ln.fluor=c(c(1,1.1,0.9,1,2,3,4,5,5.2,4.7),
c(1.1,0.9,1,2,3,4,4.1,4.2,3.7,4)+0.3,
c(3.5,3.4,3.6,3.5,3.2,2.2,1.2,0.5,0.4,0.1),
c(5.5,4.5,3.5,2.5,1.5,0,0.2,-0.1,0,-0.1)))
# for single replicate
sdat2<-sdat[sdat$trt=='A',]
# calculate growth rate using all available methods:
res<-get.growth.rate(sdat2$dtime,sdat2$ln.fluor,plot.best.Q = TRUE,id = 'Population A')
res$best.model
res$best.slope
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.