|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: stcox output: p-value and CI don't agree
Finally, if you estimated the hazard ratio in -stcox- the header
would be "Observed Haz. Ratio", not "Observed coefficient".
Thank you Philip, but with all due respect I promise it's the hazard
ratio that is returned. The following is the code I used, but for the
purpose of this question, applied to the Stata system data file
<cancer.dta>. Note that the plain -stcox- and bootstrapped -Cox- have
the same effect size, but a different header.
My question is this: in the case where Cox proportional hazards
regression results in apparently contradictory p-value and 95% CI,
what steps would one follow to investigate this observed result?
I'd appreciate any strategy pointers that anybody might have.
Thank you!
Michael
*--------------- begin code in question -----------------------
*************
* plain cox
*************
* load data and define as survival data
sysuse cancer, clear
stset studytim, failure(died)
* run cox
stcox drug
*************
* bootstrap cox
*************
* load data and define as survival data
sysuse cancer, clear
stset studytim, failure(died)
* define program
capture program drop boot_hr
program define boot_hr, rclass
* cox
stcox drug
indeplist, local
foreach var of varlist `X' {
return scalar `var' = exp(_b[`var'])
}
end
* set seed for reproducibility, since bootstrap is a random sampling
set seed 12358
* run program
bootstrap drug=r(drug), reps(100): boot_hr
*--------------- end code in question -----------------------
*
* 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/