Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Is there a fixed effect quantile regression in STATA?


From   "mehryar_karim" <[email protected]>
To   [email protected]
Subject   Re: st: Is there a fixed effect quantile regression in STATA?
Date   Fri, 30 Jul 2004 14:38:32 -0000

I apologize for not making my statement clear about non-
reproducibility of the standard errors using sqreg. Please see the 
example below: 

My dependent variable is diff, and my independent variables are 
diff3, trend and lmis_. I have 129 subjects identified by the 
variable id. So I run two identical models with different sequencing 
of the independent variables using the latest updated Stata 8, and 
find that although the coefficients are consistent, the standard 
errors are different (see below). I would be eager to send you my 
dataset if you would like to have a closer look into the matter. 
Thanks.


. quietly tab id,gen(dummy)

. drop dummy1

. set seed 1234567

. xi:sqreg diff dummy* diff3 i.trend lmis_  
i.trend           _Itrend_0-5         (naturally coded; _Itrend_0 
omitted)
(fitting base model)
(bootstrapping ....................)

Simultaneous quantile regression                     Number of obs 
=       207
  bootstrap(20) SEs                                  .50 Pseudo R2 
=    0.6683

----------------------------------------------------------------------
--------
             |              Bootstrap
        diff |      Coef.   Std. Err.      t    P>|t|     [95% Conf. 
Interval]
-------------+--------------------------------------------------------
--------
q50          |
      dummy2 |  -33.11931   20.62797    -1.61   0.113    -
74.22142     7.98281
      dummy3 |   -29.4156   18.75973    -1.57   0.121    -66.79518    
7.963973
.
.
.
    dummy128 |  -40.79279   23.68435    -1.72   0.089    -87.98489    
6.399318
    dummy129 |  -16.64872   14.72689    -1.13   0.262    -45.99268    
12.69524
       diff3 |   14.18931   12.47035     1.14   0.259    -10.65841    
39.03704
   _Itrend_4 |  -9.091088   11.34316    -0.80   0.425    -31.69284    
13.51066
   _Itrend_5 |  -.6516196   13.12833    -0.05   0.961    -26.81038    
25.50714
       lmis_ |   -1.73158   1.449246    -1.19   0.236    -4.619266    
1.156106
       _cons |   57.45794   21.34711     2.69   0.009      14.9229    
99.99298
----------------------------------------------------------------------
--------

. set seed 1234567

. xi:sqreg diff diff3 i.trend lmis_  dummy*
i.trend           _Itrend_0-5         (naturally coded; _Itrend_0 
omitted)
(fitting base model)
(bootstrapping ....................)

Simultaneous quantile regression                     Number of obs 
=       207
  bootstrap(20) SEs                                  .50 Pseudo R2 
=    0.6683

----------------------------------------------------------------------
--------
             |              Bootstrap
        diff |      Coef.   Std. Err.      t    P>|t|     [95% Conf. 
Interval]
-------------+--------------------------------------------------------
--------
q50          |
       diff3 |   14.18931   8.877925     1.60   0.114    -3.500338    
31.87897
   _Itrend_4 |  -9.091087   8.446916    -1.08   0.285    -
25.92194     7.73976
   _Itrend_5 |  -.6516195   9.521289    -0.07   0.946     -19.6232    
18.31996
       lmis_ |   -1.73158   1.102537    -1.57   0.121    -
3.928434    .4652733
      dummy2 |  -33.11931   22.73976    -1.46   0.149    -78.42926    
12.19065
      dummy3 |   -29.4156   18.20915    -1.62   0.110    -65.69812    
6.866916
.
.
.
    dummy128 |  -40.79279   20.23759    -2.02   0.047    -
81.11707    -.468505
    dummy129 |  -16.64872   20.00269    -0.83   0.408    -56.50496    
23.20751
       _cons |   57.45794   24.24653     2.37   0.020     9.145678    
105.7702
----------------------------------------------------------------------
--------


