Estimation of the average causal effect among subgroups defined by post-treatment variables