Factorial anova

To compare the means in multiple groups defined by multiple categorical predictors (i.e. factors), factorial analysis of variance can be used. In this example, a dataset/dataframe called dat contains categorical variables groupingVariable and dichotomousVariable and a continuous variable dependentVariable.

SPSS

UNIANOVA dependentVariable BY groupingVariable dichotomousVariable
  /PLOT = PROFILE(groupingVariable * dichotomousVariable)
  /DESIGN = groupingVariable D groupingVariable * dichotomousVariable.

R

fanova(dat,
       y = 'dependentVariable',
       between = c('groupingVariable',
                   'dichotomousVariable'),
       plot=TRUE)