Statalist


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

Re: Res: st: xtlogit with cluster


From   Steven Samuels <[email protected]>
To   [email protected]
Subject   Re: Res: st: xtlogit with cluster
Date   Sun, 12 Oct 2008 20:15:05 -0400

Glauco-

It doesn't look like there is a way through -xtlogit-. However - stcox- is survey enabled and accepts clustering. The -exactp- option for handling ties is equivalent to doing conditional logistic regression at each time point. With some creativity, you might be able to -stset- your data to do something close to -xtlogit-. (Note that -exactp- can be very slow.)

Some thoughts about this:

• I don't know if this will work!

• Standardize your times so that they are small integers: e.g. 1971 = 1, 1972-2.

• Create a fake starting point, one time unit earlier than the earliest time for each panel. This is needed so that all times with real data will be >0 For example, if 1971 is the earliest time point for a panel, add a fake first record with 1970 as the time. You could do this by expanding the earliest observation to two, then arbitrarily setting one of the records to 1970. Append the rest of the panel data, if any. Then after subtracting 1970 from each year for that person, you would have data 0, 1, .... The 0 will be ignored by -stcox-.

• In -stset-, the -id- options will identify the panel.

• Set -origin- to be earliest (fake) date for the panel.

• Use the -exit(time .)- option so that -stcox- will accept events after the first one in a panel.

• If there are gaps in the time sequence for a panel, create a "beginning date" and an "ending date" for each time point. This would facilitate the use of the -time0- option for handling of gaps. For example for events in 1972, you might define the beginning of observation to be 1 Jan 1970 and the end to be 31 Dec 1970.

• Add interactions with time as time-varying covariates.

• The -shared(panelid)- might be able to fit a random effects model.

Good luck!

-Steve

On Oct 12, 2008, at 1:47 PM, Glauco Peres wrote:

Thanks anyway, guys.
Is it theoretically possible to use the cluster command with xtlogit? Or am I asking for something weird?
If that is possible, does anyone have a do-file or so?

thanks again.

Glauco



----- Mensagem original ----
De: Martin Weiss <[email protected]>
Para: [email protected]
Enviadas: Domingo, 12 de Outubro de 2008 7:11:39
Assunto: Re: st: xtlogit with cluster

I think that is not true, either. If the -bootstrap- vce for -xtlogit-
allowed -cluster-ing, highlighting the -bootstrap- vce in the dialog box should bring up a drop-down for the -cluster- variable, just as it does in,
for instance, -db xtreg-. When I


**********
. webuse union, clear
(NLS Women 14-24 in 1968)

. xtlogit union age grade not_smsa south southXt, fe vce(bootstrap,
cluster(black))
option cluster() not allowed
r(198);

. xtlogit union age grade not_smsa south southXt, re vce(bootstrap,
cluster(black))
option cluster() not allowed
r(198);
************

it does not allow me to cluster, even with the -bootstrap-. Otherwise one
could easily circumvent any restriction on the analytic se with
the -bootstrap-...

HTH
Martin
_______________________
----- Original Message -----
From: "Steven Samuels" <[email protected]>
To: <[email protected]>
Sent: Sunday, October 12, 2008 5:09 AM
Subject: Re: st: xtlogit with cluster


Good point, Martin.   The manual for -xtlogit- does say that the only
allowed  -vce- options are oim, bootstrap, and jackknife.   However,
according to the help for vce_options (link to -help
bootstrap_options- -help jackknife_options-, Glauco apparently can add the cluster option to the jackknife or bootstrap specification, e.g.
"vce(jackknife, cluster(varname))".

-Steve
On Oct 11, 2008, at 6:01 PM, Martin Weiss wrote:

What is the answer to Glauco`s question then? The -help- file you
mention says: " Not all the options documented below work with all xt estimation commands". -h xtlogit- certainly does not mention a - cluster- option for the se. It does link to -help vce_option- but only allows some of the choices mentioned there. -cluster- does not seem to be one
of them...

HTH
Martin
_______________________
----- Original Message ----- From: "Steven Samuels"
<[email protected]>
To: <[email protected]>
Sent: Saturday, October 11, 2008 11:53 PM
Subject: Re: st: xtlogit with cluster


-help xt_vce_options-  has the answer.  I found this from -help
xtlogit-

-Steve


On Oct 11, 2008, at 3:45 PM, Glauco Peres wrote:

Dear STATAlista,

How do I run a xtlogit and add cluster command [vce(cluster)] in
order to correct the standard errors?

Thanks a lot,

Glauco



Novos endereços, o Yahoo! que você conhece. Crie um email novo
com a sua cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses

*
*   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/


*
*   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/



Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses

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