covsum: Returns a dataframe corresponding to a descriptive table

Description Usage Arguments Value See Also

View source: R/main.R

Description

Returns a dataframe corresponding to a descriptive table

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
covsum(
  data,
  covs,
  maincov = NULL,
  digits = 1,
  numobs = NULL,
  markup = TRUE,
  sanitize = TRUE,
  nicenames = TRUE,
  IQR = FALSE,
  digits.cat = 0,
  testcont = c("rank-sum test", "ANOVA"),
  testcat = c("Chi-squared", "Fisher"),
  showTests = T,
  excludeLevels = NULL
)

Arguments

data

dataframe containing data

covs

character vector with the names of columns to include in table

maincov

covariate to stratify table by

digits

the number of digits to round continuous variables to, defaults to 1

numobs

named list overriding the number of people you expect to have the covariate

markup

boolean indicating if you want latex markup

sanitize

boolean indicating if you want to sanitize all strings to not break LaTeX

nicenames

booling indicating if you want to replace . and _ in strings with a space

IQR

boolean indicating if you want to display the inter quantile range (Q1,Q3) as opposed to (min,max) in the summary for continuous variables

digits.cat

number of digits for the proportions when summarizing categorical data (default: 0)

testcont

test of choice for continuous variables, one of rank-sum (default) or ANOVA

testcat

test of choice for categorical variables, one of Chi-squared (default) or Fisher

showTests

boolean indicating if the type of statistical used should be shown in a column

excludeLevels

a named list of levels to exclude in the form list(varname =c('level1','level2')) these levels will be excluded from association tests

Value

A formatted table displaying a summary of the covariates stratified by maincov

See Also

fisher.test, chisq.test, wilcox.test, kruskal.test, and anova


Avery-Lisa/myReportRx documentation built on May 23, 2021, 2:30 a.m.