Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: out of sample linear prediction in Cox model


From   Lin Zhang <lizhang@jhsph.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: out of sample linear prediction in Cox model
Date   Thu, 19 Dec 2002 11:14:54 -0500

Hello to everyone:
I have a problem in doing a survival analysis. I used a cox model with 
weighted sample, the model worked well. Then I wanted to use this 
fitted model to make linear prediction (the log hazard ratio) based on 
a NEW dataset, it did not let me do this. I don't know if the cox model 
can make linear prediction on NEW dataset or the syntax of Stata I used 
was wrong.
The Stata commends I used:
. stset msltime censor [pweight=weight2] if (id!=9999)
. stcox exp s1 s2 s3 bmi gender agemslt if (id!=9999)
. predict xb if id==9999, xb
  (I got all missing values for the prediction)
. predict std if id==9999, stdp
  (I got all missing values for the prediction) 

It can make prediction on the used dataset. I tried non-weighted cox 
model, it also did not work.

Could anybody help me? 

Thanks in advance! And Happy Holiday to everybody!

Lin Zhang


 



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



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