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: Re: st: problem with marginal effect after running a logit regression |

Date |
Mon, 30 Jul 2012 15:08:38 -0400 |

The current issue of Stata Journal has a discussion of the margins command: 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 02:51 PM 7/30/2012, Rieza Soelaeman wrote:

Hi Jeremy, Either way you will run into the same interpretation issues. If the variable is binary, then at median of what (they either have that condition, or they don't)? I have not used at median with binary, so I cannot tell you off the top of my head what it will look like. In this case, I think you will need to work with your advisor in developing the interpretation of what the marginal effects tables are telling you. Rieza On Mon, Jul 30, 2012 at 1:15 PM, Jeremy Franklin <jfrankli@ulb.ac.be> wrote: > Dear Rieza >> I understand what you are saying, regarding the reference I amnow running a new model with mstudymid as reference so that I canhave a better interpretation of the impact of studies with themarginal effects (marginal effect of going from mstudymid tomstudylow and marginal effect of going from mstudymid to mstudyhigh).>> Regarding the atmeans, shall I therefore use another formula ?atmedian or something like that ?> > Thank you again, > > Jeremy > >>Also, if you use the atmeans, the estimation sets the other variables >>at the ***mean value*** for that variable. If your variables range >>from 0 to 1, the mean value is the proportion of people in your >>dataset having that characteristic. >> >>Supposing in your dataset tabbing educational categories as: >> >>Educ n pct >>Low 100 .25 >>Medium 200 .50 >>High 100 .25 >> >>For the estimation, Stata will use 0.50 for mstudymid and 0.25 for >>mstudyhigh. How do we interpret what that average characteristic >>"means" (no pun intended)? >> >>RHS >>>>On Mon, Jul 30, 2012 at 12:30 PM, Rieza Soelaeman<rsoelaeman@gmail.com> wrote:>>> Hi Jeremy, >>> My only other advice is to be careful and understand what you are >>> asking of Stata when you run these options for the margins command. >>> When you ask for dydx(varlist) atmeans, Stata calculates the marginal >>> effect of **going from 0 to 1 for those variables** (read the table >>> footnotes Stata generates). As written below, your model still does >>> not allow you to estimate the marginal effect of going from medium to >>> high education, but compares medium with reference and high with >>> reference.. >>> >>> I urge you also to discuss the output with your advisor to make sure >>> it makes sense (and that you did what he asked you to do)--that's what >>> advisors are for, after all! >>> >>> Rieza >>>>>> On Mon, Jul 30, 2012 at 3:22 AM, Jeremy Franklin<jfrankli@ulb.ac.be> wrote:>>>> Hi Rieza, >>>>>>>> First of all thank you for considering my problem and for yourbig answer that shed light on the issue i was facing.>>>>>>>> My advisor told me to use mfx function at median values forall the characteristics 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 Help>>>>>>>> Nevertheless, 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) atmeans >>>>>>>> I also computed the marginal effects for 5 more models withand without some control variables in order to determine when theeffect is the highest.>>>>>>>> Regarding S002 and S003, these are also control variables.Being respectively the country of respondents and the number of thewave when the respondents where interviewed, it allows me to makemy model with country fixed, wave fixed and country-wave fixedeffects. I did not need to know the specific marginal effects ofthese variables and it appears that with the previous formula,these were not 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=1mage28_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 saidsomething 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 roleof education 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 thatthe results of logit regression cannot be interpreted likecoefficients of a linear regression. Therefore, he suggested me tocheck for the marginal effects at the median in order to see themarginal effects of one individual coming from mstudymid to mstudyhigh>>>>>>>>>>>> I googled everything, i tried hundreds of formulas, bothwith mfx and margins but i still cannot find the correct one inorder to interpret 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/ >> >>* >>* 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/

**References**:**re:Re: Re: st: problem with marginal effect after running a logit regression***From:*Jeremy Franklin <jfrankli@ulb.ac.be>

**Re: Re: Re: st: problem with marginal effect after running a logit regression***From:*Rieza Soelaeman <rsoelaeman@gmail.com>

- Prev by Date:
**Re: Re: Re: st: problem with marginal effect after running a logit regression** - Next by Date:
**RE: st: Pulling in files and data stored in a folder tree** - Previous by thread:
**Re: Re: Re: st: problem with marginal effect after running a logit regression** - Next by thread:
**st: drop variables with missing values** - Index(es):