Jump to content


Photo

anyone managed to get time-to-event model working?


  • Please log in to reply
31 replies to this topic

#1 Frank Gibbons

Frank Gibbons

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationBoston area, Massachusetts

Posted 10 July 2013 - 09:38 PM

Hi all,

 

I'm just wondering whether anyone has managed to get the time-to-event models to work (using the event() statement). The PML manual devotes less than a page (p38-39, 'Survival models') to the topic, mostly summarizing the math behind the method, rather than how to use it. There's a rather cryptic example elsewhere of an IV drug with concentration-dependent hazard, but there's so little data, it's not obvious how it all works.

 

Specifically, I'm running 6.3 on Win7. I'm finding it a challenge because the initial estimates tab spawns a bunch of NLME children that never terminate. I see the same issue when I try to just simulate (not fit) my model.

 

Anyone got any tips on how to get through this roadblock (you were all very helpful some months ago when I was trying to get my head around the LL function)

 

Thanks,

 

-Frank


  • Zacharysaund likes this

#2 Samer Mouksassi

Samer Mouksassi

    Advanced Member

  • Val_Members
  • PipPipPip
  • 90 posts

Posted 11 July 2013 - 04:08 PM

Hi Frank,

the event statement will automatically add the required integrations of the hazard behind the scenes.

 

All that you need to specify is the event flag 1/0 and the time to event or time to censor in the case that the event did not happen.

 

It is optional to have a joint continuous (PK) / time to event model as shown in the documentation.

 

 

I got time to event working in several applications.

It will be helpful to share with us more about your specific case to be able to help.

 

Note that currently simulation does not support time to event model automatically. However, you can write code that will enable you to simulate categorical or time to event models.

 

Regards,

 

Samer



#3 Frank Gibbons

Frank Gibbons

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationBoston area, Massachusetts

Posted 11 July 2013 - 04:32 PM

Hi Samer,

Thanks for responding, and I'm glad to hear that you've managed to get it to work. My problem is perhaps mostly that I need to be able to play with a working example, in order to fully understand it, and the examples in the documentation are not near complete. It doesn't help that I'm unable to play with the Initial Estimates or run Simulation of even the simplest model (PHX stalls on the last iteration, forever).

Specifically, I'm trying to model time for tumor to reach a certain size. Once they exceed the IACUC (institutional animal care and use committee) limit, they're sacrificed (i.e., censored). I'd like to capture that, then investigate it using covariates, such as dose, concentration, etc. Preparing the data is not a problem, I understand how that's structured (with the flags, etc.)

Note that currently simulation does not support time to event model automatically. However, you can write code that will enable you to simulate categorical or time to event models.


I didn't understand this - do you mean that in order to simulate a time-to-event model, I need to add something over and above what's required to fit it? (I know that the event() statement causes addition of some 'hidden' time-equations to integrate the hazard, as you mentioned earlier.)

Do you have a small working example that you could share, so I have something to play with? I'd really appreciate it!

Thanks.

-Frank

#4 Linda Hughes

Linda Hughes

    Advanced Member

  • Val_Members
  • PipPipPip
  • 73 posts

Posted 11 July 2013 - 06:53 PM

Hi Frank,

 

Your first post mentions pages 38-39 of the PML guide. Did you find the examples of event on pages 57 and 62?

 

Linda



#5 Linda Hughes

Linda Hughes

    Advanced Member

  • Val_Members
  • PipPipPip
  • 73 posts

Posted 11 July 2013 - 09:24 PM

Also, could you attach a project, or send one to Pharsight Support, that will show these issues you are reporting?:

"the initial estimates tab spawns a bunch of NLME children that never terminate. I see the same issue when I try to just simulate (not fit) my model."

"I'm unable to play with the Initial Estimates or run Simulation of even the simplest model (PHX stalls on the last iteration, forever)."

 

Linda



#6 Frank Gibbons

Frank Gibbons

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationBoston area, Massachusetts

Posted 11 July 2013 - 09:26 PM

Hi Linda,

 

Thanks for reaching out. Yes, I've played with those samples a bit, and in fact, these are the ones I found it impossible to either simulate or get to the Initial Estimates tab. When I try to simulate, it seems to get hung up on 'generating plots', and when I try to look at the Initial Estimates tab, I find myself contemplating the 'blue donut'. (I understand that the estimates tab runs a quick simulation, so these are problem two facets of the same problem.)

 

Like I mentioned, I'm running PHX 6.3 on Win7/Core i5, and using the Laplacian engine (population mode). Same result if I run single CPU or enable MPI (four cores).

 

Not really sure how to move forward, or how to diagnose the problem - I don't get any errors, I just get an NLME process that won't quit. I've been a user for about two years, so I'm fairly confident I'm not doing something really silly (famous last words! ;-)

 

