1. Calculating discrete changes

Hi all,

I have a quick stata question about computing the discrete changes of a dummy variable. I am using a logistic regression so I need to look at discrete changes because the coefficients aren't easy to interpret.

I have three education dummies in my regression. They are "incomplete undergraduate," "complete undergraduate" and "postgraduate." I want to calculate the effect of a discrete change in education from "non-educated" to one of those categories. To do so, I basically need to force the other dummy variables I am not interested in to equal zero.

Does anybody know how I can do that? Please let me know if that needs clearing up.

Thanks!

2. Re: Calculating discrete changes

Usually -margins- is the best way of doing this. You don't need to force the other dummies to be zero, although you can if that's desirable.

Here is a simple example based on the first example from -help logit-:
Code:
``````* example dataset - low birth weight
webuse lbw

* logistic regression of low birth weight; predictors are age (continuous), race (categorical)
* and smoking during pregnancy (binary)
logistic low age i.race smoke

* what is the predicted probability of low birth weight (adjusted for age and smoking)
* in each racial group?
margins race

* what is the average marginal effect of races 2 and 3 vs 1?
margins, dydx(race)

* what about in smokers vs non-smokers?
margins race, at(smoke=(0 1))

* example of a more complicated model with an interaction between age and race
logistic low c.age##i.race smoke

* to understand the interaction it's usually easiest to graph it
levelsof age, local(ages)
margins race, at(age=(`ages'))
marginsplot, noci``````

3. The Following User Says Thank You to bukharin For This Useful Post:

Salohcin (08-15-2012)

4. Re: Calculating discrete changes

Thanks so much! I will look into it. I am still a bit unsure how I can force the other dummies to be zero. Would it be something like margins race, at(smoke = (0))? I am a bit confused about the syntax and I want to force multiple dummies to zero at once. Thanks a gain,

Nick

5. Re: Calculating discrete changes

Yes, although you don't need the internal set of parentheses - they're only needed if you're providing a list of numbers. So you can just do:
margins race, at(smoke=0)

... or for something more interesting:
margins race, at(smoke=0 age=30)

... or to demonstrate the use of a list:
margins race, at(smoke=0 age=(20 30 40))

6. The Following User Says Thank You to bukharin For This Useful Post:

Salohcin (08-15-2012)

7. Re: Calculating discrete changes

That is 100% what I was looking for. I really appreciate that.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts