Multiple sub-group analysis table for GLM.

TableSubgroupMultiGLM(
  formula,
  var_subgroups = NULL,
  var_cov = NULL,
  data,
  family = "binomial",
  decimal.estimate = 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.

family

family, "gaussian" or "binomial"

decimal.estimate

Decimal for estimate, 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 TableSubgroupMultiGLM(status ~ sex, var_subgroups = c("kk", "kk1"), data=lung, line = TRUE, family = "binomial")
#> Waiting for profiling to be done...
#> Waiting for profiling to be done...
#> Waiting for profiling to be done...
#> Waiting for profiling to be done...
#> Waiting for profiling to be done...
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: collapsing to unique 'x' values
#> Waiting for profiling to be done...
#> Variable Count Percent OR Lower Upper P value #> sex2 Overall 228 100 3.01 1.66 5.52 <0.001 #> 1...1 <NA> <NA> <NA> <NA> <NA> <NA> <NA> #> 11...2 kk <NA> <NA> <NA> <NA> <NA> <NA> #> init...3 0 38 16.9 7 0.91 145.62 0.098 #> ...4 1 187 83.1 2.94 1.56 5.62 0.001 #> 1...5 <NA> <NA> <NA> <NA> <NA> <NA> <NA> #> 11...6 kk1 <NA> <NA> <NA> <NA> <NA> <NA> #> init...7 0 8 3.6 314366015.19 0 <NA> 0.997 #> ...8 1 217 96.4 2.85 1.56 5.29 0.001 #> P for interaction #> sex2 <NA> #> 1...1 <NA> #> 11...2 0.476 #> init...3 <NA> #> ...4 <NA> #> 1...5 <NA> #> 11...6 0.984 #> init...7 <NA> #> ...8 <NA>
## survey design library(survey) data.design <- svydesign(id = ~1, data = lung)
#> Warning: No weights or probabilities supplied, assuming equal probability
TableSubgroupMultiGLM(status ~ sex, var_subgroups = c("kk", "kk1"), data = data.design, family = "binomial")
#> Variable Count Percent OR Lower Upper P value #> sex2 Overall 228 100 3.01 1.65 5.5 <0.001 #> 1...1 kk <NA> <NA> <NA> <NA> <NA> <NA> #> init...2 0 38 16.9 7 0.64 76.28 0.107 #> ...3 1 187 83.1 2.94 1.54 5.6 0.001 #> 1...4 kk1 <NA> <NA> <NA> <NA> <NA> <NA> #> init...5 0 8 3.6 314366015.19 20361023.24 4853684923.4 <0.001 #> ...6 1 217 96.4 2.85 1.55 5.27 0.001 #> P for interaction #> sex2 <NA> #> 1...1 0.478 #> init...2 <NA> #> ...3 <NA> #> 1...4 <0.001 #> init...5 <NA> #> ...6 <NA>