Description Usage Arguments Value Examples
This function allows you to calculate mean and sd of a numeric variable by grouping and specific subgroup variable levels (ie. mean age of those belonging to subgroup 1 or 2 by levels of grouping variable)
1 2 | quantify_means_of_subgroup(subgroup_m, mean_var, df, grouping_var,
num_display = "PM", show_pval = TRUE, digits = 1)
|
subgroup_m |
Subgroup variable of interest (must be factor) |
mean_var |
Numeric variable from which to calculate mean and sd |
df |
Dataset containing covariates |
grouping_var |
Variable to group by (will be columns of table) |
num_display |
How should results be displayed? ('PM' for mean +- sd, 'PRS' for mean (sd)) |
show_pval |
Logical. Should the p-value results be displayed? |
digits |
Number of digits to round decimals |
A data frame summarizing mean and sd of a numeric variable by grouping and specific subgroup variable levels
1 2 3 4 5 | ## Not run:
quantify_means_of_subgroup(subgroup_m = Edu_4cat, mean_var = BMI, df = obpv_baseline,
grouping_var = obpv_quintile)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.