View source: R/simulationsfunctions.R
| calculate_I | R Documentation |
Function to calculate different estimators for I from PPS data.
calculate_I(data, data.theo = NULL)
data |
data frame as generated by 'simulate_pps_data' or 'simulate_pps_fast' |
data.theo |
data frame as generated by 'simulate_incidence_stats' or 'simulate incidence_stats_fast“ |
data frame with following columns
n - number of patients sampled
n.noso - number of HAIs
P.hat - estimate of prevalence P
I.hat - estimate of incidence rate I
I.pp.hat - estimate of incidence proportion per admission I.pp
x.loi.hat - estimate of x.loi
x.los.hat - estimate of x.los
method - name of the method
and rows for the estimators gren, rear, pps.median, pps.mean, pps.mixed, rhame.theo, L.full (for a description of the estimators see vignette).
# create example data for PPS
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=200,
P=0.05,
dist.X.loi = example.dist,
dist.X.los = example.dist.los)
head(data.pps.fast)
# estimate incidence based on Rhame-Sudderth formula
calculate_I(data = data.pps.fast)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.