Dear Carlo,
Oh, sorry. I should have explained more carefully. I realize that the
p-value is shown when I run my example. But I am doing a study where I
repeat a Cox-model 10,000 times, each time drawing matched pairs at
random from a large population. My model includes an exposure and
several confounders. I am using -postfile- to generate a new dataset
that contains the coefficient for my exposure from each of the 10,000
runs, but I would also like it to contain the p-value for the test of
proportional hazards for my exposure. I am less concerned with
proportional hazards for my confounders. Therefore, I need to obtain the
p-value for 'exposure' in my example below in a more automatic manner.
And, as I wrote, -estat phtest- leaves behind only the chi2 and df for
the GLOBAL test.
Best regards,
Peter.
-----Oprindelig meddelelse-----
Fra: Carlo Lazzaro [mailto:[email protected]]
Sendt: 10. oktober 2007 11:37
Til: [email protected]
Cc: Peter Jepsen
Emne: R: Date: Wed, 10 Oct 2007 10:41:19 +0200
Peter wrote:
Dear Statalisters,
I would like to obtain the p-value (or chi2) for the test of
proportional
hazard assumption for the variable 'exposed'. -return list- gives me the
chi2 for the global test, but not for the individual variables in the
model.
An example:
sysuse cancer, clear
stset studytime, fail(died)
gen exposed=drug==1
stcox exposed age, sca(sca*) sch(sch*)
estat phtest, detail
I can obtain the rho for 'exposed' with -corr sca1 _t-, but I don't know
how
to get the chi2. I have tried reading the source code with - viewsource
stphtest.ado- but I couldn't make it out. Can anybody help me?
Best regards,
Peter.
Dear Peter,
I have tried to run your example and as far as - estat phtest, detail -
is
concerned, I have obtained what follows:
Test of proportional hazards assumption
Time: Time
----------------------------------------------------------------
| rho chi2 df Prob>chi2
------------+---------------------------------------------------
exposed | -0.00949 0.00 1 0.9603
age | -0.11758 0.42 1 0.5168
------------+---------------------------------------------------
global test | 0.43 2 0.8064
----------------------------------------------------------------
Is it what you were looking for?
Kind Regards,
Carlo
*
* 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/