User-defined logistic model PML example
This example illustrates a repeated measures logistic response. It is adapted from a logistic example in the NONMEM archives. The data consist of the number of successes in 1000 simulated trials at a given dose.
Data
The subject data are contained in an ASCII file (*.dat). The headers and the first subject data read as follows:
logistic1000a.dat
## id dose frac ntrial
1 0.200000 0.269010 1000
1 0.600000 0.499010 1000
1 1.000000 0.625010 1000
1 1.400000 0.690010 1000
1 1.800000 0.735010 1000
Column mappings
The ASCII file containing column mappings reads as follows.
colslogistic.txt
id(id)
covr(dose <- dose)
covr(ntrial <- ntrial)
obs(cObs <- frac)
The model
The PML model file reads as follows.
logistic.mdl
logist2(){
covariate(dose,ntrial)
fixef(
gamma=c(0, 1,)
tvd50=c(0, 1,)
)
ranef(
diag(neta1)=c(0.1)
)
stparm(
d50=tvd50*exp(neta1)
)
a=gamma*log(dose/d50)
prob=exp(a)/(1+exp(a))
#note cObs is the fraction of successes observed in ntrial
#trials - corresponding count is ntrial*cObs
LL(cObs, ntrial*cObs*log(prob)+ntrial*(1-cObs)*
log(1-prob))
}
NONMEM control file
The equivalent model, written as a NONMEM control file (*.ctl), would read as follows.
$PROB Repeated measures logistic response
$DATA logistic1000a.dat
$INPUT ID DOSE DV NT
$PRED
GAMMA=THETA(1)
D50=THETA(2)*EXP(ETA(1))
LDOS= LOG(DOSE)
A=GAMMA*LDOS-GAMMA*LOG(D50)
B=EXP(A)
P=B/(1+B)
Y=-2*NT*(DV*LOG(P)+(1-DV)*LOG(1-P))
$THETA (0,1.) (0,1.)
$OMEGA .1
$EST NOABORT METH=1 LAPLACE -2LL PRINT=1
$COV
Legal Notice | Contact Certara
© Certara USA, Inc. All rights reserved.