Bookmark and Share

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


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

Re: st: margins after xtlogit


From   Steve Samuels <[email protected]>
To   [email protected]
Subject   Re: st: margins after xtlogit
Date   Sat, 11 Sep 2010 23:31:35 -0400

--

The probabilities produced by "margins race1, predict(pu0)" after
-xtlogit, will not resemble the probabilities from -logistic-, because
the -pu0- predictions set the random intercepts to zero.

****************************************
webuse union, clear
xtset
logistic union age i.not_smsa
margins not_smsa
xtlogit union age i.not_smsa, re
margins not_smsa, predict(pu0)
****************************************

Steve

Steven J. Samuels
[email protected]
18 Cantine's Island
Saugerties NY 12477
USA
Voice: 845-246-0774
Fax:    206-202-4783

On Sat, Sep 11, 2010 at 1:41 AM, Michael N. Mitchell
<[email protected]> wrote:
> Dear Traci
>
>  I will start with a possible answer, and then work back to why this is so.
> After the -xtlogit- command, try this...
>
> margins race1, predict(pu0)
>
>  This should then express the results in terms of predicted probabilities
> (as the -logit- model did). The reason is that the -predict- command
> defaults to predicting probabilities in after the -logit- command. This is
> described in
>  -help logit postestimation- under the section on predict that will say
> "pr            probability of a positive outcome; the default"
>
>  Contrast this with -help xtlogit postestimation-, in which the section
> about predict says that the default prediction is "xb           linear
> prediction; the default".
>
> I hope that helps,
>
> Michael N. Mitchell
> Data Management Using Stata      - http://www.stata.com/bookstore/dmus.html
> A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
> Stata tidbit of the week         - http://www.MichaelNormanMitchell.com
>
>
>
> On 2010-09-10 4.59 PM, Traci Schlesinger wrote:
>>
>> hi all:
>>
>> i am analyzing racial disparities in pretrial diversions (a yes no,
>> i.e. 0/1, criminal justice outcome) using individual level data from
>> the SCPS, which is clustered by county--an observation for every
>> individual charged with a felony in sampled counties is included.  to
>> account for the county level sampling, i'm using xtlogit with county
>> level random effects.
>>
>> however, i'm having difficulty interpreting the results from margins
>> after xtlogit.
>>
>> if i estimate a model with logistic and then ask for margins on race i
>> get:
>>
>> . margins race1, post
>>
>> Predictive margins                                Number of obs   =
>>  46019
>> Model VCE    : OIM
>>
>> Expression   : Pr(diversion), predict()
>>
>>
>> ------------------------------------------------------------------------------
>>              |            Delta-method
>>              |     Margin   Std. Err.      z    P>|z|     [95% Conf.
>> Interval]
>>
>> -------------+----------------------------------------------------------------
>>        race1 |
>>           1  |   .1025184   .0023145    44.29   0.000      .097982
>>  .1070548
>>           2  |   .0848741   .0020596    41.21   0.000     .0808374
>>  .0889109
>>           3  |   .0858849   .0023203    37.01   0.000     .0813372
>>  .0904327
>>
>>
>> ------------------------------------------------------------------------------
>>
>> which i interpret as meaning that if everyone in my sample were white
>> (race1 = 1), 10% of defendants would be offered pretrial diversions.
>> if everyone were black (race1=2), only 8% of defendants would be
>> offered pretrial diversions.  (race1=3 are Latinos, with 8.5% of
>> people getting diversions).
>>
>> however, if i estimate xtlogit --either getting my results as
>> coefficients or odds-ratios-- and then margins, i get the following
>> table.
>>
>> . margins race1, post
>>
>> Predictive margins                                Number of obs   =
>>  46019
>> Model VCE    : OIM
>>
>> Expression   : Linear prediction, predict()
>>
>>
>> ------------------------------------------------------------------------------
>>              |            Delta-method
>>              |     Margin   Std. Err.      z    P>|z|     [95% Conf.
>> Interval]
>>
>> -------------+----------------------------------------------------------------
>>        race1 |
>>           1  |  -3.580741   .2277247   -15.72   0.000    -4.027073
>> -3.134409
>>           2  |  -3.919428   .2274633   -17.23   0.000    -4.365248
>> -3.473608
>>           3  |   -3.67982   .2301685   -15.99   0.000    -4.130942
>> -3.228698
>>
>> ------------------------------------------------------------------------------
>>
>> i am at a loss as to how to interpret this.  for starters, it seems
>> strange that all three racial groups have negative margins.  also, i'm
>> clearly not looking at the percent of defendants who get a pretiral
>> diversion any more.  i've looked through the manual, but have not been
>> able to figure this out.  i would appreciate any help.
>>
>> cheers,
>> traci
>> *
>> *   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/


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