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

Description Usage Arguments Value Note Author(s)


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


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



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.


a vector of covariate names - the clinical covariate to test

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


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.

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


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

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


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.


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

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


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.


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

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 for rounding


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.


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.


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.


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


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.


Ning Leng [email protected], Alexey Pronin [email protected], and previous team members (see DESCRIPTION)

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