Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: RE: RE: problem running mfx after glm


From   Marlis Gonzalez Fernandez <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: RE: problem running mfx after glm
Date   Mon, 15 Aug 2011 23:04:51 +0000

I realized that I was not providing enough info right after I hit send.  I have not changed the version of stata but probably updated it as updates became available.  

The following is from my log last fall:  

glm     ReadingCompCombdiv100 Education Age Gender0Male1Female DWIVolume, family(binomial) link(logit) robust
note: ReadingCompCombdiv100 has noninteger values

Iteration 0:   log pseudolikelihood = -82.024027  
Iteration 1:   log pseudolikelihood = -81.577867  
Iteration 2:   log pseudolikelihood = -81.577704  
Iteration 3:   log pseudolikelihood = -81.577704  

Generalized linear models                          No. of obs      =       205
Optimization     : ML                              Residual df     =       200
                                                   Scale parameter =         1
Deviance         =  88.00033576                    (1/df) Deviance =  .4400017
Pearson          =  84.32357798                    (1/df) Pearson  =  .4216179

Variance function: V(u) = u*(1-u/1)                [Binomial]
Link function    : g(u) = ln(u/(1-u))              [Logit]

                                                   AIC             =  .8446605
Log pseudolikelihood = -81.57770417                BIC             = -976.6017

------------------------------------------------------------------------------
             |               Robust
ReadingC~100 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   Education |   -.086737   .0407047    -2.13   0.033    -.1665167   -.0069573
         Age |   .0250684   .0085852     2.92   0.004     .0082418    .0418951
Gender0Mal~e |  -.1477313   .2340908    -0.63   0.528    -.6065409    .3110783
   DWIVolume |   .0000215   7.40e-06     2.91   0.004     7.03e-06     .000036
       _cons |  -2.020025   .7707924    -2.62   0.009     -3.53075   -.5092994
------------------------------------------------------------------------------

. mfx, at(mean)

Marginal effects after glm
      y  = Predicted mean ReadingCompCombdiv100 (predict)
         =  .20234067
------------------------------------------------------------------------------
variable |      dy/dx    Std. Err.     z    P>|z|  [    95% C.I.   ]      X
---------+--------------------------------------------------------------------
Educat~n |  -.0139993      .00647   -2.16   0.030   -.02668 -.001318   12.5317
     Age |    .004046       .0014    2.89   0.004     .0013  .006792   60.8976
Gender~e*|   -.023829      .03777   -0.63   0.528  -.097849  .050191   .492683
DWIVol~e |   3.48e-06      .00000    2.74   0.006   9.9e-07  6.0e-06   13071.5
------------------------------------------------------------------------------
(*) dy/dx is for discrete change of dummy variable from 0 to 1

I am trying to analyze a new variable (categorical 5 levels) still accounting for marginal effects since audcompCombdiv100 is a proportion so I wrote:

glm  audcompCombdiv100 Age Gender0Male1Female DWIVolume i.Discharge_Location, family(binomial) link(logit) robust

mfx, at(mean)

-default predict() is unsuitable for marginal-effect calculation
-r(119);

Is the problem the use of -i.var-? 

Thanks.

M

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Sarah Edgington
Sent: Monday, August 15, 2011 6:39 PM
To: [email protected]
Subject: st: RE: problem running mfx after glm

You haven't given the list enough information to really help you.
What do you mean when you say it's giving you a problem?  What error message
are you actually getting?  Have you gotten a new version of Stata since you
last run the analysis?  If so, have you tried running the dofile using the
-version- command?
Others may be able to help you with translating to -margins- but you should
be able to run your original analysis without rewriting it.

-Sarah

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Marlis Gonzalez
Fernandez
Sent: Monday, August 15, 2011 3:27 PM
To: '[email protected]'
Subject: st: problem running mfx after glm

Hello-

Did the following analysis last fall:

glm  ReadingCompCombdiv100 education, family(binomial) link(logit) robust

followed by:

mfx, at(mean)

This provided me with the marginal effects after glm (variable of interest
is a proportion).

Any idea why this is giving me a problem.having trouble figuring out how to
do this using margins instead of mfx.

Thanks,

M González
JHU


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/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/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/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index