Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: xtlogit dropping all variables


From   "reardon, sean f." <sreardon@stanford.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: xtlogit dropping all variables
Date   Mon, 1 Aug 2005 16:56:41 -0700

jenny --

sam is right about fixed effects models dropping variables that do not
vary within units -- but in this case jenny has specified the grouping
variable as "cnty" -- which she says is a county variable.  since sex of
physicians presumably varies within counties, it is not being dropped
for this reason, i suspect.

so i suspect there is either something wrong with the data or something
wrong with xtlogit; the latter is unlikely, as xtlogit has been around
in stata for awhile.

i'd suggest looking closely at the data to make sure things are coded as
you think -- particularly the outcome variable.  in addition, you might
try running the same model using xtreg, fe instead to see if the same
problem occurs.  you might also run the model with a single variable at
a time to see if there is a problem variable in there.

unrelated perhaps to the estimation problem, the model you have
specified may be more propoerly specified as a multi-level survival
model.  there are problems with such models when time-varying covariates
are included (i can't tell from your note, but they may be), and there
are also some interpretation issues to consider, given that the sample
potentially changes over time in different ways in each county in each
county because of differential survival rates.

for more on such models, see 

reardon, brennan, & buka (2002) "estimating multilevel discrete time
hazard models using cross-sectional data: neighborhood effects on the
onset of  cigarette use."  multivariate behavioral research 37/3:
297-330.

Jennifer S Barber, Susan A Murphy, Natalya Verbitsky (2004) "Adjusting
for Time Varying Confounding in Survival Analysis" Sociological
Methodology 34:1 163-192

sean.



_____________________________
 
sean f. reardon
associate professor of education and (by courtesy) sociology
school of education
485 lasuen mall, #315
stanford university
stanford, ca 94305-3096
650.736.8517 (office phone)
650.725.7412 (office fax)
sean.reardon@stanford.edu
_____________________________
 

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of SamL
Sent: Monday, August 01, 2005 4:04 PM
To: statalist@hsphsun2.harvard.edu
Cc: SamL@demog.berkeley.edu
Subject: Re: st: xtlogit dropping all variables

Not knowing your data, I cannot be sure if this is the reason for all
the
variables.  But, it is likely the reason for some.  xtlogit is a fixed
effects model and the basic fixed effects models does not allow
variables
that are invariant for a unit.  So, variables like sex do not change
across periods.  A person is the same sex every time they are observed.
So, there is no variation on this variable across observations for a
person, so the variable is dropped.

Any such variable, that does not have within-person variation, will be
dropped.

Hope this helps.
Sam

On Mon, 1 Aug 2005, Jenny Xin Liu wrote:

> Any comments or advice you may have are highly appreciated.
>
> We cannot figure out what is going on with the logit model that we are
running. We have panel data
> on all physicians in California and are estimating the probability
that they leave California.
> When running linear and probit models using the same dataset and
variables, we are able to obtain
> estimates, which are similar to each other.  However, when running the
xtlogit command using fixed
> effects and grouping on county, stata gives us the following output
(in addition to it taking a
> very long time to run).
>
> Does anyone have any ideas why all the variables are being dropped
out?  Thank you.
> Jenny Liu
>
> xtlogit leave age sex CAborn foreign CAres loclos y1998 y1999 y2000
y2001 y2002 mcalpct hospdum
> medpsydum surgobdum  hospratio medpsyratio surgobratio bedsratio
oldpct bdiscord hdiscord adiscord
> bdisxlos hdisxlos adisxlos hmoratio incratio, fe i(cnty)
>
> note: multiple positive outcomes within groups encountered.
> note: 7 groups (39 obs) dropped due to all positive or
>        all negative outcomes.
> Iteration 0:   log likelihood = -8.988e+307
>
> Conditional fixed-effects logit                 Number of obs      =
11467
> Group variable (i) : cnty                       Number of groups   =
43
>
>                                                  Obs per group: min =
2
>                                                                 avg =
266.7
>                                                                 max =
3681
>
>                                                  LR chi2(28)        =
.
> Log likelihood  =          .                    Prob > chi2        =
.
>
>
------------------------------------------------------------------------
------
>         leave |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
Interval]
>
-------------+----------------------------------------------------------
------
>           age |  (dropped)
>           sex |  (dropped)
>        CAborn |  (dropped)
>       foreign |  (dropped)
>         CAres |  (dropped)
>        loclos |  (dropped)
>         y1998 |  (dropped)
>         y1999 |  (dropped)
>         y2000 |  (dropped)
>         y2001 |  (dropped)
>         y2002 |  (dropped)
>       mcalpct |  (dropped)
>       hospdum |  (dropped)
>     medpsydum |  (dropped)
>     surgobdum |  (dropped)
>     hospratio |  (dropped)
>   medpsyratio |  (dropped)
>   surgobratio |  (dropped)
>     bedsratio |  (dropped)
>        oldpct |  (dropped)
>      bdiscord |  (dropped)
>      hdiscord |  (dropped)
>      adiscord |  (dropped)
>      bdisxlos |  (dropped)
>      hdisxlos |  (dropped)
>      adisxlos |  (dropped)
>      hmoratio |  (dropped)
>      incratio |  (dropped)
>
------------------------------------------------------------------------
------
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index