Simple averages and comparisons can be interpreted as special cases of regression
The key is to use an ‘indicator’ variable, a predictor that is 0 or 1 to indicate membership in a category.
indicate