Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: svy bootstrap


From   Stas Kolenikov <[email protected]>
To   [email protected]
Subject   Re: st: svy bootstrap
Date   Sun, 6 Mar 2011 23:24:14 -0500

The command -mean- had difficulties understanding what the variable
name was. It was expecting a variable name, but -r(prod2)- was not a
variable. Of course it is not a factor variable or a time series
lagged variable, but that's the best error message Stata could send to
you, given that nobody would put anything but variable names after
-mean-.

To make your program work with -bs4rw- or -svy, vce(bootstrap)-, you
need to rewrite it so that it accepts [pw] or [iw] and runs all
estimation commands with those weights... and produces something
reasonable in the end. Then you can run -bs4rw (prod2 = r(prod2) ),
rw( bsw* ) : twopart [pw=original weight]- to obtain your bootstrap
standard errors. (I would not trust 50 replicates that much, and it
should be pretty easy to increase this number; it does not look like
you have any extraordinary difficult computations within your
program.)

I see that you found my -bsweights- command useful, and I hope you
will cite my SJ paper documenting this command.

On Sun, Mar 6, 2011 at 10:20 PM, Michael Palmer
<[email protected]> wrote:
> Dear Statalist,
>
> I am trying to bootstrap standard errors in a two-part model using
> complex survey data. The first model is a logit and the second a log
> linear model of expenditures. From the below do file I get the following
> error message. Any help is greatly appreciated.
>
>  bsweights bsw, reps(40) n(-1)
>  svyset [pweight=psindwt], strata(domain) psu(commcode) vce(bootstrap)
> bsrweight(bsw*)
> . svy: mean r(prod2)
> (running mean on estimation sample)
> factor variables and time-series operators not allowed
> an error occurred when bootstrap executed mean
> r(101);
>

-- 
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index