[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: RE: margins
Maarten Buis <email@example.com>
Re: st: RE: margins
Wed, 11 May 2011 12:09:48 +0200
On Wed, May 11, 2011 at 11:13 AM, Fitzmaurice, Ann E.
> I have keep the model simple, there are other main effects I would want to enter, I have run the following
> logistic preterm2 i.bir_grp2##i.age_gp2a
> what I want to use margins for is to create a table of the odds ratios (preferably including confidence intervals) of bir_gr2 (four levels _ by age_gp2a (4 levels) , and this is where I though I want to use margins, perhaps this is not the correct command
As I explained before, such a complete table will give you odds and
not odds ratios. -margins- is not designed for that purpose, but it
can be used by specifying the -expression(exp(predict(xb)))- option.
If you have other explanatory variables you need to be careful in the
sense that you need to make sure that the odds refer to meaningful
groups, use the -at()- option for that.
The trick to check whether you specified your -margins- command
correctly is to see whether you can exactly reproduce those numbers by
choosing appropriate reference categories and interactions using
-logit-. I actually prefer to go the -logit- route, as it forces me to
think exactly about who these numbers are referring to. You reported
to me privately that when you added more control variables Stata
started dropping some of them. That means that there is still some
ambiguity in your model as what group each parameter refers to. That
can only be solved by thinking carefully about the model, which
typically involves starting simple and adding variables and
interactions one at the time and fix any ambiguities as they appear.
This is tedious, frustrating and boring work and it takes a lot of
time, but in the end you'll be rewarded by really understanding the
model that you are presenting.
Hope this helps,
Maarten L. Buis
Institut fuer Soziologie
* For searches and help try: