18
Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Embed Size (px)

Citation preview

Page 1: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

Within Subject Random Effect Transformations with NONMEM

VI

B. Frame

9/11/2009

Page 2: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

Dynamic Transform Both Sides (TBS)

• What is TBS?

• Why bother with TBS?

• Brief History, Jacobians, and Likelihoods.

• Implementation and examples in NONMEM (V or VI)

Page 3: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

What is Transform Both Sides (TBS)?

Consider our usual set up: Yij = PRED(,)ij + ij

Where i indexes subject and j indexes the response

or prediction within subject i.

The assumption here is that ij ~ N(0,2)

In other words, the within subject variability does not depend on time, the PREDiction, or who the subject is (i).

Page 4: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

What is Transform Both Sides (TBS)?

Consider an invertible transformation T, with a domain compatible with what is being transformed (response and prediction)...

Then in general TBS is...

T( Yij)= T(PRED(,)ij)+ ij

Once again, the assumption here is that ij ~ N(0,2)

Page 5: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

What is Transform Both Sides (TBS)?

A simple example (no transformation parameter)

ln( Yij)= ln(PRED(,)ij)+ ij ; Yij>0, PRED(,)ij>0

A dynamic example (with )

0;0;11

ijijijij Y

PREDY

Page 6: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

Why Bother with TBS?

0 20 40 60 80 100

Prediction

-20

-10

010

2030

Res

idua

l

Non-constant within subject variance example

-2 0 2 4 6

050

100

150

200

Residual

Rightly Skewed Residuals

-5 0 5

010

020

030

0

Residual

Heavy Tailed (Leptokurtic) Residual Distribution

Page 7: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

Useful Resourceshttp://www.stat.uconn.edu/~studentjournal/index_files/pengfi_s05.pdf

Carroll Rupert (1988) Transformation and Weighting in Regression

Estimating Data Transformations in Nonliner Mixed Effect Models; Oberg and Davidian; Biometrics 56,65-72;March 2000.

Page 8: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

Transformations, Likelihoods and Jacobians.

Suppose we have a continuous random variable, X whose

logarithm is distributed N(, 2). Letting Y=ln(X) we know

that the density for Y is...

2

)2/()(

2)(

22

y

Y

eyf

Page 9: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

But What is the Distribution for X?

To find fX(x) when X=g(Y), and g is monotone, we use the following change of variable formula...

|))((|))(()( 11 xgdx

dxgfxf YX

Page 10: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

OK, so we turn the crank!

• X=g(Y) = exp(Y)

• Y=g-1(X) = ln(X)

• d/dX(g-1(X)) = 1/X

2

)2/())(ln(

2)(

22

x

exf

x

X

Page 11: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

Now lets Focus on the Dynamic Box-Cox TBS

0,,);,0(~11 2

ijijijij PREDYN

PREDY

11)(1

ijij

ijij

PREDYYgX

)1(

2

)2/()/)1(/)1((

2)(

22

ij

PREDy

ijY ye

yfijij

ij

Our assumption is that ...

)1(1 ))(( ijij

ij

yygdy

d

Let,

so

and

Page 12: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

Example

• A new ‘patch’ has been developed for bromodrosis.

• The T/2 is short and we have 7 steady state serum concentrations on each of 100 subjects.

• This may be the simplest possible PK example!

Page 13: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

Initial Model (CWS7.TXT)$PROBLEM$DATA NMDATA7.CSV$INPUT ID DV ; JUST ID AND SERUM CONCENTRATION!$PRED W=THETA(2) ;ADDITIVE SD CL=THETA(1)*EXP(ETA(1)) ;CL/F WITH BETWEEN SUBJECT VAR PRE=1/CL ;@ SS ASSUMING INPUT RATE = 1 4 ALL RES1=(DV-PRE)/W ;FORM A WITHIN SUBJECT RESIDUAL Y=PRE+EPS(1)*W

$THETA (0,.1) ;CL/F (0,1) ;SD ADDITIVE$OMEGA .1$SIGMA 1 FIX$EST MAXEVALS=9999 METH=1 PRINT=1 ; JUST BECAUSE!$COV PRINT=E$TABLE ID RES1 ONEHEADER NOAPPEND NOPRINT FILE=TWS7.TXT

Page 14: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

Graphics.

-1.6 -1.0 -0.5 0.0 0.6 1.1 1.6 2.2 2.7 3.3 3.8

RES1

0.0

0.1

0.2

0.3

0.4

0.5

Density for CWS7.TXT Within Subject Residual

Skewness = 1.05

Page 15: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

CWS7L.TXT / CWS7L1.TXT$SUB CONTR=CONTR.TXT CCONTR=CCONTRA.TXT$PRED W=THETA(2) ;SD CL=THETA(1)*EXP(ETA(1)) ;CL/F PRE=1/CL ;@ SS ASSUMING INPUT RATE = 1 LAM=THETA(3) ;BOX COX LAMBDA PARAMETER PREL=(PRE**LAM-1)/LAM ;TRANSFORMED PREDICTION Y=PREL+EPS(1)*W ;ADDITIVE WITHIN SUBJECT ERROR IN ;THE TRANSFORMED SPACE RES1=((DV**LAM-1)/LAM-PREL)/W ;RESIDUAL IN THE T SPACE$THETA (0,.1) ;CL/F (0,1) ;SD ADDITIVE (0,1) ;BOX COX LAMBDA PARAMETER$OMEGA .1 ; THIS INIT WORKS FINE WITH NMV NM6??$SIGMA 1 FIX$EST MAXEVALS=9999 METH=1 PRINT=1$COV PRINT=E$TABLE ID RES1 ONEHEADER NOAPPEND NOPRINT FILE=TWS7L.TXT

Page 16: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

CCONTRA.TXT subroutine ccontr (icall,c1,c2,c3,ier1,ier2) parameter (lth=40,lvr=30,no=50) common /rocm0/ theta (lth) common /rocm4/ y double precision c1,c2,c3,theta,y,w,one,two dimension c2(*),c3(lvr,*) data one,two/1.,2./ if (icall.le.1) return w=y y=(y**theta(3)-one)/theta(3) call cels (c1,c2,c3,ier1,ier2) y=w c1=c1-two*(theta(3)-one)*log(y) return end

Page 17: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

Regression Engine Bake Off

nmv nm6 nm6 init2

SD in Transformed

Space

1.9 2.1 2.1

0.24 0.27 0.26

CL/F 0.01 0.01 0.01

$COV Yes No Yes!

0.004 1E-5 0.004

Page 18: Wolverine Pharmacometrics Corporation Within Subject Random Effect Transformations with NONMEM VI B. Frame 9/11/2009

Wolverine Pharmacometrics Corporation

Last Slide

-3.2 -2.6 -2.1 -1.5 -0.9 -0.4 0.2 0.8 1.3 1.9 2.5

RES1

0.0

0.1

0.2

0.3

0.4

Density for Residual in T Space (nmv)

Skewness = -0.05Change in MOF = 187