In my data 'DATA1', I am trying to calculate mean of the variable 'VAR' and want to stratify it by two other variables 'MClas' as well as 'SEX'. I have tried the following code but it doesn't seem to be working. How do I modify it for both stratifications at once?
DATA1 %>%
group_by(MClas & SEX) %>%
summarise(
n = n(),
meanMT = mean(VAR, na.rm=T))