Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

clos

Change in Length of Stay


Description

The function estimates the expected change in length of stay (LOS) associated with an intermediate event.

Usage

clos(x, aw, ratio, ...)
## S3 method for class 'etm'
clos(x, aw = FALSE, ratio = FALSE, ...)
## S3 method for class 'msfit'
clos(x, aw = FALSE, ratio = FALSE, cox_model, ...)

Arguments

x

An object of class etm. Argument delta.na in etm must be set to TRUE in order to use this function.

aw

Logical. Whether to compute the expected change of LOS using alternative weighting. Default is FALSE.

ratio

Logical. Compute the ratio of the expected length-of-stay given instermediate event status instead of a difference. Default value is FALSE

cox_model

TODO

...

Further arguments

Details

The approach for evaluating the impact of an intermediate event on the expected change in length of stay is based on Schulgen and Schumacher (1996). They suggested to consider the difference of the expected subsequent stay given infectious status at time s.

Extensions to the methods of Schulgen and Schumacher and the earlier implementation in the changeLOS include the possibility to compute the extra length of stay both for competing endpoints and the more simple case of one absorbing state, as well as the possibility to compute this quantity for left-truncated data.

Value

An object of class clos.etm with the following components:

e.phi

Change in length of stay

phi.case

Estimates of E(LOS | X_s = intermediate event) for all observed transition times s, where X_sdenotes the state by time s

phi.control

Estimates of E(LOS|X_s = initial state) for all observed transition times s.

e.phi2

Weighted average of the difference between phi2.case and phi2.control.

phi2.case

Estimates of E(LOS \strong{1}(X_LOS = discharge)|X_s = intermediate event), where \strong{1} denotes the indicator function.

phi2.control

E(LOS \strong{1}(X_LOS = discharge)|X_s = initial state).

e.phi3

Weighted average of the difference between phi3.case and phi3.control.

phi3.case

Estimates of E(LOS \strong{1}(X_LOS = death)|X_s = intermediate event).

phi3.control

E(LOS \strong{1}(X_LOS = death)|X_s = initial state).

weights

Weights used to compute the weighted averages.

w.time

Times at which the weights are computed.

time

All transition times.

e.phi.weights.1

Expected change in LOS using weights.1

e.phi.weights.other

Expected change in LOS using weights.other

weights.1

Weights corresponding to the conditional waiting time in the intial state given one experiences the intermediate event.

weights.other

Weights corresponding to the conditional waiting time given one does not experience the intermediate event.

Author(s)

Arthur Allignol arthur.allignol@gmail.com, Matthias Wangler, Jan Beyersmann

References

G Schulgen and M Schumacher (1996). Estimation of prolongation of hospital stay attributable to nosocomial infections. Lifetime Data Analysis 2, 219-240.

J Beyersmann, P Gastmeier, H Grundmann, S Baerwolf, C Geffers, M Behnke, H Rueden, and M Schumacher (2006). Use of Multistate Models to Assess Prolongation of Intensive Care Unit Stay Due to Nosocomial Infection. Infection Control and Hospital Epidemiology 27, 493-499.

Allignol A, Schumacher M, Beyersmann J: Estimating summary functionals in multistate models with an application to hospital infection data. Computation Stat, 2011; 26: 181-197.

M Wrangler, J Beyersmann and M Schumacher (2006). changeLOS: An R-package for change in length of hospital stay based on the Aalen-Johansen estimator. R News 6(2), 31–35.

See Also

Examples

data(los.data)

## putting los.data in the long format
my.observ <- prepare.los.data(x=los.data)

tra <- matrix(FALSE, 4, 4)
tra[1, 2:4] <- TRUE
tra[2, 3:4] <- TRUE

tr.prob <- etm(my.observ, c("0","1","2","3"), tra, NULL, 0)

cLOS <- etm::clos(tr.prob)
plot(cLOS)


### Compute bootstrapped SE

## function that performs the bootstrap
## nboot: number of bootstrap samples. Other arguments are as in etm()
boot.clos <- function(data, state.names, tra, cens.name, s = 0, nboot) {
    res <- double(nboot)
    for (i in seq_len(nboot)) {
        index <- sample(unique(data$id), replace = TRUE)
        inds <- new.id <- NULL
        for (j in seq_along(index)){
            ind <- which(data$id == index[j])
            new.id <- c(new.id, rep(j, length(ind)))
            inds <- c(inds, ind)
        }
        dboot <- cbind(data[inds, ], new.id)
        dboot[, which(names(dboot) == "id")]
        dboot$id <- dboot$new.id
        tr.prob <- etm(dboot, state.names, tra, cens.name, s, cova = FALSE)
        res[i] <- etm::clos(tr.prob)$e.phi
    }
    res
}

## bootstrap
se <- sqrt(var(boot.clos(my.observ, c("0","1","2","3"), tra, NULL, 0,
                         nboot = 10)))

etm

Empirical Transition Matrix

v1.1.1
MIT + file LICENSE
Authors
Mark Clements [aut, cre], Arthur Allignol [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.