calculate_I {prevtoinc} | R Documentation |
Function to calculate different estimators for I from PPS data.
Description
Function to calculate different estimators for I from PPS data.
Usage
calculate_I(data, data.theo = NULL)
Arguments
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“ |
Value
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).
Examples
# 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)
[Package prevtoinc version 0.12.0 Index]