calculate_I_rhame {prevtoinc} | R Documentation |
Function to calculate incidence from PPS data using a Rhame-Sudderth like approach with estimates for x.loi and x.los supplied.
Description
Function to calculate incidence from PPS data using a Rhame-Sudderth like approach with estimates for x.loi and x.los supplied.
Usage
calculate_I_rhame(data, x.loi.hat, x.los.hat = NA, method = "rhame")
Arguments
data |
one-row data frame which contains a column A.loi (only used to calculate P.hat) with lengths of nosocomial infections up to survey (a 0 indicates no HAI present) |
x.loi.hat |
value for estimated expected length of infection x_loi |
x.los.hat |
value for estimated expected length of stay x_los (optional) |
method |
a string with associated name for method |
Value
one-row 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
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_rhame(data = data.pps.fast,
x.loi.hat = 8,
x.los.hat = 13)