Has anyone managed to get either example running, and would you be prepared to share the project on the forum? I may have hooked things up wrong, though it did seem pretty simple conceptually.

 

Thanks,

 

-Frank



#7 Samer Mouksassi

Samer Mouksassi

    Advanced Member

  • Val_Members
  • PipPipPip
  • 90 posts

Posted 15 July 2013 - 04:44 PM

Dear Frank, Attached is an example project showing how you can get simple survival fits in nlme. I also included and R connect object showing that both software reach the same estimates. The weibull fit shows you how to use LL statement. Regards, SamerAttached File  TimeToevent.phxproj   2.91MB   430 downloads


Edited by Simon Davis, 16 February 2015 - 12:39 PM.
corrected attachment link.


#8 Frank Gibbons

Frank Gibbons

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationBoston area, Massachusetts

Posted 15 July 2013 - 06:16 PM

Hi Samer,

 

Thanks a million for sending along that project, with not one but several examples inside! I can confirm that I have the same difficulties with your models as I had with my own (initial estimates stalls). I've submitted a support request to Pharsight, who confirm that they see the same behavior, hope to have a work-around shortly.

 

Just out of interest, what kind of system are you using: Windows version? Phoenix version? etc.

 

Thanks again,

 

-Frank



#9 Samer Mouksassi

Samer Mouksassi

    Advanced Member

  • Val_Members
  • PipPipPip
  • 90 posts

Posted 15 July 2013 - 07:07 PM

Dear Frank,

 

Please note that I can load the initial estimates tab and I can view the

Hazard vs time and Survival versus time and both change when I change lambda and or the shape parameters.

You need to ask that something that is function of time to be able to see something useful in this tab.

 

 

I am using the latest released Phoenix under windows 64 -bit

 

Regards,

Samer



#10 Frank Gibbons

Frank Gibbons

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationBoston area, Massachusetts

Posted 15 July 2013 - 07:33 PM

Hi Samer,

Just got word from Pharsight, that this issue has no work-around in PHX 1.3, will be flagged for fix in next release. ;-(

Not to be pedantic Samer, but when you say "latest released Phoenix under windows 64-bit", this is what I have, are you using the same?

Thanks,

-Frank Posted Image

Attached Thumbnails

  • PHX_logo.png


#11 Samer Mouksassi

Samer Mouksassi

    Advanced Member

  • Val_Members
  • PipPipPip
  • 90 posts

Posted 15 July 2013 - 07:41 PM

Dear Frank,

I am using exactly the same build as yours.

Note that I work in Pharsight Consulting Group and we use the same builds that everyone uses.

 

Not sure what is your problem I will contact Linda offline to know more.

 

The current build are not designed to allow simulations ( simulation or predictive check ) with time to event / censoring / categorical endpoints. On the other hand I tried to show you how you can get these models to fit in NLME.

 

Thank you for your feedback this will help us improve NLME.

 

Regards,

 

Samer



#12 Loan Pham

Loan Pham

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 16 July 2013 - 06:23 PM

Dear Frank and Samer,

 

I am curious and just wanted to see if I got the same problem and yes, the Initial Estimate stalls before I can "view the Hazard vs time and Survival versus time and both change when I change lambda and or the shape parameters."

Probably I missed something here since it sounds simple. Please get me posted.

 

Thanks,

 

Loan



#13 Frank Gibbons

Frank Gibbons

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationBoston area, Massachusetts

Posted 16 July 2013 - 06:27 PM

Well, it's nice to have company Loan

 

;-|



#14 Samer Mouksassi

Samer Mouksassi

    Advanced Member

  • Val_Members
  • PipPipPip
  • 90 posts

Posted 16 July 2013 - 06:58 PM

You need to be in closed form mode and using LL statement in my project I had several examples one used the LL statement



#15 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,318 posts

Posted 16 July 2013 - 07:12 PM

Loan
Regarding your private email to me about the required password for this file; if you're using IE in particular as your browser it "helpfully" renames the PHXPROJ file to Zip (since it is in fact a compressed file). Just download the file then rename the extension back to xxx.PHXPROJ and then you should be fine to open it up in Phoenix usually. I use Firefox and I don't have this problem, nor does Chrome etc.

To see an example of the initial estimates tab please try to see something versus time on e.g. the fitSurvWB model

Posted Image

(but yes the initial estimate tab is not handling categorical models as well as I'd like, it's noted already for improvement).

Simon

Attached Thumbnails

  • fitSurvWB.jpg


#16 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 16 July 2013 - 07:13 PM

Dear Loan

Good to see you on the forum. It is indeed a great way to interact. When you are using LL statement or any categorical type of response, you should not click on initial estimates. The program will try to simulate the response that is categorical when the tools are not there to do so and you will be stuck. This is my experience so far.

best

Serge



#17 Loan Pham

Loan Pham

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 16 July 2013 - 07:23 PM

Dear Simon,

 

Thanks so much for your response.

I got it work right after I got a message saying that you are taking PTO :). and that was the moment I found myself stuck forever when clicked on initial estimates.

 

