subgroups: Create subgroup analysis table (subgroups)

View source: R/subgroups.R

subgroupsR Documentation

Create subgroup analysis table (subgroups)

Description

subgroups() is a function which create a dataframe, which can be copied directly into word or presented in as a subgroup analysis.

Usage

subgroups(df,group,subgroups,outcome,test,time.to,
                  strata.fixed,strata.random,digs_p,digs_s,
                  conf.level, paired,markdown, caption, fig)

Arguments

df

dataframe. (df)

group

Column name of stratification (string)

subgroups

column names of subgroups (list)

outcome

column name of outcome of interest (string)

test

list of tests carried out, currently the following works: t.test, wilcox.test, fisher.test, auc, lm, and glm. (list)

time.to

Column name of the time column for cox regression (list)

strata.fixed

list of columns which should be used as fixed stratification (list)

strata.random

list of columns which should be used as random stratification (list)

digs_p

digits for p-values (numeric)

digs_s

digits for statistics (numeric)

conf.level

confidence intervals which should be presented (numeric).

paired

if tests should be paired (boolean)

markdown

default is true and output is pander, while false output is a dataframe (boolean)

caption

Table caption only in use when markdown is true (string)

fig

If figure should be presented (boolean)

Value

Returns summarised information in dataframe.

Examples

## Not run: 
   zubgroups <- c(`Estimated fetal weight`="est_fetal_weight_grp",
   `Gestational age`="Gestational Age at rand (cat)",
   `End diastolic flow`="end_dia_flow_grp",
   `Uterine artery Doppler / Notch`="dop_notch_grp",
   `Maternal S-Placental-GF`="maternalSplacentalGF_grp",
   `Hypertension or preeclampsia`="ht_preeclamps_grp",
   `Abdominal circumference`="abd_circum_cent_grp")

   subgroups(df,group="group",zubgroups,
      outcome="Infant survival without SAE",
      test="glm",strata.fixed = "site")

## End(Not run)


lilleoel/clintools documentation built on April 17, 2025, 6:09 p.m.