Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: why the bootstrap fails


From   Michael McCulloch <[email protected]>
To   [email protected]
Subject   Re: st: why the bootstrap fails
Date   Thu, 30 Aug 2007 08:10:28 -0700

Thanks Stan, the bootstrap is used for inference as it's a Marginal Structural Models survival analysis. -noisily- does not work here, but I really appreciate the suggestion!

Comments from others would also be greatly appreciated.
Many thanks to all,
Michael



Try -bootstrap, noisily- (or whatever is the option that gives you
output from your model). -streg- does not return what -bootstrap- was
expecting, and the reasons for that might be repeated observations
that Cox models may not like, or something of a kind. And I would
personally want to see the bootstrap justified as the inference method
with Cox model -- the latter is weird enough in many respects, so the
bootstrap may not be working terribly well with it. I am not an expert
on survival at all, so I cannot say for sure.

On 8/30/07, Michael McCulloch <[email protected]> wrote:
 >show your Stata output please. "fails" is a pretty broad term.

 Hello,
 I apologize for not having shown my output. I will restate my
 question here, with the output below:

 I am puzzled why the same weighted Cox regression, which works well
 when not within a bootstrap program (called BASIC ANALYSIS) would
 fail by saying there are insufficient observations when I use that
 same code within a bootstrap (called BOOTSTRAP ANALYSIS  below).

 The output after running my bootstrap is:

 Bootstrap replications (50)
 ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    50
 insufficient observations to compute bootstrap standard errors
 no results will be saved
 r(2000);

 Can anyone offer insight into how I might find the answer to this question?


 BASIC ANALYSIS:
 * fit the full model used in Traditional Cox
         logit tcm dxage sex race txsurg
 *estimate probability of treatment
         predict p_tcm_ALL
         gen p_notcm_ALL = 1-p_tcm_ALL if tcm==0
         replace p_tcm_ALL =p_notcm_ALL if tcm==0
 *create stabilized weight==P(A)/P(A|W)
         logit tcm
         predict p_ALL
         gen p_noALL=1-p_ALL if tcm==0
         replace p_ALL = p_noALL if tcm==0
         gen wt_stab_ALL=p_ALL/p_tcm_ALL
         stset datedied [iweight=wt_stab_ALL], failure(failed)
 origin(datedx) scale(30.4375)
 * cox
         stcox tcm

 BOOTSTRAP ANALYSIS:
 capture program drop msmcox_stageIIIA_includeIPTWd
         program define msmcox_stageIIIA_includeIPTWd, rclass

         INSERT SAME MODEL AS ABOVE

         indeplist, local
         foreach var of varlist `X' {
                 return scalar `var' = _b[`var']
         }
 end
 set seed 12358
 bootstrap tcm=r(tcm), eform reps(50): msmcox_stageIIIA_includeIPTWd


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


--
Stas Kolenikov, also found at http://stas.kolenikov.name

Small print: Please do not reply to my Gmail address as I don't check
it regularly.
*
*   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/
*
*   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