TableSubgroupGLM | R Documentation |
Sub-group analysis table for GLM.
TableSubgroupGLM(
formula,
var_subgroup = NULL,
var_cov = NULL,
data,
family = "binomial",
decimal.estimate = 2,
decimal.percent = 1,
decimal.pvalue = 3
)
formula |
formula with survival analysis. |
var_subgroup |
1 sub-group variable 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 |
This result is used to make forestplot.
Sub-group analysis table.
safely
,map
,map2
glm
svyglm
library(survival)
library(dplyr)
lung %>%
mutate(
status = as.integer(status == 1),
sex = factor(sex),
kk = factor(as.integer(pat.karno >= 70))
) -> lung
TableSubgroupGLM(status ~ sex, data = lung, family = "binomial")
TableSubgroupGLM(status ~ sex, var_subgroup = "kk", data = lung, family = "binomial")
## survey design
library(survey)
data.design <- svydesign(id = ~1, data = lung)
TableSubgroupGLM(status ~ sex, data = data.design, family = "binomial")
TableSubgroupGLM(status ~ sex, var_subgroup = "kk", data = data.design, family = "binomial")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.