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]
st: Bootstrapping Harrell's C - problem with freezing model to establish optimism - stepwise etc.
From
"Jon Kroll Bjerregaard" <[email protected]>
To
<[email protected]>
Subject
st: Bootstrapping Harrell's C - problem with freezing model to establish optimism - stepwise etc.
Date
Sat, 19 Feb 2011 09:06:31 +0100
Hello
I'm trying to determine the optimism - as described by Harrell et al. for a
Cox model established for pancreatic cancer (with Harrell's C instead of
Somers' D).
I have made a model including clinical (forced into) and clinical
(stepwise'ed selected) variables - I have 150 events in 178 patients.
Selection statement
xi: stepwise, pr(.15) lockterm1: stcox (i.AJCC i.inf_PS) zalder i.gender
vol_GTV i.forb_regime i.hem_LNL zwbc zthromb i.LDH_UNL i.ALAT_UNL i.BASP_UNL
sero_bili i.resection_perf
Ending with the final model
xi: stcox i.AJCC i.inf_PS i.BASP_UNL vol_GTV i.resection_perf i.forb_regime
Which is a mixture of continuous and categorical variables.
This is what I'm trying to do(as Harrell describes 1996/2001):
Bootstrap Harrell's C from the full model including the stepwise selection-
(Cboot)
"Freeze" the bootstrapped model and apply it to the original dataset and
calculate Harrell's C (Corig)
Calculate optimism from: Cboot-Corig
Repeat 200 times bootstrap
So this is where my problems start (or my lack of skills)
I use this program - adapted from another statalist post
****************************************************
capture program drop b_conc
program define b_conc, rclass
xi: stepwise, pr(.15) lockterm1: stcox (i.AJCC
i.inf_PS) zalder i.gender vol_GTV i.forb_regime i.hem_LNL zwbc zthromb
i.LDH_UNL i.ALAT_UNL i.BASP_UNL sero_bili i.resection_perf, efron
estat concordance
return scalar c = r(C)
end
bs d=r(c), reps(200) seed (123456) saving(myfile, replace): b_conc
***************************************************
Then I do another one with the final model and substract them - but this is
not really the plan.
I have several problems with this since it refuses to perform the bootstrap
(I get a lot of x's) which is most likely due to not using temporary
variables - haven't figured out exactly what is wrong yet.
I also need to put in the "freezed" model and apply to the original dataset
- which I'm not sure how I get into a bootstrap routine.
Thanks in advanced
Jon K. Bjerregaard, MD.
Dep. of Oncology, Odense University Hospital
*
* 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/