unicoxph: Perform univariate Cox Regression Analysis for multipe...

Description Usage Arguments Details See Also Examples

View source: R/unicoxph.R

Description

Perform univariate Cox Regression Analysis for multipe variables sequentially.

Usage

1
unicoxph(cox.f,data,variable.display=NULL, plot=TRUE, ...)

Arguments

cox.f

A formula passed to coxph(...), multiple variables on the right side supported.

data

A data frame includes all variables in the cox.f.

variable.display

Variable names expected to display.

plot

Whether to plot univariate Cox regression analysis results.

Details

See examples to check how to prepare a coxTable.

See Also

plot.coxph,forestplot,survdiff,survfit,coxph

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
data("crcdat", package='lxctk')

## Note: relevel all related variables in the data frame; relevel variables in the
##+formula does not work because use `all.vars(...)` to extract variables from a
##+formula. However, the relevel manipulation cannot extract with `all.vars`. So
##+the use must relevel variables in the data frame, or the default rule will be
##+used.
crcdat$MSI <- as.factor(crcdat$MSI>0)
crcdat$Gender <- as.character(crcdat$Gender)
crcdat$Gender <- relevel(as.factor(crcdat$Gender), ref='F')
crcdat$TNM <- relevel(as.factor(crcdat$TNM), ref=1)
crcdat$Tumor.localisation <- relevel(as.factor(crcdat$Tumor.localisation), ref=1)
crcdat$signature <- as.factor(crcdat$signature)
crcdat$Kras_G12_13X <- relevel(as.factor(crcdat$Kras_G12_13X), ref=0)

f <- Surv(Survival.month, status) ~ Age+Gender+MSI+TNM+Tumor.localisation+hypermutated+Kras_G12_13X+signature
unicoxph(f, crcdat)

variable.display <- c('Age', 'Gender (M vs. F)', 'MSI (+ vs. -)', 'TNM (2 vs. 1)', 'TNM (3 vs. 1)', 'TNM (4 vs. 1)', 'Tumor site (2 vs. 1)', 'Hypermutated (True vs. False)', 'Kras_G12_13X (True vs. False)', 'Signature (True vs. False)')
unicoxph(f, crcdat, variable.display)
title(main='An example of unicoxph', sub='Unicoxph')

lixiangchun/lxctk documentation built on May 21, 2019, 6:44 a.m.