Jump to content


Photo

how to deal with values above the upper limit of quantification ?


  • Please log in to reply
7 replies to this topic

#1 glenngauderat

glenngauderat

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 11 April 2018 - 09:06 AM

Hello,

My question is in the title.

 

How to model right censored data in the textual mode ? 

 

Thanks. 

 

Best regards. 


  • isowend and Henryinvic like this

#2 glenngauderat

glenngauderat

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 11 April 2018 - 09:07 AM

Sorry i forgot to specify in phoenix NLME 6.4. 

 

Thanks



#3 smouksassi1

smouksassi1

    Advanced Member

  • Members
  • PipPipPip
  • 231 posts
  • LocationMontreal

Posted 11 April 2018 - 02:38 PM

Sorry i forgot to specify in phoenix NLME 6.4. 

 

Thanks

 

Hi genngauderat,
Phoenix textual mode enables you to use the Phoenix modeling language pml to write down your likelihood:

for example, suppose you want to tell it that if EOBS was above ULQ you want the portion of the integral above the ULQ.

and if not you want the normal likelihood:

PML has the LL statement and also the handy phi and lnorm functions :

LL(EObs

                ,  (EObs >= ULQ 
                                ?   log(1-phi( nUOQ )) 
                                :    lnorm( EObs - E, stdev)
                               )
                )

 

lnorm implement the normal distribution log likelihood while phi is the cumulative distribution function of a normal distribution. Your response should be normalized to usually within the code you do something like this

 

# upper limit of quantification
ULQ=1000
stdev=cv*E
covariate(EObscovariate)
# normalized response to nomral 0-1
nE=(EObscovariate - E)/stdev 
fixef(cv=c(,0.1,))
nUOQ=(ULQ-E)/stdev

All these models are sometimes called tobit models and the likelihood definition is well known you just need to learn how to code it in pml or other programming languages:
...

 

 
  • glenngauderat likes this

#4 glenngauderat

glenngauderat

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 11 April 2018 - 02:51 PM

 

Hi genngauderat,
Phoenix textual mode enables you to use the Phoenix modeling language pml to write down your likelihood:

for example, suppose you want to tell it that if EOBS was above ULQ you want the portion of the integral above the ULQ.

and if not you want the normal likelihood:

PML has the LL statement and also the handy phi and lnorm functions :

LL(EObs

                ,  (EObs >= ULQ 
                                ?   log(1-phi( nUOQ )) 
                                :    lnorm( EObs - E, stdev)
                               )
                )

 

lnorm implement the normal distribution log likelihood while phi is the cumulative distribution function of a normal distribution. Your response should be normalized to usually within the code you do something like this

 

# upper limit of quantification
ULQ=1000
stdev=cv*E
covariate(EObscovariate)
# normalized response to nomral 0-1
nE=(EObscovariate - E)/stdev 
fixef(cv=c(,0.1,))
nUOQ=(ULQ-E)/stdev

All these models are sometimes called tobit models and the likelihood definition is well known you just need to learn how to code it in pml or other programming languages:
...

 

 

 

 

OK so unlike for LOQ I have to code my own LL statement.  Thank you very much for your help ! 



#5 glenngauderat

glenngauderat

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 12 April 2018 - 10:10 AM

Sorry to bother you again but I have some troube understanding this code. 

 

I have never tried to code my own LL statement in NLME and there is litte explanation on the LL statement and the language in the NLME user guide. 

 

In NONMEM it could be done like this : 

 

LOQ=6
STD=W
IF(ALQ.EQ.0) THEN ;
F_FLAG=0
Y=IPRED+ERR(1)*W
ENDIF 
IF(ALQ.EQ.1) THEN ;
DUM=(IPRED-LOQ)/STD      
the difference with LOQ is there , for lefts sensored data it would have been : DUM=(LOQ-IPRED)/W. 
CUM=PHI(DUM)
F_FLAG=1
Y=CUM
MDVRES=1
IRES = 0
IWRES=0
ENDIF        
 
 
I would like to get the equivalent code in NLME ,  with the possibility to use a flag column to specify is the data is censored or not .
This is because I have in my dataset some values quantified above the ULQ ( because they have been diluted and re-assayed). 
 
