Multiple sub-group analysis table for Cox/svycox model.

TableSubgroupMultiCox(
  formula,
  var_subgroups = NULL,
  var_cov = NULL,
  data,
  time_eventrate = 3 * 365,
  decimal.hr = 2,
  decimal.percent = 1,
  decimal.pvalue = 3,
  line = F
)

Arguments

formula

formula with survival analysis.

var_subgroups

Multiple sub-group variables for analysis, Default: NULL

var_cov

Variables for additional adjust, Default: NULL

data

Data or svydesign in survey package.

time_eventrate

Time for kaplan-meier based event rate calculation, Default = 365 * 3

decimal.hr

Decimal for hazard ratio, Default: 2

decimal.percent

Decimal for percent, Default: 1

decimal.pvalue

Decimal for pvalue, Default: 3

line

Include new-line between sub-group variables, Default: F

Value

Multiple sub-group analysis table.

Details

This result is used to make forestplot.

See also

Examples

library(survival);library(dplyr) lung %>% mutate(status = as.integer(status == 1), sex = factor(sex), kk = factor(as.integer(pat.karno >= 70)), kk1 = factor(as.integer(pat.karno >= 60))) -> lung TableSubgroupMultiCox(Surv(time, status) ~ sex, var_subgroups = c("kk", "kk1"), data=lung, time_eventrate = 100, line = TRUE)
#> Warning: Loglik converged before variable 1,2,3 ; coefficient may be infinite.
#> Variable Count Percent Point Estimate Lower Upper 1 2 P value #> sex2 Overall 228 100 1.91 1.14 3.2 0 1.2 0.014 #> 1...1 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> #> 12...2 kk <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> #> 0...3 0 38 16.9 2.88 0.31 26.49 0 0 0.35 #> 11...4 1 187 83.1 1.84 1.08 3.14 0 1.5 0.026 #> 1...5 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> #> 12...6 kk1 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> #> 0...7 0 8 3.6 <NA> <NA> <NA> 0 0 <NA> #> 11...8 1 217 96.4 1.88 1.12 3.17 0 1.3 0.018 #> P for interaction #> sex2 <NA> #> 1...1 <NA> #> 12...2 0.525 #> 0...3 <NA> #> 11...4 <NA> #> 1...5 <NA> #> 12...6 0.997 #> 0...7 <NA> #> 11...8 <NA>
## survey design library(survey) data.design <- svydesign(id = ~1, data = lung)
#> Warning: No weights or probabilities supplied, assuming equal probability
TableSubgroupMultiCox(Surv(time, status) ~ sex, var_subgroups = c("kk", "kk1"), data = data.design, time_eventrate = 100)
#> Independent Sampling design (with replacement) #> svydesign(id = ~1, data = lung) #> Independent Sampling design (with replacement) #> svydesign(id = ~1, data = lung)
#> New names: #> * NA -> ...1 #> * NA -> ...2
#> Independent Sampling design (with replacement) #> subset(data, get(var_subgroup) == .) #> Independent Sampling design (with replacement) #> subset(data, get(var_subgroup) == .)
#> Warning: Loglik converged before variable 1,2,3 ; coefficient may be infinite.
#> Independent Sampling design (with replacement) #> svydesign(id = ~1, data = lung)
#> Warning: Loglik converged before variable 1,2,3 ; coefficient may be infinite.
#> New names: #> * NA -> ...1 #> * NA -> ...2
#> Independent Sampling design (with replacement) #> subset(data, get(var_subgroup) == .)
#> Variable Count Percent Point Estimate Lower Upper 1 2 P value #> sex2 Overall 228 100 1.91 1.14 3.19 0 1.2 0.013 #> 1...1 kk <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> #> ...2 0 38 16.9 2.88 0.31 27.1 0 0 0.355 #> ...3 1 187 83.1 1.84 1.08 3.11 0 2.9 0.024 #> 1...4 kk1 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> #> ...5 0 <NA> <NA> <NA> <NA> <NA> 0 0 <NA> #> sex21 1 217 <NA> 1.88 1.12 3.15 0 1.3 0.017 #> P for interaction #> sex2 <NA> #> 1...1 0.523 #> ...2 <NA> #> ...3 <NA> #> 1...4 <0.001 #> ...5 <NA> #> sex21 <NA>