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 07:12:54 -0700

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/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index