Could you provide an example for that with an additive residual error ? 
 
 
Also I dont understand the "covariate(EObscovariate)" statement in your code. Could you explain what it is ? 
 
 
Thanks 
 
Regards. 


#6 smouksassi1

smouksassi1

    Advanced Member

  • Members
  • PipPipPip
  • 231 posts
  • LocationMontreal

Posted 16 April 2018 - 06:39 PM

Hi 
your nonmem code has a fixed LOQ and it uses an ALQ flag that you included in your data and that you defined in 

$INPUT 
ALQ =0 no ALQ if ALQ =1 then the obs is indeed ALQ in phoenix code above we test within the code if EObs is above ALQ but if you have a flag ALQ you can use it

 

the same code in phoenix would be:

 

# upper limit of quantification
LOQ=6
stdev=Ceps*W
DUM=(E-LOQ)/stdev# E is your IPRED

 

LL(EObs

                ,  (ALQ == 0 
                                ?    lnorm( EObs - E, stdev) # this is the "normal" observation LL
                                :   log(phi( DUM)) # note that 1 - phi (x) = phi (-x)
                               )
                )

 

 

# no need to test for ALQ = 1 since here we only have two conditions.

 

 

To be able to really help we need a full project with some dummy data and model


  • glenngauderat likes this

#7 glenngauderat

glenngauderat

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 17 April 2018 - 03:28 PM

Hi 
your nonmem code has a fixed LOQ and it uses an ALQ flag that you included in your data and that you defined in 

$INPUT 
ALQ =0 no ALQ if ALQ =1 then the obs is indeed ALQ in phoenix code above we test within the code if EObs is above ALQ but if you have a flag ALQ you can use it

 

the same code in phoenix would be:

 

# upper limit of quantification
LOQ=6
stdev=Ceps*W
DUM=(E-LOQ)/stdev# E is your IPRED

 

LL(EObs

                ,  (ALQ == 0 
                                ?    lnorm( EObs - E, stdev) # this is the "normal" observation LL
                                :   log(phi( DUM)) # note that 1 - phi (x) = phi (-x)
                               )
                )

 

 

# no need to test for ALQ = 1 since here we only have two conditions.

 

 

To be able to really help we need a full project with some dummy data and model

Hi,

 

Thanks again. 

 

OK I get the meaning of "lnorm", "?" and ":" now. Thank you.

 

But what if we have a more complex situation? 

 

Here is an example of data  with C1 beeing left censored, and C2 right censored. 

C2 is right sensored above 100 for some measurment but not always and some times the ULQ is just higher (150).

 

There are three models, one with an additive RUV, one with a proportional RUV and one with a combined additive prop error. 

 

Thank you very much !

Attached Files



#8 smouksassi1

smouksassi1

    Advanced Member

  • Members
  • PipPipPip
  • 231 posts
  • LocationMontreal

Posted 17 April 2018 - 03:40 PM

Hi,

 

Thanks again. 

 

OK I get the meaning of "lnorm", "?" and ":" now. Thank you.

 

But what if we have a more complex situation? 

 

Here is an example of data  with C1 beeing left censored, and C2 right censored. 

C2 is right sensored above 100 for some measurment but not always and some times the ULQ is just higher (150).

 

There are three models, one with an additive RUV, one with a proportional RUV and one with a combined additive prop error. 

 

Thank you very much !

 

to answer you quickly (without opening your project)

you can have multiple LL statements

 

LL(EObs1

                ,  (ALQ2 == 0 
                                ?    lnorm( EObs - E, stdev) # this is the "normal" observation LL
                                :   log(phi( DUM)) # note that 1 - phi (x) = phi (-x)
                               )
                )
 
 

LL(EObs2

                ,  (ALQ2 == 0 
                                ?    lnorm( EObs - E, stdev) # this is the "normal" observation LL
                                :   log(phi( DUM)) # note that 1 - phi (x) = phi (-x)
                               )
                )

where you can have EObs2 LL censoring on the left instead of on the right.

 

each LL and endpoint can have its own error model

 

If the LOQ and or ALQ level is not the same for all observations then you can map it as a covariate that changes with observation and then your DUM calculation will take this into account so we integrate up to or form to the correct threshold.

 

Samer






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users