Skip to contents

This function returns a vector of variable names for which there is a significant difference between specified groups.

Usage

get_sig_differences_between_groups(df, test_vars = NULL, group)

Arguments

df

data.frame

test_vars

(character) vector of variable names to test for differences (if NULL, all vars except group)

group

(character) name of grouping variable

Value

(character) vector of test variables for which there is a significant difference between groups

Details

Group differences are tested using ANOVA (for numeric test variables) or Chi-square (for categorical test variables) with ana_fn_aov() and ana_fn_chisq(). Significant differences are determined using the threshold p < .05.

Examples

if (FALSE) {
df |> get_sig_differences_between_groups(c("Age", "Nationality"), group="Gender")
}