doCoxph | R Documentation |
Fits coxph
on all survival endpoints. doCoxphGeneric
fits univariable
models for each variable in var.names
, and doCoxphMultivariable
fits a
multivariable model for all variables together in var.names
.
doCoxphGeneric(
input.d,
var.names,
var.descriptions,
show.var.detail = FALSE,
show.group.name.for.bin.var = FALSE,
var.ref.groups = NULL,
var.names.surv.time = c("os.yrs", "dss.yrs", "rfs.yrs"),
var.names.surv.time2 = NULL,
var.names.surv.status = c("os.sts", "dss.sts", "rfs.sts"),
event.codes.surv = c("os.event", "dss.event", "rfs.event"),
surv.descriptions = c("OS", "DSS", "PFS"),
var.strata = NULL,
missing.codes = c("N/A", "", "Unk"),
use.firth = 1,
firth.caption = FIRTH.CAPTION,
add_log_hr = FALSE,
stat.test = "waldtest",
bold_pval = FALSE,
sig.level = 0.05,
round.digits.hr = 2,
round.digits.p.value = 4,
round.small = FALSE,
scientific = FALSE,
caption = NA,
html.table.border = 0,
banded.rows = FALSE,
css.class.name.odd = "odd",
css.class.name.even = "even",
split.table = 300,
format = c("long", "wide"),
...
)
doCoxphMultivariable(
input.d,
var.names,
var.descriptions,
show.var.detail = FALSE,
show.group.name.for.bin.var = FALSE,
var.ref.groups = NULL,
var.names.surv.time = c("os.yrs", "dss.yrs", "rfs.yrs"),
var.names.surv.time2 = NULL,
var.names.surv.status = c("os.sts", "dss.sts", "rfs.sts"),
event.codes.surv = c("os.event", "dss.event", "rfs.event"),
surv.descriptions = c("OS", "DSS", "PFS"),
var.strata = NULL,
missing.codes = c("N/A", "", "Unk"),
use.firth = 1,
firth.caption = FIRTH.CAPTION,
add_log_hr = FALSE,
stat.test = "waldtest",
bold_pval = FALSE,
sig.level = 0.05,
round.digits.hr = 2,
round.digits.p.value = 4,
round.small = FALSE,
scientific = FALSE,
caption = NA,
html.table.border = 0,
banded.rows = FALSE,
css.class.name.odd = "odd",
css.class.name.even = "even",
split.table = 300,
format = c("long", "wide"),
...
)
input.d |
The |
var.names |
variables to include as predictors |
var.descriptions |
vector of strings to describe the variables as they are to appear in the table |
show.var.detail |
logical. If |
show.group.name.for.bin.var |
logical. If |
var.ref.groups |
a vector of reference groups. If |
var.names.surv.time |
variable names of survival time |
var.names.surv.time2 |
optional variable names for interval ending
times, used when survival is left-truncated. The interpretation of
|
var.names.surv.status |
variable names of survival status |
event.codes.surv |
event coding of survival status variable |
surv.descriptions |
names abbreviated survival endpoints in returned output |
var.strata |
optional variable name to stratify by using
|
missing.codes |
character strings of missing values used in |
use.firth |
percentage of censored cases before using Firth's method for
Cox regression. If |
firth.caption |
subscript in html table output indicating Firth was used |
add_log_hr |
if |
stat.test |
the overall model test to perform on the Cox regression model. Can be any of "waldtest", "logtest", or "sctest". If Firth is used, only "logtest" can be performed. Test p-values are never Firth corrected ( per instruction from Aline 2015-04-14,15). |
bold_pval |
logical; if |
sig.level |
significance level; default 0.05 |
round.digits.hr |
number of digits for hazard ratio |
round.digits.p.value |
number of digits for p-value |
round.small |
if |
scientific |
if |
caption |
caption for returned object |
html.table.border |
the border type to use for html tables |
banded.rows |
logical. If |
css.class.name.odd |
Used to set the row colour for odd rows |
css.class.name.even |
Used to set the row colour for even rows |
split.table |
number of characters per row before splitting the table. Applies to the pandoc table output. |
format |
Either a "long" or "wide" format for the |
... |
additional arguments to |
Please note the following assumptions:
Marker can be binary, continuous or categorical.
Missing survival time/status variables are coded as NA
(i.e. will only be
checked by is.na()
).
Survival time/status variable name specified in the following order: "os", "dss", "rfs".
Coding of survival status is binary only (i.e. cannot take survival status of > 2 categories).
A list with the following elements
result.table
: a data frame with the Cox model results.
result.table.bamboo
: results transformed into a pandoc-ready format.
Display using cat()
.
result.table.html
: results transformed into an HTML-ready format. Display
using htmlTable::htmlTable()
.
cox.stats
: present for doCoxphMultivariable()
only. A list of
additional Cox model output statistics.
Samuel Leung, Aline Talhouk, Derek Chiu
library(survival)
doCoxphGeneric(input.d = lung, var.names = "sex", var.descriptions = "Sex",
var.names.surv.time = "time",
var.names.surv.status = "status", event.codes.surv = "2",
surv.descriptions = "OS", caption = "")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.