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

st: mlbeta, nocons, and mutually-exclusive dummy variables


From   [email protected]
To   [email protected]
Subject   st: mlbeta, nocons, and mutually-exclusive dummy variables
Date   Wed, 25 May 2005 09:33:13 -0500

Clive, 

This is kind of late in the game, but was it necessary to alter -
mlbeta- to 
obtain estimated coefficients for a set of mutually exclusive dummy 
variables?
Could you not use the -lincom- with the constant and dummy variables 
(with the
omitted dummy) to obtain the full set of coefficients?

For example:

. sysuse auto,clear
(1978 Automobile Data)

. qui sum mpg

. gen m2 = mpg/(r(max)+1)

. qui tab rep, gen(D)

. mlbeta m2 trunk D*, nocons

-----------------------------------------------------------------------
-------
          m2 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. 
Interval]
-------------+---------------------------------------------------------
-------
eq1          |
       trunk |  -.0593707   .0143788    -4.13   0.000    -.0875525   -
.0311888
          D1 |   .5046506   .3548657     1.42   0.155    -.1908734    
1.200175
          D2 |    .694107   .2678713     2.59   0.010     .1690888    
1.219125
          D3 |   .7618373   .2348673     3.24   0.001      .301506    
1.222169
          D4 |   .8648664   .2248695     3.85   0.000     .4241302    
1.305603
          D5 |   1.480025   .2255771     6.56   0.000     1.037902    
1.922148
-------------+---------------------------------------------------------
-------
eq2          |
       _cons |   2.851085   .1657322    17.20   0.000     2.526256    
3.175914
-----------------------------------------------------------------------
-------


. mlbeta m2 trunk D*
note: D1 dropped due to collinearity

-----------------------------------------------------------------------
-------
          m2 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. 
Interval]
-------------+---------------------------------------------------------
-------
eq1          |
       trunk |  -.0593707   .0143788    -4.13   0.000    -.0875525   -
.0311888
          D2 |   .1894564   .3828169     0.49   0.621    -
.5608509    .9397637
          D3 |   .2571867   .3572618     0.72   0.472    -
.4430335     .957407
          D4 |   .3602158   .3588014     1.00   0.315    -.3430221    
1.063454
          D5 |   .9753741    .368718     2.65   0.008     .2527001    
1.698048
       _cons |   .5046506   .3548657     1.42   0.155    -.1908734    
1.200175
-------------+---------------------------------------------------------
-------
eq2          |
       _cons |   2.851085   .1657322    17.20   0.000     2.526256    
3.175914
-----------------------------------------------------------------------
-------

. lincom D2 + _cons

 ( 1)  [eq1]D2 + [eq1]_cons = 0

-----------------------------------------------------------------------
-------
          m2 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. 
Interval]
-------------+---------------------------------------------------------
-------
         (1) |    .694107   .2678714     2.59   0.010     .1690888    
1.219125
-----------------------------------------------------------------------
-------

. lincom D3 + _cons

 ( 1)  [eq1]D3 + [eq1]_cons = 0

-----------------------------------------------------------------------
-------
          m2 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. 
Interval]
-------------+---------------------------------------------------------
-------
         (1) |   .7618373   .2348673     3.24   0.001      .301506    
1.222169
-----------------------------------------------------------------------
-------

. 
. lincom D4 + _cons

 ( 1)  [eq1]D4 + [eq1]_cons = 0

-----------------------------------------------------------------------
-------
          m2 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. 
Interval]
-------------+---------------------------------------------------------
-------
         (1) |   .8648664   .2248695     3.85   0.000     .4241302    
1.305603
-----------------------------------------------------------------------
-------

. 
. lincom D5 + _cons

 ( 1)  [eq1]D5 + [eq1]_cons = 0

-----------------------------------------------------------------------
-------
          m2 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. 
Interval]
-------------+---------------------------------------------------------
-------
         (1) |   1.480025   .2255771     6.56   0.000     1.037902    
1.922148
-----------------------------------------------------------------------
-------

Scott

*
*   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