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

Description Usage Arguments Details Value See Also Examples

View source: R/forestglm.R

Description

Sub-group analysis table for GLM.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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"

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 confint

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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 Oct. 19, 2021, 5:07 p.m.