Draft

Multiple Inference

Econometrics
Published

October 16, 2025

Following the empirical example in Duflo, Dupas, and Kremer (2011), we are interested in estimating the following regression model \[ Y_{ij} = \alpha T_j + \boldsymbol X'_{ij} \boldsymbol \beta + e_{ij} \quad i = 1, \ldots, n_j \quad j = 1, \ldots, J, \tag{1}\] where \(Y_{ij}\) is the test score of student \(i\) in school \(j\), \(T_j\) is a binary variable indicating whether or not school \(j\) was tracking, and \(\boldsymbol X'_{ij}\) is a \(d_x \times 1\) vector that includes a constant and other student and school control variables.

The schools record each student’s score on \(d_y\) separate sections of the test. Suppose we are interested in estimating separate regressions of the form in Equation 1 for each of these test scores. Let \(\boldsymbol Y_{ij} \equiv \begin{bmatrix} Y_{ij1}, \ldots, Y_{ijd_y} \end{bmatrix}'\) , \(\boldsymbol \alpha \equiv \begin{bmatrix} \alpha_1, \ldots, \alpha_{d_y} \end{bmatrix}'\), \(\mathbf{B} \equiv \begin{bmatrix} \beta_1', \ldots, \beta_{d_y}' \end{bmatrix}'\), \(\boldsymbol e_{ij} \equiv \begin{bmatrix} e_{ij1} \ldots, e_{ijd_y} \end{bmatrix}'\). Then we can write the system of \(d_y\) regressions as \[ \boldsymbol Y_{ij} = \boldsymbol \alpha T_j + \boldsymbol X'_{ij} \mathbf{B} + \boldsymbol e_{ij} \quad i = 1, \ldots, n_j \quad j = 1, \ldots, J. \]

Code
* Load the data
global data "~/Git/vigneshsomjit.github.io/hasen-econometrics-datasets/DDK2011"
use "$data/DDK2011.dta", clear

* Store variables in macros
local outcomes wordscore sentscore letterscore spellscore additions_score substractions_score multiplications_score
local controls agetest girl bottomhalf etpteacher lowstream
local treatment tracking

* Loop over outcomes 
foreach y of local outcomes {
    * Store inverse of SD of control group
    quietly sum `y' if `treatment' == 0
    local scale = 1/r(sd)
    
    * Estimate the regression and scale the coefficient
    quietly reg `y' `treatment' `controls', vce(cluster schoolid)
    quietly lincom `treatment' * `scale'
    
    * Store the results 
    local b = r(estimate)
    local se = r(se)
    local t = r(t)
    local p = r(p)
    
    * Append to matrix 
    matrix effects = nullmat(effects) \ (`b', `se', `t', `p')
}

*Label matrix 
matrix colnames effects = coef se t p
matrix rownames effects = `outcomes'

matrix list effects

effects[7,4]
                   coef         se          t          p
   wordscore  .14447841  .10102279  1.4301567   .1555064
   sentscore  .10568769  .08410808    1.25657  .21157131
 letterscore  .26383718  .09923162  2.6588015    .009012
  spellscore  .16041144  .10070153  1.5929394  .11404336
additions_~e  .16563474  .07356356  2.2515869  .02633487
substracti~e  .10596988  .06667975  1.5892363  .11487721
multiplica~e  .10575871  .06536277  1.6180268  .10852081