control "for post-treatment" variables vs omitted variable bias in chapter 9 of gelman's data analysis using regression and multilevel/hierarchical models, page 170 presents a simple example on the bias of an omitted variable $x$ from a regression of an outcome $y$ on treatment $T$. It uses three regressions:
correct specification including $x$:
$$y_i = \beta_0 + \beta_1 T_i + \beta_2 x_i + \epsilon_i$$
omitting the confounding variable:
$$y_i = \beta_0^* + \beta_1^* T_i + \epsilon_i$$
and regressing the confounding variable on the treatment:
$$x_i = \gamma_0 + \gamma_1 T_i + \nu_i$$
then it substitutes this last expression into the first regression to arrive at
$$y_i = (\beta_0 + \beta_2 \gamma_0) + (\beta_1 + \beta_2 \gamma_1) T_i + (\epsilon_i + \beta_2 \nu_i)$$
and equates $\beta_1^*$ to $\beta_1 + \beta_2^* \gamma_1$ to show that when there is association between the omitted variable and the treatment or between the omitted variable and the outcome then neither $\gamma_1$ or $\beta_2$ are, correspondingly, zero, so there is bias in the estimate of the effect of $T$.
Later, on page 188 the author advises against "controlling for variables measured after treatment / mediators / intermediate outcomes" by using an example of a home visits treatment $T$, outcome $y$ corresponding to a cognitive score on children, and parenting quality $z$.
The author argues that including $z$ in the regression of $y$ on $T$ is problematic because there is an effect of $T$ on $z$. So the coefficient of $T$ in such a regression corresponds to a comparison of units which are identical in $x$ and $z$ but differ in $T$ - but because $T$ has an effect on $z$ these units automatically have different $z$ characteristics (if $T$ is positive, then the unit that did not receive the treatment has lower underlying $z$ "parental skill" than the other in order for the two observations to have the same observed value of $z$). While this makes sense, I am having trouble reconciling this with the earlier example of omitted variable bias. Can't the same be said in the earlier example when $x$ is not omitted? i.e. including it when $T$ has an effect on it implies comparing units with different $T$ values, fixed $x$, but thus different underlying "$x$" characteristics? How are the two cases "different"?
 A: In many of the causality texts, we classify a variable's relation to the exposure or outcome of interest according to their causal relationship as described in a directed acyclic graph (DAG). In this framework, these variables are either:

*

*Confounders which are causally predictive of exposure and outcome for which omitting the variable leads to biased estimates of effect.

*Precision variables in collapsible models which are unrelated to exposure but are predictive of the outcome so that adjustment for these factors reduce the residual error and improves inference and precision

*Prognostic variables in non-collapsible models which are like precision variables except that adjustment also changes the effect measure

*Mediator variables which are caused by the exposure and which shouldn't be adjusted unless the effect of the predictor be attenuated and the direct effect rather than the total effect is reported

*Colliders which are caused by the outcome and generally should not be adjusted

This framework holds in longitudinal and cross-sectional analyses. "Omitted variable bias" can only be understood in this framework, because many intrepid analysts accidentally advocate adjusting for mediators "because they're important" - meaning they predict the outcome. However, according to the theory above, the opposite is true - leave mediators out.
In a longitudinal data analysis, the lagged exposure or the lagged outcome tend to predict later variable values. As such, they become mediators, so adjustment will attenuate the estimated effect of exposure.
As an example, you might study the longitudinal use of statins versus the risk of developing congestive heart failure (CHF). Blood pressure is certainly a complicated variable, because high blood pressure at baseline can indicate novel use of statin, but development of CHF will lower blood pressure. If statin use post-baseline is adjusted, you'll likely find no relationship (or a reduced effect) between statin use and incidence of CHF after adjusting for blood pressure.
