We first estimate the parameters in Eq. 4 by 2SLS and obtain the residuals 𝜖^n1,⋯,𝜖^nT. Let ⋅^ denote the estimated value of parameters and ⋅~ denote the counterfactual changes. The counterfactual value of Ynt is computed recursively, Y~n1=∑τ=12Z~n1τρ^τ+Xn1β^+𝜖^n1,Y~n2=∑s=11H~n2,s(α^within)+M~n2,s(α^between)Y~n,2−s+∑τ=12Z~n2τρ^τ+Xn2β^+𝜖^n2,Y~n3=∑s=12H~n3,s(α^within)+M~n3,s(α^between)Y~n,3−s+∑τ=12Z~n3τρ^τ+Xn3β^+𝜖^n3,⋮