Description Usage Arguments Value Examples
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)
1 2 | quantify_counts_of_subgroup(subgroup_c, count_var, df, grouping_var,
count_display = "CP", show_pval = TRUE, digits = 1)
|
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 |
A data frame summarizing counts and proportions of a binary variable by grouping and specific subgroup variable levels
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.