--- In [email protected], smerryman@k... wrote:
> 
> ----- Original Message -----
> From: mehryar_karim <akarim@t...>
> Date: Thursday, July 29, 2004 11:49 am
> Subject: Re: st: Is there a fixed effect quantile regression in 
STATA?
> 
> > I achieved the fixed effect results using dummy variables for
> > subjects in the sqreg model. My major issue was the 
reproducibility
> > of the standard errors even after using the set seed command 
before
> > implementing `sqreg'. I think there is a bug in the `sqreg' 
command.
> > I'm not sure if my response was helpful.
> 
> Could you please expand on the issue of the non-reproducibility of 
the standard errors?  It seems to work for me (results below)
> 
> As to Bo's (bo@m...) original question on fixed effects quantile 
regression -- you would have to generate dummy variables and include 
them in the regression.  I believe this would be interpreted as a 
pure-location shift.  This seems to how it is done in the applied 
literature (see, for example, "A Quantile Regression Analysis of the 
Cross Section of Stock Market Returns" by Michelle L. Barnesa1 and 
Anthony W. Hughesb 
(http://www.bos.frb.org/economic/wp/wp2002/wp022.pdf) who use time 
dummies to control time specific effects).
> 
> You might also find useful Roger Koenker's paper "Quantile 
Regression for Longitudinal Data" ( 
http://www.econ.uiuc.edu/~roger/research/panel/long.pdf )
> 
> In it he writes (page 3):
> "What role should the a_i's play? Generally, the a_i's would be 
intended to
> capture some individual specific source of variability, 
or 'unobserved heterogeneity,'
> that was not adequately controlled for by other covariates in the 
model. For example,
> in a study of the effect of a dietary intervention on blood 
pressure, it would be
> desirable to estimate departures from individuals' idiosyncratic 
levels. If the number
> of observations m_i were large for each individual then we might 
even hope to estimate
> a distributional shift a_i(t) for each individual. This would 
certainly be useful for
> groups of individuals: a distributional shift for men versus women, 
or for blacks
> versus whites. However, in most applications the m_i, the number of 
observations on
> each individual, would be relatively modest and then it is quite 
unrealistic to attempt
> to estimate a t-dependent, distributional, individual effect. At 
best we may be able to
> estimate an individual specific location-shift effect, and even 
this may strain credulity."
> 
> Hope this helps,
> Scott
> 
> --------------------------------------------------------------------
------------------
> 
> 
> . set seed 123
> 
> . sqreg price mpg fore, q(.1 .9)
> (fitting base model)
> (bootstrapping ....................)
> 
> Simultaneous quantile regression                     Number of obs 
=        74
>   bootstrap(20) SEs                                  .10 Pseudo R2 
=    0.0878
>                                                      .90 Pseudo R2 
=    0.2546
> 
> --------------------------------------------------------------------
----------
>              |              Bootstrap
>        price |      Coef.   Std. Err.      t    P>|t|     [95% 
Conf. Interval]
> -------------+------------------------------------------------------
----------
> q10          |
>          mpg |  -71.42857   46.74642    -1.53   0.131    -
164.6383    21.78114
>      foreign |   591.8571   508.9618     1.16   0.249    -
422.9839    1606.698
>        _cons |   5370.429    979.445     5.48   0.000     
3417.471    7323.386
> -------------+------------------------------------------------------
----------
> q90          |
>          mpg |       -348   82.17086    -4.24   0.000     -
511.844    -184.156
>      foreign |       1654   961.6789     1.72   0.090    -
263.5332    3571.533
>        _cons |      16257    1973.42     8.24   0.000     
12322.11    20191.89
> --------------------------------------------------------------------
----------
> 
> . set seed 123
> 
> . sqreg price mpg fore, q(.1 .9)
> (fitting base model)
> (bootstrapping ....................)
> 
> Simultaneous quantile regression                     Number of obs 
=        74
>   bootstrap(20) SEs                                  .10 Pseudo R2 
=    0.0878
>                                                      .90 Pseudo R2 
=    0.2546
> 
> --------------------------------------------------------------------
----------
>              |              Bootstrap
>        price |      Coef.   Std. Err.      t    P>|t|     [95% 
Conf. Interval]
> -------------+------------------------------------------------------
----------
> q10          |
>          mpg |  -71.42857   46.74642    -1.53   0.131    -
164.6383    21.78114
>      foreign |   591.8571   508.9618     1.16   0.249    -
422.9839    1606.698
>        _cons |   5370.429    979.445     5.48   0.000     
3417.471    7323.386
> -------------+------------------------------------------------------
----------
> q90          |
>          mpg |       -348   82.17086    -4.24   0.000     -
511.844    -184.156
>      foreign |       1654   961.6789     1.72   0.090    -
263.5332    3571.533
>        _cons |      16257    1973.42     8.24   0.000     
12322.11    20191.89
> --------------------------------------------------------------------
----------
> 
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index