TableSubgroupGLM: TableSubgroupGLM: Sub-group analysis table for GLM.

View source: R/forestglm.R

TableSubgroupGLMR Documentation

TableSubgroupGLM: Sub-group analysis table for GLM.

Description

Sub-group analysis table for GLM.

Usage

TableSubgroupGLM(
  formula,
  var_subgroup = NULL,
  var_cov = NULL,
  data,
  family = "binomial",
  decimal.estimate = 2,
  decimal.percent = 1,
  decimal.pvalue = 3
)

Arguments

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

Details

This result is used to make forestplot.

Value

Sub-group analysis table.

See Also

safely,map,map2 glm svyglm

Examples

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")

jstable documentation built on May 29, 2024, 8:52 a.m.