[NMusers] RE: question about random seed for simulation

From: Åstrand, Magnus <Magnus.Astrand_at_astrazeneca.com>
Date: Thu, 9 Mar 2017 20:04:25 +0000

Hi Penny,
I suspect you are right in your conclusion that number of records for each =
id matters in this case.
My solution to your problem would be to add columns for IIV to your dataset=
 outside of NONMEM.
Quite easily done in R.

Use the rmvnorm R function to simulate your etas, 600 rows times as many et=
as you have

require(mvtnorm)
sigma<-diag(c(1,2,3)) ## example 3 etas , without block, variances 1,2 and =
3
Etas<-rmvnorm(600,sigma=sigma)
colnames(Etas)<-paste("ETAr",1:ncol(Etas),sep="")

Then load your NONMEM datafile as is now with dosing and observational reco=
rds,

d0<-read.table(.....)

Match each of the rows in Etas to ID in your data

Etas2<-Etas[as.numeric(factor(d0$ID)),]

and then append the simulated etas

d1<-cbind(d0,Etas2)

and then finaly save the d1 R data.frame as a text file using write.table.


In your nonmem code you the just replace eta(1) with ETAR1, and so on.

BW

Magnus Åstrand
Principal Clinical Pharmacometrician, Ph.D.
___________________________________________________________________________=
__________________

AstraZeneca
Innovative Medicines | Quantitative Clinical Pharmacology
SE-431 83 Mölndal, Sweden
T: +46 (0)31 776 23 41
Mob: +46 (0)708 467 667
magnus.astrand_at_astrazeneca.com

Please consider the environment before printing this e-mail


From: owner-nmusers_at_globomaxnm.com [mailto:owner-nmusers_at_globomaxnm.com] On=
 Behalf Of Zhu, Penny
Sent: den 9 mars 2017 19:19
To: nmusers_at_globomaxnm.com
Subject: [NMusers] question about random seed for simulation

Dear All
I have finished a multiple dose simulation for 600 subjects and want to per=
form a single dose simulation (different sampling time) on the same subject=
s (same ETA as the first simulation). I used the same seed for the simulat=
ion step, it turned out the first subject was the same and the rest of the =
subjects are not and I am not sure whether this was due to the fact that th=
e two simulation has different number TIME records. If so, I wonder what i=
s the proper way to set the simulation seed so that the ETAs for the second=
 simulation will be identical to the first one.

I know that I could output the individual parameter estimate from the first=
 simulation and import them into the second one. But I was thinking if the=
 random seed can be synchronized between the two simulation, it could be an=
 easier solution.

Your help is very much appreciated!

Thank you very much and best regards!

Penny (Peijuan) Zhu, Ph.D.
Associate Director Clinical Pharmacology

Cell: 862-926-9079

PD Bio-Pharma CDMA
Sandoz
1N025, 100 College Road West
Princeton, NJ 08540



________________________________

Confidentiality Notice: This message is private and may contain confidentia=
l and proprietary information. If you have received this message in error, =
please notify us and remove it from your system and note that you must not =
copy, distribute or take any action in reliance on it. Any unauthorized use=
 or disclosure of the contents of this message is not permitted and may be =
unlawful.


Received on Thu Mar 09 2017 - 15:04:25 EST

This archive was generated by hypermail 2.3.0 : Fri Sep 27 2019 - 16:54:11 EDT