Jump to content


Photo

Simulation from journal article


  • Please log in to reply
11 replies to this topic

#1 Elliot Offman

Elliot Offman

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 13 June 2014 - 04:14 PM

Dear M&S moderators.

Attempting to simulate some data from a journal article but I'm missing something in my code. I've done this before with my own models but I haven't tried to build one from literature.

Clearly doing something wrong.

 

can you check my project file. Also specifically want to make sure I'm putting in the covariate code properly...the paper used Nonmem and I'm not sure i'm coverting properly to NLME parlance.

thanks

elliot [file name=Bevacizumab_sim_Lu_2008.phxproj size=753849]http://www.pharsight.com/extranet/media/kunena/attachments/legacy/files/Bevacizumab_sim_Lu_2008.phxproj[/file]

Attached Files



#2 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,316 posts

Posted 16 June 2014 - 09:15 AM

Elliott,
If you select the general tab then it will display any syntax errors in textual mode (I often temporarily put my graphical models into this mode to highlight anything I've forgotten)

In your case there is an extra comma on line 21 where you set the estimate for Volume.

Posted Image

Removing that comma meant it ran but I haven't looked any further as I am unfamiliar with the paper you mention.

If you still have some problems please can you post the paper and/or NM code you are looking to replicate.

Best regards, Simon.

Attached Thumbnails

  • comma.jpg


#3 Elliot Offman

Elliot Offman

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 16 June 2014 - 12:19 PM

Hi Simon,
I should have attached the updated project file..as I did fix those syntax errors.

Here is a copy of the code. In a previous set of postings Serge Guzy suggested that one could simulate a distribution of body weights in the model code, thus simplifying the input template worksheet.

So I was attempting to integrate this into the simulation.
Another question I have is if the dose is to be a ug/kg then should all the fixed effect typical values be normalized (where applicable) by body weight as well, or is there a means of coding this in the text?
I can get it to work as a built-in model when I use R to generate my weight distribution and include it in the simulation template worksheet but would like to be able to do this in 1 step instead of 2 and Serge suggested it was possible.

So the dose is 3 mg/kg (3000 ug/kg since my CObs is ug) and duration of infusion is 1.5 hours as a fixed infusion time.

test(){
deriv(A1 = - (Cl * C)- (A1 * K12- A2 * K21))
urinecpt(A0 = (Cl * C))
deriv(A2 = (A1 * K12- A2 * K21))
C = A1 / V
dosepoint(A1, duration = (1.5), idosevar = A1Dose, infdosevar = A1InfDose, infratevar = A1InfRate)
error(CEps = 1)
observe(CObs = C + CEps * (1 + C * CMixRatio))
stparm(V = tvV * (Weight/median(Weight))^dVdWeight * (1+dVdGender0*(Gender==0)) * exp(nV))
stparm(Cl = tvCl * (Weight/median(Weight))^dCldWeight * (1+dCldGender0*(Gender==0)) * exp(nCl))
stparm(K12 = tvK12)
stparm(K21 = tvK21)
stparm(CMixRatio = tvCMixRatio)
covariate(Gender())

stparm(Weight=tvWeight*exp(nWeight)) #here I am attempting to define Weight as a distribution with a mean of 70 kg and CV of 30%.
fixef(tvWeight= c(,70,))
ranef(diag(nWeight)=c(0.09))

fixef(tvV = c(, 2660, ))
fixef(tvCl = c(, 8.625, ))
fixef(tvK12 = c(, 0.00929, ))
fixef(tvK21 = c(, 0.00896, ))
fixef(tvCMixRatio = c(, 0.0236, ))
fixef(dVdGender0(enable=1) = c(, 0.221, )) # can I delete this "enable=..."?
fixef(dCldGender0(enable=2) = c(, 0.207, ))
fixef(dVdWeight(enable=4) = c(, 0.411, ))
fixef(dCldWeight(enable=8) = c(, 0.368, ))
ranef(diag(nV, nCl) = c(0.0676, 0.0282))
}

#4 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 16 June 2014 - 04:22 PM

Dear Elliott

I corrected your model.

You had some syntax error and also use of mix error model which is not good when doing simulations (too easy getting negative observed concentrations).

Please look at it and especially at the sim table I generated and let me know if all is clear. I do not see nay problem with the model.

best

Serge [file name=Bevacizumab_sim_Lu_2008-20140616.phxproj size=3432234]http://www.pharsight.com/extranet/media/kunena/attachments/legacy/files/Bevacizumab_sim_Lu_2008-20140616.phxproj[/file]

Attached Files



#5 Elliot Offman

Elliot Offman

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 16 June 2014 - 04:52 PM

Thanks Serge,

my main question is given my dose is in mg/kg, how are the clearnace and volume typical values best entered in text.

since the actual dose is 3000 ug/kg and typical values are reported as absolute values not wieght normalized. does it make more sense to enter in the code the typical value divided by the median weight so the concentrations are reported in ug/mL?

 

or would u simply take the simulation output and multiply by concentration x weight and use that for your next steps (e.g. plotting, NCA etc...)

Elliot



#6 Samer Mouksassi

Samer Mouksassi

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts

Posted 16 June 2014 - 06:18 PM

my two cents here:

in POP PK always use the real total dose not the mg/kg

this will give you parameters in units like

CL: L/h

Volume : L

 

etc.

 

then you can model and see the relationship between CL ,volume and weight or other covariates

 

in the model fit instead of having dose like:

 

 3000 ug/kg compute the actual total dose given ( since you know weight) and then use that as dose input and weight as a covariate

 

ofthen time the weight enter the CL equation in a nonlinear ( power model) fashion so simply diving CL/WT is mis informative

 

Samer



#7 Elliot Offman

Elliot Offman

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 16 June 2014 - 07:32 PM

sure for fitting I always use absolute dose but for simulating from a pre-set model?

 

For the simulation from a published model can you confirm that if I use dose/kg as input and weight as the covariate (in this case though Serge suggested simulating the distribution of weight), will that simulate concentrations which are weight normalized?

it seems that they are in the sim template.

 

What I am confused on is if I use weight as a covariate and dose/kg in the input can I just use the observed non-normalized volume and clearance typical values? It seems not since my dose is per kg and yet my clearace and volume are not.

.

You suggest that one should not do tihs...ok I see your point, but I am confused how to obtain concentrations then that make sense...

 

if I calculate the weight beforehand say using R, then its easy, just convert dose to absolute based on the simulated subjects weight...its doing it in one step as Serge suggested that has me stumped with respect to the units.

Thanks

 

Elliot



#8 Samer Mouksassi

Samer Mouksassi

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts

Posted 16 June 2014 - 09:06 PM

Hi Elliot,

 

Simulating the covariate and the mg/covariate dose within nlme is feasible but it was not designed to do so .

 

Iwill need to do some tests on how this works within nlme as I usually do these kind of sims in TS2 .

Trial Simulator (TS2) will let you simulate these kind of weight normalized dosing ( +adaptive dosing and much more eg dose go up and down if pk is high or low)

 

Bests,

 

Samer



#9 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 16 June 2014 - 09:43 PM

Dear Elliott

Here are some tips

 

1: When you go from normalized dose to absolute doses, do the following

 

Take the Volume used in the normalized domain and x by the average weight you used.

Here you had 70 kg

 

2: Do the same with Clearance

 

3: Take the power term you used in the covariate relationship that used weight and add 1 to the power term you sued in the normalized domain

If you do that, you will get good initial estimates in the absolute dose domain.

 

Try it and let me know.

 

This would work perfectly if the relationship had a power term of 0 in the normalized domain.

Would correspond to a power term of 1 in the absolute domain.

 

best

Serge



#10 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 16 June 2014 - 11:04 PM

Here is an example showing that using the 2 tricks made the job.
Last3 models.
1: simulation using covariate relationship and normalized dose
2: Fit using normalized dose
3: fit using absolute dose


You can see that that V and Cl in the absolute dosing domain are V in the normalized domin x 70 and same for Cl and the power term is power term in the normalized domain + 1 .

It will not be perfect because V and Cl distribution in both domain are different and if lognormal in the normalized domain may not be perfectly lognormal in the absolute.

Usually you do the other way around.

You start with absolute dose, put a covariate relationship and if you see that the power is 1, then it means that you can use normalized dose and the power will be around 0.

If the power is 0.75 in the absolute domain then it will be -0.25 in the normalized domain.

I hope it helps.
best
Serge [file name=Bevacizumab_sim_Lu_2008_serge_fit.phxproj size=3378562]http://www.pharsight.com/extranet/media/kunena/attachments/legacy/files/Bevacizumab_sim_Lu_2008_serge_fit.phxproj[/file]

Attached Files


Edited by Simon Davis, 17 May 2021 - 07:44 AM.


#11 veenu.bala

veenu.bala

    Member

  • Members
  • PipPip
  • 11 posts

Posted 26 April 2021 - 05:25 PM

Hello!

I am trying to do covariate based simulation and i am unable to see this added project. is there any permission required to download this project?

I really wanna see this. plz help.

 

Thanks

 

veenu



#12 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,316 posts

Posted 17 May 2021 - 07:45 AM

Veenu, please try now.  Simon.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users