SummaryVars: Summary multiple covariates, test across treatment and/or...

Description Usage Arguments Value Note Author(s)

Description

This function performs demographics imbalance checking of a single covariate across multiple groups.

Usage

1
2
3
4
5
6
SummaryVars(data, var, var.name = NULL, trt = NULL, trt.name = NULL,
  subgroup = NULL, subgroup.name = NULL, subgroup.indicator = 1,
  compare.subgroup = FALSE, itt.name = "All", var.class = NULL,
  ordered.factor.levels.list = NULL, cont.show = c("N", "Mean", "Median",
  "Min-Max", "NA's"), digits = 2, trt.order = NULL, test.subgroup = FALSE,
  na.action = "error")

Arguments

data

Input data frame. Rows are patients and columns are variables (e.g. demographics variables, time to event variables, biomarker variables, treatment indicator, etc.). One patient per row.

var

a vector of covariate names - the clinical covariate to test

var.name

preferred display names of the clinical covariates If it is NULL, var will be used.

trt

name of the treatment column. If trt is specified, the analysis will be performed within treatment arm. if it is NULL, the comparison will be performed using all samples.

trt.name

preferred display name of the treatment variable If it is NULL, trt will be used.

subgroup

name of the column which indicates subpopulation (e.g. biomarker evaluable population)

subgroup.name

preferred display name of the subpopulation (e.g. biomarker evaluable population). If it is NULL, subgroup will be used.

subgroup.indicator

In the subpopulation column, which value is used to define the subpopulation (e.g. biomarker evaluable population). Default is 1. It can also be character or logical. Default is 1. The non-subpopulation enrties is not allowed to be specified as NA.

compare.subgroup

If it is TRUE, the output will show summary statistics of subgroup and others. Default is FALSE. If it is FALSE, will show summary statistics of subgroup vs. All patients

itt.name

preferred display name of the full population (e.g. ITT). If it is NULL, "All" will be used.

var.class

a vector that indicates class of the variables. possible categories are "numeric", "categorical" and "ordered.factor". "ordered.factor" can be used to categorical variable with ordered levels - e.g. IC score 0/1/2/3. If class is ordered.factor , ordered.factor.levels need to be specified. If the user doesn't specify class of all variables (the length of the var.class is less than length of var), The program will try to use the class of the column. "numeric","integer" will be treated as "numeric" "logical""character","factor" will be treated as "categorical". In this case the program request that names of the vector var.class is a subset of the var vector.

ordered.factor.levels.list

a list indicates ordered levels for ordered.factor. Each ordered.factor should have a corresponding element in this list.

cont.show

what summary statistics to show for a continuous covariate. Default is c("N" ,"Mean","Median", "Min-Max","NA's"). Possible options are "N" ,"Mean","SEM", "SD","Median", "Min","Max" ,"Min-Max","1st Qrtl.","3rd Qrtl.","IQR" ,"NA's"

digits

digits for rounding

trt.order

If the user wants to display the treatments in a certain order, it can be defined here. All elements in trt.order should be the same unique values in the treatment column.

test.subgroup

whether test across subpopulations within treatment arm. If class is numeric, kruskal wallis rank sum test will be performed. If class is categorical, fisher's exact test will be performed. If class is ordered.factor, cmh test will be performed. The test is always performed between subgroup vs others. P value columns will be included in the output table if it is specified as TRUE. Testing is not recommendated if either subgroup of non-subgroup has small sample size.

na.action

defaults to "na.omit". Possible options are "na.omit", "error" When it is specified as "na.omit", entries with missing trt or subgroup will be automatically removed before calculation.

Value

output object is a matrix with summary statistics. It can be passed to knitr::kable().

Note

trt allows for more than 2 levels. However, only 2 levels are allowed for subgroup. For more general use, a user can specify trt to get summary statistics for any sub-group defination (and leave subgroup as NULL).

This function provides summary statistics of a vector of clinical covariates. Using default parameters, the function provides a table to compare summary statistics in All population vs. in BEP (biomarker evaluable population), within treatment arm.

Author(s)

Ning Leng leng.ning@gene.com, Alexey Pronin pronin.alexey@gene.com, and previous team members (see DESCRIPTION)


lengning/gClinBiomarker documentation built on May 9, 2019, 2:55 p.m.