Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: Problems estimating margins with factor variables in cmp


From   "David Roodman (droodman@cgdev.org)" <DRoodman@cgdev.org>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Problems estimating margins with factor variables in cmp
Date   Sat, 10 Nov 2012 14:32:30 +0000

It's working for me (see below). Make sure you have the latest version from SSC rather than SJ ("ssc install cmp, replace"). If it still doesn't work, send me the precise data and code.
--David

. webuse womenwk, clear

. gen selectvar = wage<.

. gen wage3 = (wage > 10)+(wage > 30) if wage < .
(657 missing values generated)

. cmp (wage3 = education age) (selectvar = married children education age), ind(selectvar*$cmp_oprobit $cmp_probit) qui nolr

Fitting individual models as starting point for full model fit.

Fitting full model.

Mixed-process  regression                         Number of obs   =       2000
                                                  Wald chi2(2)    =     205.34
Log likelihood =  -1570.966                       Prob > chi2     =     0.0000

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
wage3        |
   education |   .1599579   .0138796    11.52   0.000     .1327543    .1871615
         age |   .0416353   .0051917     8.02   0.000     .0314597    .0518108
-------------+----------------------------------------------------------------
selectvar    |
     married |   .4270637   .0723395     5.90   0.000      .285281    .5688465
    children |   .4463219   .0285305    15.64   0.000     .3904031    .5022407
   education |   .0582844   .0109205     5.34   0.000     .0368806    .0796882
         age |   .0353776   .0042153     8.39   0.000     .0271158    .0436394
       _cons |   -2.48584   .1920874   -12.94   0.000    -2.862325   -2.109356
-------------+----------------------------------------------------------------
    /cut_1_1 |   1.659946   .2982901     5.56   0.000     1.075308    2.244584
    /cut_1_2 |   5.113563   .2872572    17.80   0.000     4.550549    5.676577
/atanhrho_12 |   .8156348   .2153927     3.79   0.000     .3934729    1.237797
-------------+----------------------------------------------------------------
      rho_12 |    .672687   .1179258                      .3743504     .844826
------------------------------------------------------------------------------

.  margins, eydx(*) predict(eq(#1) pr outcome(#2))

Average marginal effects                          Number of obs   =       2000
Model VCE    : OIM

Expression   : Pr(wage3=1), predict(outcome(#2))
ey/dx w.r.t. : education age married children

------------------------------------------------------------------------------
             |            Delta-method
             |      ey/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   education |  -.0141501   .0060007    -2.36   0.018    -.0259113   -.0023889
         age |  -.0036831    .001508    -2.44   0.015    -.0066388   -.0007274
     married |          0  (omitted)
    children |          0  (omitted)
------------------------------------------------------------------------------

. margins, eydx(*)

Average marginal effects                          Number of obs   =       2000
Model VCE    : OIM

Expression   : Linear prediction, predict()
ey/dx w.r.t. : education age married children

------------------------------------------------------------------------------
             |            Delta-method
             |      ey/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   education |   .0459673   .0029923    15.36   0.000     .0401025    .0518321
         age |   .0119648   .0010746    11.13   0.000     .0098587    .0140709
     married |          0  (omitted)
    children |          0  (omitted)
------------------------------------------------------------------------------

.

-----Original Message-----
Date: Wed, 7 Nov 2012 10:05:36 -0300
From: Tomas Larroucau <tlarroucau@gmail.com>
Subject: st: Problems estimating margins with factor variables in cmp

Dear Stata users,

I am estimating an Ordered Probit with Heckman Selection using cmp.
I want to get the marginal effects eydx() in some factor variables, but
even when
I have updated cmp, the results of the marginal effects are like missing
values.

Do cmp allow to estimate the marginal effects in factor variables?

Thank you all


Tomas Larroucau

University of Chile
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index