Under a difference-in-difference design, identification requires that the probabilities time shift for \(Y_{is} (0)\) for class \(m\) evolve similarly for the treated and control groups (parallel
trends on the probability mass functions of \(Y_{is}(0)\)). If this assumption holds, we can recover the probability of shift on the treated for class \(m\):
$$\delta_{m, T} := P(Y_{it} (1) = m | D_i = 1) - P(Y_{it}(0) = m | D_i = 1).$$
causalQual_did applies, for each class \(m\), the canonical two-group/two-period method to the binary variable \(1(Y_{is} = m)\). Specifically,
consider the following linear model:
$$1(Y_{is} = m) = D_i \beta_{m1} + 1(s = t) \beta_{m2} + D_i 1(s = t) \beta_{m3} + \epsilon_{mis}.$$
The OLS estimate \(\hat{\beta}_{m3}\) of \(\beta_{m3}\) is our estimate of the probability shift on the treated for class m. Standard errors are clustered at the unit level and used to construct
conventional confidence intervals.