[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: predictions after spsurv
Re: st: predictions after spsurv
Thu, 19 Nov 2009 15:02:02 -0500
-spsurv- is by Stephen Jenkins, and it doesn't provide a -predict-
option. One possible reason that a single prediction doesn't make
sense with time-dependent predictors.
I couldn't get -spsurv- to run the cancer example in its -help-
without omitting the "drug" variable, but the results appear to be the
same with and without version control.
If you do not have time-dependent predictors, you can create your own
(See 13.5 in the V11 User manual).
For example, I ran the following command for the cancer data model in
the -help file for -spsurv-
spsurv dead logt age, id(id) seq(t)
The linear predictor for time t is found by:
x_t = hazard[_cons] + _b[logt]*logt _b[age]*age
The discrete interval survival probability for interval t is:
g_t = exp(-exp(x_t))
The probability s_T for survival up to time T for the non-cured part
of the data is the product of the g_t for t<=T. It will probably be
better to add the logs of the g's and then exponentiate.
Finally the estimated probability of cure up to T is given by c + (1-c)*s_T
c is in e(curep) or can be computed as exp([cure_p]_cons)
The log(t) distribution form is very restrictive. Better, I think to
group the data into larger intervals and estimate a separate parameter
for each one, as Stephen recommends
On Thu, Nov 19, 2009 at 12:03 PM, Mark S. Manger <firstname.lastname@example.org> wrote:
> Thanks---and yes, spsurv (see sources below) is for Version 6/7. However,
> predict h, p
> still gives me the error "option p not allowed", so that's not the solution.
> Dr Mark S MANGER
> Lecturer in International Political Economy
> International Relations Department
> London School of Economics
> Phone +44 (0) 20 7955 6525
> On 2009-11-18, at 19:59 , email@example.com wrote:
>> -spsurv- is a user-written program, and the FAQ request that you note
>> the source of such programs.
>> From the -help-
>> "spsurv works with Stata version 6 or version 7."
>> I don't have Version 7 manuals any more, but I guess that the
>> post-estimation commands were different. At best, you will have to
>> run under version control.
>> On Wed, Nov 18, 2009 at 1:08 PM, Mark S. Manger <M.S.Manger@lse.ac.uk> wrote:
>>> I'm using spsurv to estimate a split-population survival model, and I'm trying to obtain some predictions to generate hazard functions graphs.
>>> Unfortunately, predict h, b doesn't work: "option p not allowed" and the default prediction is clearly not the probability. Can someone enlighten me how I can obtain a prediction of the probability?
>>> Stata 9.2
>>> OS X
>>> Dr Mark S MANGER
>>> Lecturer in International Political Economy
>>> International Relations Department
>>> London School of Economics
>>> Phone +44 (0) 20 7955 6525
>>> Please access the attached hyperlink for an important electronic communications disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm
>>> * For searches and help try:
>>> * http://www.stata.com/help.cgi?search
>>> * http://www.stata.com/support/statalist/faq
>>> * http://www.ats.ucla.edu/stat/stata/
>> Steven Samuels
>> 18 Cantine's Island
>> Saugerties NY 12477
>> * For searches and help try:
>> * http://www.stata.com/help.cgi?search
>> * http://www.stata.com/support/statalist/faq
>> * http://www.ats.ucla.edu/stat/stata/
> Please access the attached hyperlink for an important electronic communications disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
18 Cantine's Island
Saugerties NY 12477
* For searches and help try: