Bookmark and Share

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

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

Re: st: Adjusted Prevalence from Logistic models

From   Richard Williams <>
To, <>
Subject   Re: st: Adjusted Prevalence from Logistic models
Date   Wed, 24 Oct 2012 03:18:11 -0500

At 01:18 AM 10/24/2012, Dean Eurich wrote:
Hi all,

A simple question. If I run a logistic model:

logistic BB age sex rural

I get the OR for the effect of rural (which is a flag for rural=0 or urban=1 dwelling) on the use of beta blockers (medication used to treat cardiovascular disease).

A reviewer has asked for us to present the adjusted prevalence for the use of BB by rural and urban status. I am not to sure how to do this.

I assume I could use the 'margin' command.

So would it be as simple as

 margins rural, atmeans

(Although I realize I could do it as specific levels of sex and age as well)



I'm not totally sure how you want to adjust. But if you want to use -margins- you should use factor variable notation, e.g.

logistic BB age i.rural
margins rural, atmeans

In general, I am not crazy about the atmeans option, and I especially don't like it when you have a variable like sex in the model. You'll be plugging in something like .5 for sex (the average person is half male, half female?) I'd rather use the default -asobserved- or plug in specific values or ranges of values for the other variables. For some highlights of what you can do with margins, see

As a sidelight, when you say rural=0 or urban=1, that sort of sounds to me like heads I win, tails you lose. Aren't rural=0 and urban=1 the same thing?

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

*   For searches and help try:

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