View source: R/subgroup_survival.R
subgroup_survival | R Documentation |
Title Extract hazard ratio and confidence intervals from a coxph object of subgroup analysis
subgroup_survival(
pdata,
time_name = "time",
status_name = "status",
variables,
object
)
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 |
Dongqiang Zeng
#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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.