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

st: Re: out of sample linear prediction in Cox model


From   "Marcela Perticara" <mperticara@uahurtado.cl>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: out of sample linear prediction in Cox model
Date   Thu, 19 Dec 2002 13:51:31 -0600

You need to stset your data withough excluding any of your ids. When you
stset your data Stata is creating a vble _st that flags all of those
observations that are part of the stset data. All the following st commands
will take the stset sample as the working sample.



--------------------------------------------
Universidad Alberto Hurtado
ILADES / Georgetown University
Erasmo Escala 1835
Santiago, Chile
Phono: 671-7130 anexo 267
http://www.ilades.cl/economia/index.html
----- Original Message -----
From: "Lin Zhang" <lizhang@jhsph.edu>
To: <statalist@hsphsun2.harvard.edu>
Sent: Thursday, December 19, 2002 10:14 AM
Subject: st: out of sample linear prediction in Cox model


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


______________________________________
Universidad Alberto Hurtado
http://www.uahurtado.cl
*
*   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