Based on OP's explanation in the question and comments, suppose that the movies treated and untreated are like
-----------------------------------------
month treated movie untreated movies
-------- -------------- ----------------
1 1 2, 3, ..., 10
2 11 12, 13, ..., 20
3 21 22, 23, ..., 30
...
-----------------------------------------
and there are multiple reviews in each month. I guess OP wants a convenient way of getting the average treatment effect (averaged over multiple months). Suppose that data are pooled.
The method OP considers in his second comment to the question is (i) reg y i.tgroup##i.post x1 x2 if month==1, vce(r)
, etc. and then averaging the DID estimates. Let us see if we can do something similar using a single regression. Let's move step by step.
Consider the regression (ii) reg y i.month##(i.tgroup##i.post x1 x2), vce(r)
. Then (ii) should be the same as (i). Standard errors should be OK because heteroskedasticity-robust standard errors are used. The problem with (ii) is that there are $m$ (# of months) treatment effects, which OP wants to average.
So let us impose the restriction that the coefficient on the interaction term is common (the same over all months), and our regression is (iii) reg y i.month##(tgroup post x1 x2) i.tgroup#i.post, vce(r)
. Then a sort of "average treatment effect" is estimated, and all the rest coefficients are month-specific. So far so good.
Remarkably, (i) $\neq$ (iii) in general; (i) is an unweighted average of $\hat\beta_k$'s and (iii) is a particular weighted average of them. The reason follows. Due to the Frisch-Waugh decomposition, (i) equals $m^{-1} \sum_{k=1}^m \hat\beta_k$, where $\hat\beta_k = (X_k'M_{Z_k} X_k)^{-1} X_k' M_{Z_k} y_k$ (DID coefficient for month $k$), $X_k$ is the vector of the interaction terms for month $k$, $Z_k$ the matrix of all other regressors, and $y_k$ the vector of review rates in month $k$, while (iii) gives (according to algebra) $(\sum_{k=1}^m X_k'M_{Z_k} X_k)^{-1} \sum_{k=1}^m X_k'M_{Z_k} y_k = \sum_{k=1}^m C_k \hat\beta_k$, where
$$C_k = \left( \sum_{j=1}^m X_j'M_{Z_j} X_j \right)^{-1} X_k'M_{Z_k} X_k.$$
Note that the mean-group estimator of (i) uses $1/m$ for $C_k$. (Note that $X_k$ is a column vector so $C_k$ is a scalar.) If $X_k'M_{Z_k} X_k$ is the same for all $k$ (months), then $C_k = 1/m$ and hence (iii) = (i).
$C_k\ne 1/m$ due to two reasons. First, the numbers of observations (reviews) are different across months. Second, the covariates (x1
and x2
in the regressions). (i) and (iii) are treatments averaged differently. I think it's a matter of choice. You could also consider other more restricted models such as reg y i.tgroup##t.post x1 x2, vce(r)
as long as you can tell the difference. Why not?
I haven't rigorously checked the following.
If there are no covariates, we can change (iii) to WLS to construct the results from (i), where the weights are $1/\sqrt{n_k}$ with $n_k$ denoting the number of observations in month $k$. (Note: It's WLS to construct the mean-group regression. It has nothing to do with GLS.) That is,
by month, sort: gen nobs = 1/sqrt(_N)
reg y i.tgroup##t.post [aw = wgt], vce(r)
If there are x
variables, then we can compute $C_k$ manually and construct the weights for WLS. Because $1/\sqrt{X_k'M_{Z_k} X_k}$ can be used as weights (for WLS) and $X_k'M_{Z_k} X_k$ is nothing but the SSR from the regression of $X_k$ on $Z_k$, the computation is conceptually straightforward, though Stata coding could be somewhat messy.
gen tr = tgroup*post
gen xmx = .
forv k=1/m {
reg tr tgroup post x1 x2 if month==`k'
replace xmx = e(rss) if month==`k' /* does it work? */
}
gen wgt = 1/sqrt(xmx)
reg y i.tgroup##i.post [aw = wgt], vce(r)