I'm trying to get the average hours used by individuals of different combinations of characteristics (gender, class section, work type, and affiliation). I already fixed my dataset such that gender assignment is binary, and the rest are also just up to 3 classifications. So, for example, I'll need to get the average hours of all females in class section 1, work type 3, and affiliation 2. And I'll need to do the same for males in other classes, work types, and affiliations. I assume that I can use the foreach command to do this, and then make loops, but I can not wrap my head around it right now

Sorry if this is unclear, I am also fixing my English haha