Calculate confidence intervals from bootstrapped model effects.
Arguments
- mod
A fitted model object. 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). Seeboot::boot.ci()
for further options.- digits
The number of decimal places to return for numeric values.
- bci.arg
A named list of any additional arguments to
boot::boot.ci()
, excepting argumentindex
.- ...
Arguments to
bootEff()
.
Value
A summary table of the effects and bootstrapped confidence intervals (data frame), or a list or nested list of same.
Details
bootCI()
uses boot::boot.ci()
to calculate 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()
.
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"
).
Effects and confidence intervals are returned in a summary table, along
with the bootstrap standard errors (standard deviations of the samples) and
the bootstrap biases (sample means minus original estimates). Effects for
which the confidence intervals do not contain zero are highlighted with a
star (i.e. 'significant' at the conf
level).
Note
All bootstrapped confidence intervals will tend to underestimate the true nominal coverage to some extent when sample size is small (Chernick & Labudde, 2009), so the appropriate caution should be exercised in interpretation in such cases. Comparison of different interval types may be informative. For example, normal-theory based intervals may outperform bootstrap percentile methods when n < 34 (Hesterberg, 2015). Ultimately however, the bootstrap is not a solution to small sample size.
References
Chernick, M. R., & Labudde, R. A. (2009). Revisiting Qualms about Bootstrap Confidence Intervals. American Journal of Mathematical and Management Sciences, 29(3–4), 437–456. doi:10/c8zv
Efron, B. (1987). Better Bootstrap Confidence Intervals. Journal of the American Statistical Association, 82(397), 171–185. doi:10/gfww2z
Hesterberg, T. C. (2015). What Teachers Should Know About the Bootstrap: Resampling in the Undergraduate Statistics Curriculum. The American Statistician, 69(4), 371–386. doi:10/gd85v5
Puth, M.-T., Neuhäuser, M., & Ruxton, G. D. (2015). On the variety of methods for calculating confidence intervals by bootstrapping. Journal of Animal Ecology, 84(4), 892–897. doi:10/f8n9rq
Examples
# CIs calculated from bootstrapped SEM
(shipley.sem.ci <- bootCI(shipley.sem.boot))
#> $DD
#> Effect Bias Std. Err. Lower CI Upper CI
#> ------ ------ --------- -------- --------
#> (Intercept) | -0.056 | -0.026 | 0.069 | -0.167 0.085 |
#> lat | -0.688 | 0.026 | 0.101 | -0.828 -0.459 | *
#>
#> $Date
#> Effect Bias Std. Err. Lower CI Upper CI
#> ------ ------ --------- -------- --------
#> (Intercept) | -0.015 | -0.005 | 0.082 | -0.167 0.179 |
#> DD | -0.628 | 0.000 | 0.057 | -0.741 -0.519 | *
#>
#> $Growth
#> Effect Bias Std. Err. Lower CI Upper CI
#> ------ ------ --------- -------- --------
#> (Intercept) | -0.292 | -0.006 | 0.090 | -0.497 -0.141 | *
#> Date | 0.382 | 0.011 | 0.058 | 0.293 0.515 | *
#>
#> $Live
#> Effect Bias Std. Err. Lower CI Upper CI
#> ------ ----- --------- -------- --------
#> (Intercept) | 0.311 | 0.255 | 0.213 | 0.170 0.354 | *
#> Growth | 0.368 | 0.151 | 0.130 | 0.246 0.411 | *
#>
# From original SEM (models)
# (not typically recommended – better to use saved boot objects)
# system.time(
# shipley.sem.ci <- bootCI(shipley.sem, R = 1000, seed = 13,
# ran.eff = "site")
# )