Statalist


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

st: why the bootstrap fails


From   Michael McCulloch <mm@pinest.org>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   st: why the bootstrap fails
Date   Tue, 28 Aug 2007 08:57:02 -0700

Dear Statalist members,
I am puzzled why a weighted Cox regression (called BASIC ANALYSIS) would fail when I use that same code within a bootstrap (called BOOTSTRAP ANALYSIS below). 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index