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

Re: st: weights in xt commands


From   Stas Kolenikov <[email protected]>
To   [email protected]
Subject   Re: st: weights in xt commands
Date   Mon, 19 Jul 2004 10:45:51 -0400 (EDT)

> Good morning everyone. The help for xtlogit and other xt commands states
> very clearly "Note that weights must be constant within panels." Can
> anyone explain why this restriction is necessary?

Stata thinks of -xt- as if one sample was taken in the first period, and
then observed for the remaining ones all over again. So the sampling was
performed only once, hence all observations within a panel should have the
same weight as they have the same probability of selection in that first
period sampling. Using -xt- commands for the clustered samples,
technically speaking, is not quite what they were designed for, and you
seem to have found one complication where it really is important.

Also, at least for the part with linear regression, Stata makes some
transformation of the data (like taking the panel means out, or something
of the kind). If the weights were different, such transformations would
not be possible.

> The motivation for my question is that we have a study in which persons
> within clusters were sampled with different probabilities. Does anyone
> know a way to fit random-effects models to such data?

Well a knee-jerk reaction to "I cannot fit a random effect model with
-xt-; what do I do?" would be to try -gllamm-, but it does not seem to
support weights. (Am I wrong on that?) It may well be that the best you
can do is to run -logit [pw=...], cluster(psu)- hoping that it won't be
very much inefficient relative to the panel data model. (In the
simulations with econometric background I've seen, the loss of efficiency
was at most 10-15%, which is not terrible.) With -sysuse auto-, the
following runs without any syntax error messages:

. logit for mpg [pw=wei] , cluster(rep)

Oh my God, I've also forgotten about -svylogit-! Is there any reason you
cannot use that one?

 ---                                    Stas Kolenikov
 --       Ph.D. student in Statistics at UNC-Chapel Hill
 - http://www.komkon.org/~tacik/  -- [email protected]

* This e-mail and all attachments to it are not intended to provide any
* reasonable point of view and was transmitted to you in error. It
* should be immediately deleted by all recipients unless they really
* enjoy communicating with the author :). Other restrictions apply.

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