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   Mon, 7 Mar 2011 07:25:37 -0500

Take a look at the [R] bootstrap entry and their running examples.
Yours will run along the similar lines, and have [pw] where
applicable. Remember, unlike the -bootstrap- that actually changes the
data in memory, the survey bootstrap only substitutes different sets
of weight variables.

On Mon, Mar 7, 2011 at 2:24 AM, Michael Palmer
<[email protected]> wrote:
> Thank you for your response. Your explanation makes sense and I'll be sure to cite your paper. But I'm not exactly sure how I might rewrite the program so that it accepts pw. Do you happen to have any example programs that you could send me or better yet offer any advice on how to rewrite my program?
>
> Best regards,
>
> Michael Palmer
> PhD Candidate
> National Centre for Epidemiology and Population Health
> The Australian National University
> Ph. 6125 0538
> M. 0437 867 940
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Stas Kolenikov
> Sent: Monday, 7 March 2011 3:24 PM
> To: [email protected]
> Subject: Re: st: svy bootstrap
>
> 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/
>
>
>
> *
> *   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/
>



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