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]

st: RE: RE: problem running mfx after glm


From   Marlis Gonzalez Fernandez <mgonzal5@jhmi.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
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: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Sarah Edgington
Sent: Monday, August 15, 2011 6:39 PM
To: statalist@hsphsun2.harvard.edu
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: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Marlis Gonzalez
Fernandez
Sent: Monday, August 15, 2011 3:27 PM
To: 'statalist@hsphsun2.harvard.edu'
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index