STAR_MHE
STAR
)STAR
.
The transformed data was obtained using the STATA script krueger.do, obtained from Joshua Angrist website
(http://economics.mit.edu/faculty/angrist/data1/mhe/krueger), on the webstar.dta.
Angrist, A. ad Pischke J-S (2008) Mostly Harmless Econometrics: An Empiricist's Companion, Princeton University press
STAR
for the original dataset.
data(STAR_MHE)
# Compute the group means:
STAR_MHE_means <- aggregate(STAR_MHE[, c('classid', 'pscore', 'cs')],
by=list(STAR_MHE$classid), mean)
# Regression of means, with weighted average:
reg_krug_gls <- lm(pscore~cs, data=STAR_MHE_means, weights=cs)
coef(summary(reg_krug_gls))[2,2]
Run the code above in your browser using DataLab