CI_np_bs {prevtoinc} | R Documentation |
Function to calculate confidence intervals I.pp for gren estimator with bootstrap method based on Grenander estimator
Description
Implements a bootstrap procedure for estimation of confidence intervals for I.pp based on boostrapping from the length of stay/infection distributions estimated by the gren method.
Usage
CI_np_bs(data, n_bs = 1000, alpha = 0.05)
Arguments
data |
data frame which contains a column 'A.loi' with lengths of nosocomial infections up to survey point ( zero if none) and a column 'A.los' with length of stay up to survey point |
n_bs |
number of bootstrap samples to use for calculations |
alpha |
confidence level |
Value
single-row tibble with columns CI.lower.Ipp and CI.upper.Ipp
Examples
example.dist <- create_dist_vec(function(x) dpois(x-1, 7), max.dist = 70)
example.dist.los <- create_dist_vec(function(x) dpois(x-1, lambda = 12),
max.dist = 70)
data.pps.fast <- simulate_pps_fast(n.sample=5000,
P=0.05,
dist.X.loi = example.dist,
dist.X.los = example.dist.los)
gren_est <- calculate_I_smooth(data = data.pps.fast, method = "gren")
gren_est
CI_np_bs(data.pps.fast, n_bs = 500)
[Package prevtoinc version 0.12.0 Index]