quantify_counts_of_subgroup: Quantify Counts of Subgroup

Description Usage Arguments Value Examples

Description

This function allows you to calculate the counts and proportions of a binary variable by grouping and specific subgroup variable levels (ie. counts/proportions of depressed males and females by levels of grouping variable, say treatment arm)

Usage

1
2
quantify_counts_of_subgroup(subgroup_c, count_var, df, grouping_var,
  count_display = "CP", show_pval = TRUE, digits = 1)

Arguments

subgroup_c

Subgroup variable of interest (must be factor)

count_var

Factor variable from which to calculate counts and proportions

df

Dataset containing covariates

grouping_var

Variable to group by (will be columns of table)

count_display

How to display results: 'CP' = counts and proportions, 'C' = counts, 'P' = proportions (defaults to 'CP')

show_pval

Logical. Should the p-value results be displayed?

digits

Number of digits to round decimals

Value

A data frame summarizing counts and proportions of a binary variable by grouping and specific subgroup variable levels

Examples

1
2
3
4
5
## Not run: 
quantify_counts_of_subgroup(grouping_var = randAssign, subgroup_c = depress, count_var = female,
count_display = 'CP', show_pval = TRUE, df = baseline, digits = 1)

## End(Not run)

jjwillard/wfbmcphsr documentation built on May 14, 2019, 5:01 a.m.