ezcox_group: Group Cox Analysis and Visualization

Description Usage Arguments Value Examples

View source: R/ezgrp.R

Description

Group Cox Analysis and Visualization

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
ezcox_group(
  data,
  grp_var,
  covariate,
  controls = NULL,
  time = "time",
  status = "status",
  sort = FALSE,
  decreasing = TRUE,
  add_all = FALSE,
  add_caption = TRUE,
  verbose = TRUE,
  headings = list(variable = "Group", n = "N", measure = "Hazard ratio", ci = NULL, p =
    "p"),
  ...
)

Arguments

data

a data.frame containing variables, time and os status.

grp_var

a group column.

covariate

a covariable for cox analysis.

controls

column names specifying controls. The names with pattern "*:|()" will be treated as interaction/combination term, please make sure all column names in data are valid R variable names.

time

column name specifying time, default is 'time'.

status

column name specifying event status, default is 'status'.

sort

if TRUE, sort the models by the HR values.

decreasing

logical, should the sort order be increasing or decreasing?

add_all

if TRUE, add a group for all data rows.

add_caption

if TRUE, add caption to the plot.

verbose

if TRUE, print extra info.

headings

a list for setting the heading text.

...

other arguments passing to forestmodel::forest_model().

Value

a list.

Examples

1
2
3
4
5
6
7
library(survival)
ezcox_group(lung, grp_var = "sex", covariate = "ph.ecog")
ezcox_group(lung, grp_var = "sex", covariate = "ph.ecog", controls = "age")
p <- ezcox_group(lung,
  grp_var = "sex", covariate = "ph.ecog",
  controls = "age", add_all = TRUE
)

ezcox documentation built on Oct. 28, 2021, 5:08 p.m.