subgroup_survival: Title Extract hazard ratio and confidence intervals from a...

View source: R/subgroup_survival.R

subgroup_survivalR Documentation

Title Extract hazard ratio and confidence intervals from a coxph object of subgroup analysis

Description

Title Extract hazard ratio and confidence intervals from a coxph object of subgroup analysis

Usage

subgroup_survival(
  pdata,
  time_name = "time",
  status_name = "status",
  variables,
  object
)

Arguments

pdata

data combine variables, follow up time, and outcome;

time_name

column name of follow up time

status_name

column name of outcome event

variables

object that have several levles;

object

target that use to calculate coxph fit; If target has two levels which name 'High' and 'Low' group, please transform 'High' into '0' and 'Low' into '1' before executing the command

Author(s)

Dongqiang Zeng

Examples


#source data and filter NA
data(subgroup_data)
input <- subgroup_data %>% filter(time > 0) %>% filter(!is.na(status)) %>% filter(!is.na(AJCC_stage))

##for binary variable
data1 <- subgroup_survival(pdata = input,time_name ="time", status_name = "status",
variables = c("ProjectID", "AJCC_stage"), object ="score_binary" )
data1

##for continue variables
data2 <- subgroup_survival(pdata = input, time_name = "time", status_name = "status",
variables = c("ProjectID", "AJCC_stage"), object = "score" )
data2

IOBR/IOBR documentation built on May 5, 2024, 2:34 p.m.