confint_nlsLoop: Calculate the confidence intervals from an nlsLoop object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/confint_nlsLoop.R

Description

Determines the confidence intervals of a set of non-linear regressions fitted with nlsLoop.

Usage

1
confint_nlsLoop(data, param_data)

Arguments

data

the data frame containing the data used in the nlsLoop argument

param_data

the nlsLoop object

Details

calculates the confidence intervals of each fit using confint2 and the "asymptotic" approach. This method cannot be changed to "profile" as it the model is fitted with nlsLM

Value

returns a dataframe in stacked format with columns id_col, param, CI_lwr, CI_higher, mean that give the confidence intervals and mean estimate of each model fit.

Author(s)

Daniel Padfield

See Also

nlsLoop for details of fitting the initial nlsLoop object.

confint2 for details of calculating CI from non-linear regressions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# load in data

data("Chlorella_TRC")
Chlorella_TRC_test <- Chlorella_TRC[Chlorella_TRC$curve_id %in% c(1:10),]

# run nlsLoop()

# define the Sharpe-Schoolfield equation
schoolfield_high <- function(lnc, E, Eh, Th, temp, Tc) {
 Tc <- 273.15 + Tc
 k <- 8.62e-5
 boltzmann.term <- lnc + log(exp(E/k*(1/Tc - 1/temp)))
 inactivation.term <- log(1/(1 + exp(Eh/k*(1/Th - 1/temp))))
 return(boltzmann.term + inactivation.term)
}

fits <- nlsLoop(ln.rate ~ schoolfield_high(lnc, E, Eh, Th, temp = K, Tc = 20),
                data = Chlorella_TRC_test,
                tries = 100,
                id_col = 'curve_id',
                supp_errors = 'Y',
                param_bds = c(-10, 10, 0.1, 2, 0.5, 5, 285, 330),
                lower = c(lnc=-10, E=0, Eh=0, Th=0))

CI <- confint_nlsLoop(Chlorella_TRC_test, fits)

padpadpadpad/nlsLoop documentation built on May 24, 2019, 5:59 p.m.