xvar_function: Create a summary table for an individual covariate

View source: R/rm_compactsum.R

xvar_functionR Documentation

Create a summary table for an individual covariate

Description

Create a summary table for an individual covariate

Usage

xvar_function(
  xvar,
  data,
  grp,
  covTitle = "",
  digits = 1,
  digits.cat = 0,
  iqr = TRUE,
  all.stats = FALSE,
  pvalue = TRUE,
  effSize = FALSE,
  show.tests = FALSE,
  percentage = "col"
)

Arguments

xvar

character with the name of covariate to include in table

data

dataframe containing data

grp

character with the name of the grouping variable

covTitle

character with the name of the covariate (predictor) column. The default is to leave this empty for output or, for table only output to use the column name 'Covariate'

digits

numeric specifying the number of digits for summarizing mean data. Otherwise, can specify for individual covariates using a vector of digits where each element is named using the covariate name. If a covariate is not in the vector the default will be used for it (default is 1). See examples

digits.cat

numeric specifying the number of digits for the proportions when summarizing categorical data (default is 0)

iqr

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

all.stats

logical indicating if all summary statistics (Q1, Q3 + min, max on a separate line) should be displayed. Overrides iqr

pvalue

logical indicating if you want p-values included in the table

effSize

logical indicating if you want effect sizes and their 95% confidence intervals included in the table. Effect sizes calculated include Cramer's V for categorical variables, and Cohen's d, Wilcoxon r, Epsilon-squared, or Omega-squared for numeric/continuous variables

show.tests

logical indicating if the type of statistical test and effect size (if effSize = TRUE) used should be shown in a column beside the p-values. Ignored if pvalue = FALSE

percentage

choice of how percentages are presented, either column (default) or row

Value

A data frame is returned


reportRmd documentation built on April 4, 2025, 2:03 a.m.