semEff (version 0.1.0)

bootCI: Bootstrap Confidence Intervals

Description

Calculate confidence intervals from bootstrapped model effects.

Usage

bootCI(mod, conf = 0.95, type = "bca", digits = 3, bci.arg = NULL,
  ...)

Arguments

mod

A fitted model object of class "lm", "glm", or "merMod". Alternatively, a boot object (class "boot"), containing bootstrapped model effects. Can also be a list or nested list of such objects.

conf

A numeric value specifying the confidence level for the intervals.

type

The type of confidence interval to return (defaults to "bca" - see Details). See boot.ci for further specification details.

digits

The number of significant digits to return for numeric values.

bci.arg

A named list of any additional arguments to boot.ci, excepting argument index.

...

Arguments to bootEff.

Value

A data frame of the effects and bootstrapped confidence intervals, or a list or nested list of same.

Details

This is essentially a wrapper for boot.ci from the boot package, returning confidence intervals of the specified type and level calculated from bootstrapped model effects. If a model or models is supplied, bootstrapping will first be performed via bootEff. Effects for which the confidence intervals do not contain zero are highlighted with a star.

Nonparametric bias-corrected and accelerated confidence intervals (BCa, Efron 1987) are calculated by default, which should provide the most accurate coverage across a range of bootstrap sampling distributions (Puth et al. 2015). They will, however, be inappropriate for parametric resampling - in which case the default will be set to the bootstrap percentile method instead ("perc").

References

Chernick, M. R., & Labudde, R. A. (2009). Revisiting Qualms about Bootstrap Confidence Intervals. American Journal of Mathematical and Management Sciences, 29(3<U+2013>4), 437<U+2013>456. https://doi.org/c8zv

Efron, B. (1987). Better Bootstrap Confidence Intervals. Journal of the American Statistical Association, 82(397), 171<U+2013>185. https://doi.org/gfww2z

Hesterberg, T. C. (2015). What Teachers Should Know About the Bootstrap: Resampling in the Undergraduate Statistics Curriculum. The American Statistician, 69(4), 371<U+2013>386. https://doi.org/gd85v5

Puth, M.-T., Neuh<U+00E4>user, M., & Ruxton, G. D. (2015). On the variety of methods for calculating confidence intervals by bootstrapping. Journal of Animal Ecology, 84(4), 892<U+2013>897. https://doi.org/f8n9rq

See Also

boot.ci, bootEff

Examples

Run this code
# NOT RUN {
## CI's from bootstrapped SEM
bootCI(Shipley.SEM.Boot)

## From original SEM (models)
## (not typically recommended - better to use saved boot objects)

# }
# NOT RUN {
system.time(
  Shipley.SEM.CI <- bootCI(Shipley.SEM, ran.eff = "site", seed = 53908,
                           ncpus = 2)
)
# }

Run the code above in your browser using DataCamp Workspace