Dear Serge,

 

Yes, it is always very nice to hear from you also. I am glad that Bernd told me that I should go to "our lively discussion" , the place that for some reason I forgot. Wait and see how much I will learn from our forum :D.

 

Warm regards,

 

Loan



#18 Shu-Pei Wu

Shu-Pei Wu

    Member

  • Members
  • PipPip
  • 26 posts

Posted 07 July 2014 - 03:46 PM

Dear Serge,

 

First to thank for providing this very useful file for me to work on.

I am new for TTE modeling and have some naive questions regarding to the coding part.

 

1. covariate(Treatment(),Time).

    What is the parenthesis after treatment doing? can I only write covariate(Treatment, Time)?

 

2. stparm(LAM = exp( Treatment==1 ? tvLAM : (tvLAM+ Treatment2 ) ) )

 

      What is function of the "?" and " : " here?

 

3. CUMHAZ=(1/(LAM^SHAPE) )*(Time^SHAPE)

 

    I assume the reciprocal is to get a negative sign since the LAM was defined as exponential?

 

4. What is the argument for event() and LL() function?

     event(flag,1/exp(LAM) )

     LL(flag,flag==1 ? log(S*HAZNOW) : log(S) )

 

Thank you very much,

 

Shu-Pei



#19 Cornelia Preusse

Cornelia Preusse

    Member

  • Members
  • PipPip
  • 13 posts

Posted 12 February 2015 - 10:29 AM

Dear Frank, Attached is an example project showing how you can get simple survival fits in nlme. I also included and R connect object showing that both software reach the same estimates. The weibull fit shows you how to use LL statement. Regards, Samer [file name=TimeToevent.phxproj size=3051908]http://pharsight.com/extranet/media/kunena/attachments/legacy/files/TimeToevent.phxproj[/file]

Hello Samer, I just asme across your example with the TTE model. By transferation to the new webside the attachment got lost. Could you post your example again ? Or could any of the moderators make the attachment accessable again ?

 

<DONE! see Above, Simon>


Edited by Simon Davis, 23 February 2015 - 10:51 PM.


#20 smouksassi1

smouksassi1

    Advanced Member

  • Members
  • PipPipPip
  • 231 posts
  • LocationMontreal

Posted 18 March 2015 - 12:00 AM

Dear Serge, First to thank for providing this very useful file for me to work on. I am new for TTE modeling and have some naive questions regarding to the coding part. 1. covariate(Treatment(),Time). What is the parenthesis after treatment doing? can I only write covariate(Treatment, Time)? 2. stparm(LAM = exp( Treatment==1 ? tvLAM : (tvLAM+ Treatment2 ) ) ) What is function of the "?" and " : " here? 3. CUMHAZ=(1/(LAM^SHAPE) )*(Time^SHAPE) I assume the reciprocal is to get a negative sign since the LAM was defined as exponential? 4. What is the argument for event() and LL() function? event(flag,1/exp(LAM) ) LL(flag,flag==1 ? log(S*HAZNOW) : log(S) ) Thank you very much, Shu-Pei

 

Dear Serge, First to thank for providing this very useful file for me to work on. I am new for TTE modeling and have some naive questions regarding to the coding part. 1. covariate(Treatment(),Time). What is the parenthesis after treatment doing? can I only write covariate(Treatment, Time)? 2. stparm(LAM = exp( Treatment==1 ? tvLAM : (tvLAM+ Treatment2 ) ) ) What is function of the "?" and " : " here? 3. CUMHAZ=(1/(LAM^SHAPE) )*(Time^SHAPE) I assume the reciprocal is to get a negative sign since the LAM was defined as exponential? 4. What is the argument for event() and LL() function? event(flag,1/exp(LAM) ) LL(flag,flag==1 ? log(S*HAZNOW) : log(S) ) Thank you very much, Shu-Pei

Treatment() this tells the software that Treatment is a categorical covariate.

this is a quick and elegant way of having a conditional statement


 stparm(LAM = exp( Treatment==1 ? tvLAM : (tvLAM+ Treatment2 ) ) ) 

this is telling the software :

if Treatment==1
 LAM = tvLAM
ELSE  

LAM =(tvLAM+ Treatment2 ) ) 

you can check the PML modeling guide for more information

 

 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users