R/forestglm.R
TableSubgroupMultiGLM.Rd
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, labeldata = NULL )
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" or 'poisson' or 'quasipoisson' |
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 |
labeldata | Label info, made by `mk.lev` function, Default: NULL |
Multiple sub-group analysis table.
This result is used to make forestplot.
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" )#> Variable Count Percent OR Lower Upper P value P for interaction #> sex2 Overall 228 100 3.01 1.65 5.47 <0.001 <NA> #> 1 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> #> 2 kk <NA> <NA> <NA> <NA> <NA> <NA> 0.476 #> 3 0 38 16.9 7 0.7 70.03 0.098 <NA> #> 4 1 187 83.1 2.94 1.55 5.57 0.001 <NA> #> 5 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> #> 6 kk1 <NA> <NA> <NA> <NA> <NA> <NA> 0.984 #> 7 0 8 3.6 314366015.2 0 Inf 0.997 <NA> #> 8 1 217 96.4 2.85 1.55 5.25 0.001 <NA>#> Warning: No weights or probabilities supplied, assuming equal probabilityTableSubgroupMultiGLM(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.48 <0.001 #> 1 kk <NA> <NA> <NA> <NA> <NA> <NA> #> 2 0 38 16.9 7 0.7 70.4 0.107 #> 3 1 187 83.1 2.94 1.55 5.58 0.001 #> 4 kk1 <NA> <NA> <NA> <NA> <NA> <NA> #> 5 0 8 3.6 314366015.2 35102996.37 2815314979.25 <0.001 #> 6 1 217 96.4 2.85 1.55 5.25 0.001 #> P for interaction #> sex2 <NA> #> 1 0.478 #> 2 <NA> #> 3 <NA> #> 4 <0.001 #> 5 <NA> #> 6 <NA>