Learn R Programming

predint (version 2.2.1)

boot_predint: Bootstrap new data from uncalibrated prediction intervals

Description

boot_predint() is a helper function to bootstrap new data from the simple uncalibrated prediction intervals implemented in predint.

Usage

boot_predint(pred_int, nboot)

Value

boot_predint returns an object of class c("predint", "bootstrap")

which is a list with two entries: One for bootstrapped historical observations and one for bootstrapped future observations.

Arguments

pred_int

object of class c("quasiPoissonPI", "betaBinomialPI", "quasiBinomialPI", negativeBinomialPI)

nboot

number of bootstraps

Details

This function only works for binomial and Poisson type data. For the sampling of new data from random effects models see lmer_bs.

Examples

Run this code
# Simple quasi-Poisson PI
test_pi <- qp_pi(histoffset=c(3,3,3,4,5), newoffset=3, lambda=10, phi=3, q=1.96)

# Draw 5 bootstrap samles
test_boot <- boot_predint(pred_int = test_pi, nboot=50)
str(test_boot)
summary(test_boot)

# Please note that the low number of bootstrap samples was chosen in order to
# decrease computing time. For valid analysis draw at least 10000 bootstrap samples.

Run the code above in your browser using DataLab