mmqreg enforces X=Z. Machado and Santos Silva (2019) also do this for simplicity (footnote 4).
The marginal effect of X, when X=Z, on the tau-quantile of Y (the "regression quantile coefficient") is (from equation 4, but written with parameters on page 150):
beta_hat(tau,X) = beta_hat + q_hat*gamma_hat
That made me wonder, if X!=Z, then what? Suppose Z=[X,W], where W is some additional variable. Then is it true that
beta_hat(tau,W) = q_hat*gamma_hat_W?
This is obviously not the "regression quantile coefficient", rather it allows W to only affect scale and not location. Am I thinking about this correctly? In fact, I'm not even sure how to interpret beta_hat(tau,X), when X!=Z. The X's are still affecting location and scale, but they are conditional on W affecting only scale.
The below code reproduces mmqreg when X=Z (by hand, but no s.e.). The second chunk adds a variable to Z, in this case age.
FernandoRios
Joao Santos Silva
Ref: Machado, J.A.F. and Santos Silva, J.M.C. (2019), Quantiles via Moments, Journal of Econometrics, 213(1), pp. 145-173.
The marginal effect of X, when X=Z, on the tau-quantile of Y (the "regression quantile coefficient") is (from equation 4, but written with parameters on page 150):
beta_hat(tau,X) = beta_hat + q_hat*gamma_hat
That made me wonder, if X!=Z, then what? Suppose Z=[X,W], where W is some additional variable. Then is it true that
beta_hat(tau,W) = q_hat*gamma_hat_W?
This is obviously not the "regression quantile coefficient", rather it allows W to only affect scale and not location. Am I thinking about this correctly? In fact, I'm not even sure how to interpret beta_hat(tau,X), when X!=Z. The X's are still affecting location and scale, but they are conditional on W affecting only scale.
The below code reproduces mmqreg when X=Z (by hand, but no s.e.). The second chunk adds a variable to Z, in this case age.
FernandoRios
Joao Santos Silva
Code:
use http://fmwww.bc.edu/RePEc/bocode/o/oaxaca.dta, clear * standard qreg qreg lnwage female educ exper tenure i.isco, q(25) * mmqreg no cluster mmqreg lnwage female educ exper tenure i.isco, q(25) * mmqreg cluster mmqreg lnwage female educ exper tenure , q(25) abs(isco) cluster(isco) * adjusts for clusters automatically, but differs from mmqreg xtqreg lnwage female educ exper tenure , q(.25) i(isco) ls *1. Location: get beta xtreg lnwage female educ exper tenure, fe i(isco) mat beta=e(b)' *2. predict alpha and R predict double alpha, u predict double R, e *3. Scale: reg abs(R) on Z to get gamma gen double absR=abs(R) xtreg absR female educ exper tenure, fe i(isco) mat gamma=e(b)' *4. predict delta and Z'gamma predict double delta, u predict double zgam, xb predict double delta_zgam, xbu *5. Quantile regression, using standardized residuals gen double U = R/delta_zgam qreg U, q(25) sca q=_b[_cons] *6. Eq (4) (mentioned on page 150) beta for quantile: b_l + q*gamma mat b_q=beta+q*gamma mat list beta mat list gamma mat list b_q ******************************************** * Now try with an additional variable in Z: age ******************************************** *Steps 1 & 2 are same as above (omit) *3. Scale: reg abs(R) on Z to get gamma xtreg absR female educ exper tenure age, fe i(isco) mat gamma2=e(b)' *4. predict delta and Z'gamma predict double delta2, u predict double zgam2, xb predict double delta_zgam2, xbu *5. Quantile regression, using standardized residuals gen double U2 = R/delta_zgam2 qreg U2, q(25) sca q2=_b[_cons] *6. Eq (4) (mentioned on page 150) beta for quantile: b_l + q*gamma mat b_q_x=beta+q2*(gamma2[1..4,1]\gamma2[6,1]) mat b_q_z=q2*gamma2[5,1] mat list beta mat list gamma2 mat list b_q_x mat list b_q_z
Ref: Machado, J.A.F. and Santos Silva, J.M.C. (2019), Quantiles via Moments, Journal of Econometrics, 213(1), pp. 145-173.
Comment