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

Re: st: stcox output: p-value and CI don't agree

From   Richard Williams <>
Subject   Re: st: stcox output: p-value and CI don't agree
Date   Wed, 08 Aug 2007 01:00:27 -0500

At 11:32 PM 8/7/2007, Philip Ryan wrote:

But you are not bootstrapping estimates of the upper and lower confidence intervals on the exponential scale. Stata just sees the 100 instances of the "coefficients" as numbers, not hazard ratios, it gets their mean which it reports as the final estimate of "coefficient" (OK) and it gets their standard deviation and it just does the usual normal large sample approximation to a confidence interval. But the coverage of this confidence interval may not be very good, because the hazard ratio is not usually well approximated by a normal distribution. One usually deals with this by operating on the log scale - more closely approximating the normal distribution - and exponentiating afterwards.
Interesting! So I guess I am wrong in saying there is a bug in Stata, even though it is clearly not producing the intended results here.

So, what happens to your paradoxical example if you bootstrap _b[drug] rather than exp(_b[drug]) and exponentiate the reported coefficient, the lower limit and the upper limit as the final step? Does this resolve the inconsistency?
I think so.  Here are the results:

. bootstrap drug=r(drug), reps(100): boot_hr
(running boot_hr on estimation sample)

Bootstrap replications (100)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
..................................................    50
..................................................   100

Bootstrap results                               Number of obs      =        48
                                                Replications       =       100

      command:  boot_hr
         drug:  r(drug)

             |   Observed   Bootstrap                         Normal-based
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
        drug |  -1.354569    .306278    -4.42   0.000    -1.954863   -.7542754

I still don't see why you need the program though; what is wrong with

bootstrap, reps(100): stcox drug

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu

*   For searches and help try:

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