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

From |
Michael McCulloch <mm@pinest.org> |

To |
statalist@hsphsun2.harvard.edu |

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

Date |
Tue, 7 Aug 2007 22:05:02 -0700 |

Thank you Richard. Yes, I do need to run the analysis within my bootstrap program, and not using the bootstrap prefix or -vce(bootstrap)- option after -stcox-. The reason for that is that the data are -stset- using -iweights-.

Jeff Pitbaldo responded to a previous posting of mine (st: stcox: weighted regression changes the # of observations) that: "-bootstrap- is not meant for weighted data. Currently -stcox- with the -vce(bootstrap)- option does not complain when weights have been -stset, but it should (we will fix this soon)."

The reason I posted my question using <cancer.dta> is so I could demonstrate my code so it would be reproducible. I do appreciate the thoughtful and incisive attention of the Statalist users.

I'm still stymied!

Michael

At 10:26 PM 8/7/2007, Michael McCulloch wrote:OK, here are the bootstrapped results using your code: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.

. 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 | .2580584 .0692074 3.73 0.000 .1224144 .3937025

------------------------------------------------------------------------------

The z value = the incorrectly labeled hazard ratio (.2580584) divided by the bootstrap standard error.

Now contrast that with the following:

. set seed 12358

. bootstrap, reps(100): stcox drug

(running stcox on estimation sample)

Bootstrap replications (100)

----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5

.................................................. 50

.................................................. 100

Cox regression -- Breslow method for ties

No. of subjects = 48 Number of obs = 48

No. of failures = 31

Time at risk = 744

Wald chi2(1) = 19.56

Log likelihood = -86.389289 Prob > chi2 = 0.0000

------------------------------------------------------------------------------

| Observed Bootstrap Normal-based

_t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

drug | .2580584 .0790376 -4.42 0.000 .1415839 .4703513

------------------------------------------------------------------------------

Note that (a) the hazard ratio is now labeled correctly, and (b) z does NOT equal the hazard ratio divided by the bootstrap std. error. Finally, consider

. set seed 12358

. bootstrap, reps(100): stcox drug, nohr

(running stcox on estimation sample)

Bootstrap replications (100)

----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5

.................................................. 50

.................................................. 100

Cox regression -- Breslow method for ties

No. of subjects = 48 Number of obs = 48

No. of failures = 31

Time at risk = 744

Wald chi2(1) = 19.56

Log likelihood = -86.389289 Prob > chi2 = 0.0000

------------------------------------------------------------------------------

| Observed Bootstrap Normal-based

_t | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

drug | -1.354569 .306278 -4.42 0.000 -1.954863 -.7542754

------------------------------------------------------------------------------

Here, z does equal observed coefficient/bootstrap std. error.

So again, I think the source of the earlier confusion stems from the fact that Stata was doing things wrong. But, if you use the bootstrap prefix command (which seems a lot simpler anyway) then you get the right results. If you need to do it your way, I strongly suspect StataCorp has to fix some bugs first; unless there is some bug in your program I am overlooking.

-------------------------------------------

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

WWW: http://www.nd.edu/~rwilliam

*

* 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/

* * 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/

**Follow-Ups**:**Re: st: stcox output: p-value and CI don't agree***From:*Richard Williams <Richard.A.Williams.5@ND.edu>

**References**:**st: stcox output: p-value and CI don't agree***From:*Michael McCulloch <mm@pinest.org>

**Re: st: stcox output: p-value and CI don't agree***From:*Philip Ryan <philip.ryan@adelaide.edu.au>

**Re: st: stcox output: p-value and CI don't agree***From:*Michael McCulloch <mm@pinest.org>

**Re: st: stcox output: p-value and CI don't agree***From:*Philip Ryan <philip.ryan@adelaide.edu.au>

**Re: st: stcox output: p-value and CI don't agree***From:*Michael McCulloch <mm@pinest.org>

**Re: st: stcox output: p-value and CI don't agree***From:*Richard Williams <Richard.A.Williams.5@ND.edu>

- Prev by Date:
**Re: st: stcox output: p-value and CI don't agree** - Next by Date:
**Re: st: stcox output: p-value and CI don't agree** - Previous by thread:
**Re: st: stcox output: p-value and CI don't agree** - Next by thread:
**Re: st: stcox output: p-value and CI don't agree** - Index(es):

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