generate a descriptive statistics table with means and standard deviations overall and for each group

get_descriptives_table(
  data,
  grouping_variable,
  grouping_values,
  variables = c("n", "age", "female", "edu_years", "cesd", "mmse")
)

Arguments

data

input dataset

grouping_variable

name of variable to group

grouping_values

levels of the grouping variable

variables

names of variables to obtain descriptive statistics (default: c('n', 'age', 'female', 'edu_years', 'cesd', 'mmse'))

Value

data.frame of descriptive statistics table