Hi Stata users,
I would like to test for equality of coefficients from two different quantile regression models. The variables in both models are the same, but the models are applied to two different groups of observations. Stata provides the useful suest command for these kinds of tests but it does not work with quantile regression because of the non-standard computation of the variance-covariance matrix using the bootstrap. It's possible to run a simple linear Wald test by hand of course. I am not sure however if and how to adjust standard errors in that case (what suest would otherwise do for me). Running the two models separately yields different standard errors than pooling the models and adding an interaction of the group variable with all independent variables.
Please find below a working example of the model Q0.5(y|x) = b1*x1 + b2*x2 + b3*x3 + e.
As can be seen the coefficients in the two models (A) are the same as in the pooled model (B), but the standard errors vary.
If someone has any idea of which standard errors are more appropriate for the Wald test (if any) I am grateful for suggestions!
Thank you very much!
Jann
Commands:
Output (shortened):
I would like to test for equality of coefficients from two different quantile regression models. The variables in both models are the same, but the models are applied to two different groups of observations. Stata provides the useful suest command for these kinds of tests but it does not work with quantile regression because of the non-standard computation of the variance-covariance matrix using the bootstrap. It's possible to run a simple linear Wald test by hand of course. I am not sure however if and how to adjust standard errors in that case (what suest would otherwise do for me). Running the two models separately yields different standard errors than pooling the models and adding an interaction of the group variable with all independent variables.
Please find below a working example of the model Q0.5(y|x) = b1*x1 + b2*x2 + b3*x3 + e.
As can be seen the coefficients in the two models (A) are the same as in the pooled model (B), but the standard errors vary.
If someone has any idea of which standard errors are more appropriate for the Wald test (if any) I am grateful for suggestions!
Thank you very much!
Jann
Commands:
Code:
*A. both models separately sqreg y x1 x2 x3 if R1 sqreg y x1 x2 x3 if R2 *B. Pooled regression with interaction terms sqreg y (c.R2 c.R1)#(c.x1 c.x2 c.x3 cons)
Code:
. *A. both models separately . sqreg y x1 x2 x3 if R1 (fitting base model) Bootstrap replications (20) ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 .................... Simultaneous quantile regression Number of obs = 302 bootstrap(20) SEs .50 Pseudo R2 = 0.4117 ------------------------------------------------------------------------------ | Bootstrap y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- q50 | x1 | .1463415 .0576159 2.54 0.012 .0329559 .259727 x2 | .6239837 .0435789 14.32 0.000 .5382223 .7097451 x3 | .0609756 .0465972 1.31 0.192 -.0307257 .152677 _cons | -1.050813 .9817498 -1.07 0.285 -2.982854 .8812274 ------------------------------------------------------------------------------ . sqreg y x1 x2 x3 if R2 (fitting base model) Bootstrap replications (20) ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 .................... Simultaneous quantile regression Number of obs = 163 bootstrap(20) SEs .50 Pseudo R2 = 0.4651 ------------------------------------------------------------------------------ | Bootstrap y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- q50 | x1 | .147429 .0571097 2.58 0.011 .0346376 .2602204 x2 | .676735 .0513315 13.18 0.000 .5753554 .7781146 x3 | .0871988 .0611658 1.43 0.156 -.0336033 .208001 _cons | -1.944444 1.435971 -1.35 0.178 -4.780482 .8915926 ------------------------------------------------------------------------------ . . *B. Pooled regression with interaction terms . sqreg y (c.R2 c.R1)#(c.x1 c.x2 c.x3 cons) note: 1.cons#c.R1 omitted because of collinearity (fitting base model) Bootstrap replications (20) ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 .................... Simultaneous quantile regression Number of obs = 465 bootstrap(20) SEs .50 Pseudo R2 = 0.4363 ------------------------------------------------------------------------------ | Bootstrap y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- q50 | c.R2#c.x1 | .147429 .063335 2.33 0.020 .022965 .271893 | c.R2#c.x2 | .676735 .0413437 16.37 0.000 .5954876 .7579824 | c.R2#c.x3 | .0871988 .0438862 1.99 0.048 .0009551 .1734426 | cons#c.R2 | 1 | -.893631 1.463595 -0.61 0.542 -3.769843 1.982581 | c.R1#c.x1 | .1463415 .0547102 2.67 0.008 .0388266 .2538563 | c.R1#c.x2 | .6239837 .0509805 12.24 0.000 .5237985 .724169 | c.R1#c.x3 | .0609756 .051976 1.17 0.241 -.0411659 .1631171 | cons#c.R1 | 1 | 0 (omitted) | _cons | -1.050813 1.100029 -0.96 0.340 -3.212556 1.110929 ------------------------------------------------------------------------------
Code:
Comment