Learn R Programming

prevtoinc (version 0.12.0)

create_patient_history_add: Function to simulate a single hospital bed trajectory

Description

Simulates the occupation of bed and incidence of HAIs of a single bed. Length of HAI is assumed to be additive to length of stay without HAI.

Usage

create_patient_history_add(X_los_dist, X_loi_dist, I, steps)

Arguments

X_los_dist

vector of probabilities for values 1:length(dist.X.los) of X.los

X_loi_dist

vector of probabilities for values 1:length(dist.X.loi) of X.loi

I

incidence rate per patient-day at risk

steps

number of days to evolve trajectory of bed

Value

data frame with following columns

  • pat_nbr - sequential patient number

  • hai_nbr - sequential HAI number

  • X_los - predicted total length of stay for patient on current day

  • X_los_wo_hai -

  • X_loi - total length of current HAI

  • X_loi_tot - added total lengths of all HAIs up to day

  • A_los - length of stay up to day

  • X_lnint - length of stay after acquiring first HAI

Examples

Run this code
# NOT RUN {

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)
bed_hist <- create_patient_history_add(example.dist.los, example.dist, I = 0.08, 1000)
tail(bed_hist)


# }

Run the code above in your browser using DataLab