Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: how to do fixed effects with weights? (problem using svy: with xtreg, fe)


From   Stas Kolenikov <skolenik@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: how to do fixed effects with weights? (problem using svy: with xtreg, fe)
Date   Sun, 11 Apr 2010 23:46:27 -0500

In fact, -xtreg- satisfies the Stata's internal requirements needed
for -vce(jackknife)- that -if- conditions and [pweights] be accepted
and processed by the command, and the results be returned in e(b) and
e(V) matrices (plus a little bit of extra details; see -help program
properties-). So at your own risk you can write a very simple wrapper
like this:

program define myxtreg, eclass properties( svyj )

   * transfer the whole call to -xtreg-
   xtreg `0'

   * pretend we wrote a full fledge estimator here
   ereturn local cmd myxtreg

end

and try running your -svy, vce( jackknife ): myxtreg whatever- command
with it. This eliminates the need to do the jackknife "by hand" as
Steve S suggested, and if it does work, it will produce correct
results (it falls short of a proper Stata estimation command in a
number of ways, but I don't know whether that will be a problem since
you only need it for a specific purpose and won't distribute as an
estimation command that somebody else could use). This is a different
workaround than Steve's, that's all -- you'd HAVE TO write some
specialized code to make it work, and I would rather try to squeeze an
estimator into the existing -svy- paradigm than to write my own cycles
to process the jackknife weights.

Another issue that might bite you is that you might come across
weights that change from wave to wave for the same student. -xtreg-
will issue an error message, and that is the most reasonable behavior
in this situation.

On Sun, Apr 11, 2010 at 2:43 PM,  <ah2574@columbia.edu> wrote:
> I am analyzing longitudinal data on children's educational achievement using
> the "xtreg, fe" command.  My challenge is that I can't seem to weight the
> data with the "svy:" command when running a fixed effects model.  I am
> working with Early Childhood Longitudinal Study-Kindergarten Cohort data
> from the National Center for Education Statistics; the study employed a
> multistage probability sample design (with three stages).
>
> As advised by a technical consultant at the American Institutes for
> Reserach, I am currently "survey setting" the data using replicate weights
> as follows:
> svyset [pweight=c1_5fp0], jkrweight( c1_5fp1-c1_5fp90, multiplier(1))
>
> I then attempted to run the fixed effects model with this syntax:
> svy jacknife: xtreg ztime incneed married momwork numchild, i(childid2) fe
>
> I receive the following error message:
> xtreg is not supported by svy with vce(jackknife)


-- 
Stas Kolenikov, also found at http://stas.kolenikov.name
Small print: I use this email account for mailing lists only.

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index