I have data with a sample size of 1000. The data have 20 variables (1 numeric variable and 19 categorical variables). In one code, I would like to calculate the mean and SD of the numeric variable by each level of categorical variables. I want to know the average of the numeric variable by gender, for example. Then at the same time, I want to calculate this average by age group, education and other qualitative variables.
If I use the group_by
(sex, age, education, ...), then I can not calculate the mean of numeric variable by each level of categorical variables separately.
How can I calculate the mean of numeric variable by all categorical variables?