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]

From |
Richard Williams <richardwilliams.ndu@gmail.com> |

To |
statalist@hsphsun2.harvard.edu, statalist@hsphsun2.harvard.edu |

Subject |
re:Re: st: problem with marginal effect after running a logit regression |

Date |
Mon, 30 Jul 2012 12:10:12 -0500 |

http://www.stata-journal.com/article.html?article=st0260 For a summary of the highlights see http://www.nd.edu/~rwilliam/stats/Margins01.pdf At 03:22 AM 7/30/2012, Jeremy Franklin wrote:

Hi Rieza,First of all thank you for considering my problem and for your biganswer that shed light on the issue i was facing.My advisor told me to use mfx function at median values for all thecharacteristics in my model.As you pointed, using the "old" mfx function was not the rightchoice as far as "mfx continues to work but does not support factorvariables" cf Stata HelpNevertheless, I finally found (with he precious help of somestatalisters) the formula to compute the marginal effects for mylogit model, namely:margins, dydx(mstudymid mstudyhigh mhomme mchiefwageearner mage28_37 mage38_47 mage48_57 mage58 mintpollow mintpolmid mintpolhigher mpolleft mpolright mincomemid mincomehigh) atmeansI also computed the marginal effects for 5 more models with andwithout some control variables in order to determine when the effectis the highest.Regarding S002 and S003, these are also control variables. Beingrespectively the country of respondents and the number of the wavewhen the respondents where interviewed, it allows me to make mymodel with country fixed, wave fixed and country-wave fixed effects.I did not need to know the specific marginal effects of thesevariables and it appears that with the previous formula, these werenot computed.Further comments on this method are more than welcome. Thank you again for your help Rieza; Jeremy >Hi Jeremy, >Your advisor is correct that the coefficients of a logistic regression >cannot be interpreted in the same way as OLS. Using the margins >command allows for an estimation of the marginal effect (e.g. the >increase in probability of your outcome = 1, here I assumed outcome is >binary). One question for you: when your advisor meant by "at median," >did he mean at median values for all the characteristics in your >model, or just the median level of education? > >If the specific effect of interest is going from mstudymid to >mstudyhigh, I would suggest making mstudymid the reference category in >your set of dummy variables for education. Here I assume you have >mstudylow as the reference (excluded) category. If you make mstudymid >your reference, then the marginal effect of mstudyhigh would be the >marginal effect of going from mstudymid to mstudyhigh. Similarly, the >marginal effect of mstudylow would be the marginal effect of going >from mstudylow to mstudymid. > >Typically, if your predictors are continuous, it makes sense to have >Stata calculate marginal effects at the means of each value of your >predictors. This can be achieved by executing the following command >after running your regression: > >margins, atmeans > >However, because your predictors are categorical (or if you are using >a version of Stata before Stata 12), you may be able to get away with >specifying criteria for the "typical" individual in your dataset for >which you are calculating the marginal effect. Then justify the >choices you made in describing the "typical" individual. > >For example, in your dataset, the "typical" individual may be a 35 >year old, male, who is a chief wage earner, with high education, >mintpol = "mid", mpol = "right", and mincome = "high," then the >command you would run would be something like: > >mfx, at (mstudymid=0 mstudyhigh=1 mhomme=1 mchiefwageearner=1 mage28_37=1 >mage38_47=0 mage48_57=0 .............. mincomehigh=1) > >*Note the ........... means you should assign a 0 or 1 value for your >categorical predictors as appropriate to describe your person. > >I see there are several variables in your dataset that could benefit >from being continuous, though. If age were continuous, you can simply >plug in the average age (from any of the univariate commands you can >use to describe the mean of a vbl). Same thing with income. I think >it would make your regression more robust to use the continuous. > >Of course using this method (with -mfx-) is complicated by the >clustering in your data and the interactions between the cluster >variables S003 and S002 (it appears to me these are polychotomous >categorical variables, as you have used the i. in adding them to your >regression). Because I don't know what they represent and how many >levels of each they are, I am not sure how they would be specified in >the -mfx- command. Do you absolutely need to know the marginal effect >of each of those clusters, or were they included just so you can >control for them? If you included them just to control for them, >consider using -xtmelogit- (mixed effects logit) instead, and specify >S003 and S002 for random intercept calculation. > >HTH, >Rieza > >*I invite other statalisters to correct me if I have said something in error >above. > >On Thu, Jul 26, 2012 at 2:17 PM, Jeremy Franklin <jfrankli@ulb.ac.be> wrote: >> Dear all, >> >> Here is my little trouble: >>>> For my master degree thesis I decided to test for the role ofeducation level in assession the importance of fighting inflation.>> >> Here is my final regression formula: >>>> xi: logit mfirstchoice mstudymid mstudyhigh mhommemchiefwageearner mage28_37 mage38_47 mage48_57 mage58 mintpollowmintpolmid mintpolhigher mpolleft mpolright mincomemid mincomehighi.s003 i.s002 i.s003*i.s002, vce(cluster s003)>>>> I hate the results but my thesis coordinator told me that theresults of logit regression cannot be interpreted like coefficientsof a linear regression. Therefore, he suggested me to check for themarginal effects at the median in order to see the marginal effectsof one individual coming from mstudymid to mstudyhigh>>>> I googled everything, i tried hundreds of formulas, both withmfx and margins but i still cannot find the correct one in order tointerpret my results.>> >> Can ANYONE help me please. >>>> ps: a robustness test included in my thesis include thefollowing formula (this time with ologit)->>>> xi: ologit minflation mstudymid mstudyhigh mhommemchiefwageearner mage28_37 mage38_47 mage48_57 mage58 mintpollowmintpolmid mintpolhigher mpolleft mpolright x047 i.s003 i.s002i.s003*i.s002, vce(cluster s003)>> >> * >> * 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/

------------------------------------------- Richard Williams, Notre Dame Dept of Sociology OFFICE: (574)631-6668, (574)631-6463 HOME: (574)289-5227 EMAIL: Richard.A.Williams.5@ND.Edu WWW: http://www.nd.edu/~rwilliam * * 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/

- Prev by Date:
**Re: st: repeating timeseries unitroot test for set of 189 countires within panel data structure** - Next by Date:
**st: Odd behaviour of wordcount function** - Previous by thread:
**st: displaying input lines while executing loops** - Next by thread:
**st: Odd behaviour of wordcount function** - Index(es):