Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: predictions after spsurv


From   "Mark S. Manger" <[email protected]>
To   [email protected]
Subject   Re: st: predictions after spsurv
Date   Fri, 18 Dec 2009 21:05:10 +0000

Excellent, thanks a lot for the detailed response.

--Mark

Dr Mark S MANGER
Lecturer in International Political Economy
International Relations Department
London School of Economics
[email protected]
Phone +44 (0) 20 7955 6525

On 2009-11-19, at 20:02 , [email protected] wrote:

> -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
> predicted values
> (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
> 
> -Steve
> 
> 
> On Thu, Nov 19, 2009 at 12:03 PM, Mark S. Manger <[email protected]> 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.
>> 
>> Best,
>> 
>> Mark
>> 
>> 
>> Reference:
>> 
>> http://fmwww.bc.edu/repec/bocode/s/spsur_ll.ado
>> http://fmwww.bc.edu/repec/bocode/s/spsurv.ado
>> 
>> 
>> 
>> Dr Mark S MANGER
>> Lecturer in International Political Economy
>> International Relations Department
>> London School of Economics
>> [email protected]
>> Phone +44 (0) 20 7955 6525
>> 
>> On 2009-11-18, at 19:59 , [email protected] 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.
>>> 
>>> -Steve
>>> 
>>> On Wed, Nov 18, 2009 at 1:08 PM, Mark S. Manger <[email protected]> wrote:
>>>> Hi,
>>>> 
>>>> 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?
>>>> 
>>>> 
>>>> Cheers,
>>>> 
>>>> Mark
>>>> 
>>>> 
>>>> Stata 9.2
>>>> OS X
>>>> 
>>>> Dr Mark S MANGER
>>>> Lecturer in International Political Economy
>>>> International Relations Department
>>>> London School of Economics
>>>> [email protected]
>>>> 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
>>> [email protected]
>>> 18 Cantine's Island
>>> Saugerties NY 12477
>>> USA
>>> 845-246-0774
>>> 
>>> *
>>> *   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/
>> 
> 
> 
> 
> -- 
> Steven Samuels
> [email protected]
> 18 Cantine's Island
> Saugerties NY 12477
> USA
> 845-246-0774
> 
> *
> *   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/planningAndCorporatePolicy/legalandComplianceTeam/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/



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