TableSubgroupMultiGLM | R Documentation |
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
)
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 |
This result is used to make forestplot.
Multiple sub-group analysis table.
map
bind
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"
)
## survey design
library(survey)
data.design <- svydesign(id = ~1, data = lung)
TableSubgroupMultiGLM(status ~ sex,
var_subgroups = c("kk", "kk1"),
data = data.design, family = "binomial"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.