Statalist


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

Re: st: no STATA answer: should I wait or is it a bug?


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: no STATA answer: should I wait or is it a bug?
Date   Wed, 18 Mar 2009 13:16:30 -0400

Isabelle <[email protected]> :
I have tried to estimate -clogit- and -xtlogit- models that still had
not completed the first iteration after 30 days (at which point I gave
up).  Sometimes these models are just too big.  Here is a method
(using -stcox- to do -clogit-) that may enable you to get -clogit-
estimates faster in big datasets (the method is based on an email from
Bobby Gutierrez of Statacorp), but I think the faster Breslow method
only works if you have one positive outcome within group (in your
email the depvar name "choice" suggests one positive outcome per
group, but the output you show indicates multiple positive outcomes
per group), for evidence of which see the third example below:

set rmsg on
webuse lowbirth, clear
clogit low lwt smoke ptd, group(pairid)
est sto clogit
gen enter = pairid - 0.5
gen exit  = pairid + 0.5
stset pairid low, enter(time enter) exit(time exit)
stcox lwt smoke ptd, nohr exactp
est sto exactp
stcox lwt smoke ptd, nohr
est sto breslow
mat b=e(b)
clogit low lwt smoke ptd, group(pairid) from(b)
est sto clogit
est table *, se eq(1)

est clear
webuse choice, clear
asclogit choice dealer, casevars(income sex) case(id) alternatives(car)
est sto asclogit
gen Japan_income=(car==2)*income
gen Japan_sex=(car==2)*sex
gen Japan_cons=(car==2)
gen Europe_income=(car==3)*income
gen Europe_sex=(car==3)*sex
gen Europe_cons=(car==3)
clogit choice dealer J* E*, group(id)
gen enter = id - 0.5
gen exit  = id + 0.5
stset id choice, enter(time enter) exit(time exit)
stcox dealer J* E*, nohr exactp
est sto exactp
stcox dealer J* E*, nohr
est sto breslow
mat b=e(b)
clogit choice dealer J* E*, group(id) from(b)
est sto clogit
est table *, se eq(1)

est clear
webuse union, clear
gen enter = idcode - 0.5
gen exit = idcode + 0.5
stset idcode union, enter(time enter) exit(time exit)
clogit union age grade not_smsa, group(idcode)
est sto clogit
egen u=mean(union), by(idcode)
stcox age grade not_smsa if u!=1 & u!=0, nohr exactp
est sto exactp
stcox age grade not_smsa if u!=1 & u!=0, nohr
est sto breslow
est table *, se eq(1)

How many groups (distinct values of siren) do you have?  Can you run a
logit with dummies for each group? For consistency of this estimator,
the number of country choices has to increase with the number of
groups held constant, which may seem unrealistic, depending on your
data... but if you have 1000 groups and 150 countries, 150 may be
close enough to infinity to use the output of the -logit- with
confidence.  If you have 2600 groups and 59 countries, you might be
less comfortable. In any case, you should also specify cluster(siren).

What are these data?  Firms investing in countries?

On Wed, Mar 18, 2009 at 7:32 AM,  <[email protected]> wrote:
> Hello,
>
> I have a big dataset of 149954 observations and roughly 40 var. I ran a
> conditional logit and I think my dataset and my command are ok. The answer
> of STATA is this one:
>
> ******
> . clogit choice pays lntax lnGDP, group(siren)
> note: multiple positive outcomes within groups encountered.
> note: 3 groups (177 obs) dropped because of all positive or
>      all negative outcomes.
> ********
> (in black or green), and I don't have anything else after 15 minutes. Is
> it a bug if Stata because of too little memory or should I wait and see?
>
> Thank you very much for help,
>
> Isabelle

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index