This internal helper function generates descriptive statistics for each group within the original study data. It calculates the sample size, mean, standard deviation, median, median absolute deviation, minimum, maximum, skewness, and kurtosis for the values associated with each group.
generate_descriptives(df, group_var)A data frame containing the study data.
The name of the column in df that contains the group labels.
The function iterates over each unique group found in the group_var column
of the data frame df. For each group, it computes the descriptive statistics
using base R functions and functions from the psych and e1071 packages for
skewness and kurtosis, respectively.
The results are returned as a data frame where each row corresponds to a group and each column to a descriptive statistic.