extractCox: Extract subset of Cox regression statistics.

Description Usage Arguments Details Examples

View source: R/tableFns.R

Description

Extract a subset of the Cox proportional hazard output values and format in report-ready table.

Usage

1

Arguments

cox

Details

The infection status variable assumed to be the last covariate in list.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
##---- 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 (cox) 
{
    dpl <- 3
    lastRow <- nrow(coef(cox))
    beta <- round(coef(cox)[lastRow, "coef"], dpl)
    se <- round(coef(cox)[lastRow, "se(coef)"], dpl)
    p <- round(coef(cox)[lastRow, "Pr(>|z|)"], dpl)
    CI <- round(cox$conf.int[lastRow, c("lower .95", "upper .95")], 
        dpl)
    res <- cbind(beta, `exp(beta)` = round(exp(beta), 3), CI[1], 
        CI[2], p)
    res
  }

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