sstable.ae: Create an adverse event summary table

View source: R/sstable.R

sstable.aeR Documentation

Create an adverse event summary table

Description

A function to create a simple adverse event summary table.

Usage

sstable.ae(
  ae_data,
  fullid_data,
  group_data = NULL,
  id.var,
  aetype.var,
  grade.var = NULL,
  group.var = NULL,
  group.var.priority = NULL,
  arm.var,
  sort.by,
  digits = 0,
  test = TRUE,
  pdigits = 3,
  pcutoff = 0.001,
  chisq.test = FALSE,
  correct = FALSE,
  simulate.p.value = FALSE,
  B = 2000,
  workspace = 1e+06,
  hybrid = FALSE,
  print.aetype.header = length(aetype.var) > 1 | any(length(names(aetype.var)) > 0) |
    any(isTRUE(nchar(names(aetype.var)) > 0)),
  na.text = "(Missing)",
  footer = NULL,
  flextable = TRUE,
  bg = "#F2EFEE"
)

Arguments

ae_data

a data frame contains adverse event data.

fullid_data

a data frame contains treatment arm data of all participants (not just those had adverse event).

group_data

a reference data frame contains the group name of each ae.

id.var

a character specifies name of study id variable (exists in both adverse event data and treatment arm data).

aetype.var

a character specifies name of adverse event type variable (exists in adverse event data).

grade.var

NULL or character specifies name of adverse event grade variable (exists in adverse event data).

group.var

a character specifies group (exists in adverse event data if group_data = NULL or group_data otherwise).

group.var.priority

a vector that specifies which groups will be appear first in the table.

arm.var

a character specifies name of treatment arm variable (exists in treatment arm data).

sort.by

An unquoted formula of sorting options.

Available options are 'ep', 'pt', 'p', or a combination of them (eg ep+pt-p); A minus sign indicates a descending order.

digits

a number specifies number of significant digits for numeric statistics.

test

a logical value specifies whether a statistical test will be performed to compare between treatment arms.

pdigits

a number specifies number of significant digits for p value.

pcutoff

a number specifies threshold value of p value to be displayed as "< pcutoff".

chisq.test

a logical value specifies whether Chi-squared test or Fisher's exact test will be used to compare between treatment arms.

Be aware that even when chisq.test==TRUE, if expected values are < 1, the later test will take over.

correct

a parameter for chisq.test().

simulate.p.value

a parameter for chisq.test() and fisher.test().

B

a parameter for chisq.test() and fisher.test().

workspace

a parameter for fisher.test().

hybrid

a parameter for fisher.test().

print.aetype.header

a logical value, whether to print the label of aetype.header.

na.text

['(Missing)'] in-placed text for missing AE

footer

a vector of strings to be used as footnote of table.

flextable

a logical value specifies whether output will be a flextable-type table.

bg

a character specifies color of the odd rows in the body of flextable-type table.

Value

a flextable-type table or a list with values/headers/footers


oucru-biostats/C306 documentation built on July 16, 2024, 2:33 p.m.