Re: seeking help on NONMEM code for simulation of Repeated Time to Event Data
Hi Yaming,
In a general sense, the two things that you're wanting to do are likely
straight-forward with NONMEM.
For the dosing, as long as you're dosing at the same time and its the dose
amount that is changing, you can make F1 dependent on your event (e.g. to stop
dosing after the event, set F1 to 0; to double or halve dosing set it to 2 or
0.5). You can keep track of if the event happened by using an indicator
variable that is initialized on the first initialization of the subject. That
would be something like:
IF (NEWIND.EQ.1) EVNT=0
Then set EVNT=1 when your event happens (or more complex values, but using EVNT
values as your indicator).
To have the continual accumulation, you can use DES with a compartment that has
accumulation from a model parameter like the following:
$PRED
...
ACC=THETA(1)
...
$DES
DADT(4)=ACC
If you need to reset the accumulator compartment and the event happens at
arbitrary times, that is a bit more complex, and the best solution that I can
think of is to save the current accumulator amount into a variable when the
event happens and make your event dependent on the amount in the accumulator
compartment minus the amount at the previous event.
Thanks,
Bill
Quoted reply history
On Apr 3, 2013, at 5:17 PM, "Yaming Hang"
<[email protected]<mailto:[email protected]>> wrote:
Dear NONMEM Users,
I have some questions about how to accomplish the following tasks in NONMEM,
would you kindly share your experience with me or provide some suggestions? I’m
trying to make a simulation that involves dynamic dosing. Here is the algorithm
of simulation: at time 0, a dose is given, then the time to the first event
will be simulated based on a certain survival function which depends on the
drug exposure. Next, conditioning on that simulated first event time, a second
dose will be introduced, and again time to the second event will be simulated.
This will be repeated until a certain cut off time point.
My specific questions are:
1. since the dosing history will be depending on the simulated event time, I
cannot construct the dosing history in NONMEM data set a prior, how can this be
done?
2. The survival function is a function of the time-varying drug exposure,
therefore I need to inverse an integral which does not have a closed form (i.e.
only expressed in differential equation), how can I do that?
Your help will be much appreciated!
Yaming Hang