LOStable: Hospital length of stay table

Description Usage Arguments Author(s) See Also Examples

View source: R/tableFns.R

Description

Stratified data estimates of length of stay with standard errors.

Usage

1
LOStable(output.LOS, se = TRUE)

Arguments

output.LOS
se

Author(s)

N Green

See Also

listLOS

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (output.LOS, se = TRUE) 
{
    LOS <- NULL
    dp <- 2
    for (i in names(output.LOS)) {
        if (is.na(output.LOS[[i]][[1]][1])) {
            LOS <- c(LOS, NA)
        }
        else {
            if (se) {
                LOS <- c(LOS, paste(round(output.LOS[[i]]$clos.data$e.phi, 
                  dp), " (", round(output.LOS[[i]]$se, dp), ")", 
                  sep = ""))
            }
            else {
                LOS <- c(LOS, paste(round(output.LOS[[i]]$clos.data$e.phi, 
                  dp), " [", round(output.LOS[[i]]$clos.data$e.phi - 
                  1.96 * output.LOS[[i]]$se, dp), ", ", round(output.LOS[[i]]$clos.data$e.phi + 
                  1.96 * output.LOS[[i]]$se, dp), "]", sep = ""))
            }
        }
    }
    res <- data.frame(Group = names(output.LOS), `Excess LOS` = LOS)
    rownames(res) <- names(output.LOS)
    res <- res[, -1, drop = FALSE]
    res
  }

n8thangreen/HESmanip documentation built on March 21, 2020, 12:20 a.m.