$PROB Minto Empiric Model ; Using YIND (Bayesian) ;1 react to shake and shout 2 no react to shake and shout; 3 no react to int. $DATA binary.csv $INPUT ID DROP=TCIR REMI DROP=TCIP PROP INT=DV $PRED RC501=THETA(1)*EXP(ETA(1)) PC501=THETA(2)*EXP(ETA(2)) RC502=RC501 ; same Remi C50 for LOC and intubation TEMP=THETA(3)*EXP(ETA(3)) ; Toss out independent remi c50 for intubation, as it doesn't improve fit. PC502=THETA(4)*EXP(ETA(4)) ; Covariance of LOC and TOL B1=THETA(5)*EXP(ETA(5)) B2=THETA(6)*EXP(ETA(6)) SLOPE=THETA(7)*EXP(ETA(7)) ;protection ; The following if statements check for too large or too small parameters. prevents bad NONMEM crashes. ; NOABORT needed in $EST IF (RC501.LT.0.00001 .OR. RC501.GT.10000.) THEN EXIT ENDIF IF (PC501.LT.0.00001 .OR. PC501.GT.10000.) THEN EXIT ENDIF IF (RC502.LT.0.00001 .OR. RC502.GT.10000.) THEN EXIT ENDIF IF (PC502.LT.0.00001 .OR. PC502.GT.10000.) THEN EXIT ENDIF ;Equations ; Normalize to potency UR1=REMI/RC501 UP1=PROP/PC501 UR2=REMI/RC502 UP2=PROP/PC502 ; Compute "theta" (Q) for Minto interaction model IF(UR1.EQ.0.AND.UP1.EQ.0) THEN Q1 = 0 ELSE Q1=UP1/(UR1+UP1) ENDIF IF(UR2.EQ.0.AND.UP2.EQ.0) THEN Q2 = 0 ELSE Q2=UP2/(UR2+UP2) ENDIF ; Compute C50 Function U501=1-B1*Q1+B1*Q1*Q1 U502=1-B2*Q2+B2*Q2*Q2 ; compute "concentration" normalized to potency and corrected for interaction U1=(UR1+UP1)/U501 U2=(UR2+UP2)/U502 ; Apply slope term UN1 = U1**SLOPE UN2 = U2**SLOPE ; Compute each probability P1 = UN1/(1+UN1) P2 = UN2/(1+UN2) ;IF (P1.LT.P2) EXIT 1 ;Combine probababilities IF (INT.EQ.1) THEN Y= (1-P1)*(1-P2); probability of response to shaking * probability of response to intubation ENDIF IF (INT.EQ.2) THEN Y= P1*(1-P2); probability of non-response to shaking * probability of response to intubation ENDIF IF (INT.EQ.3) THEN Y= P1 * P2; probability of non-response to shaking * probablity of non-respose to intubation ENDIF ;Probability of responding to shaking, but not responding to intubation. This ;will never happen, but is added here so that someone reading the code can verify ;that the sum of the probabilities for all possible states is 1. IF (INT.EQ.4) THEN Y= (1-P1) * P2; probabilities of response to shaking * probability of non-response to intubation ENDIF $THETA (5,20,30) ; ec50 remi LOC and int (1,1.62,4) ; ec50 prop LOC 0 FIX ; ec50 remi int (1,3.15,20) ; ec50 prop int (0,2.56,4) ; interact LOC - statistically significant (0,1.35,4) ; interact int - not statistically significant in NPD fit, but retains significance (Delta LL=6) in MEM fit (.1,5.09,10) ; gamma both (tried separate gamma values for propofol, remi, not significant) $OMEGA .260 .225 0 FIX 0 FIX .00119 .000343 0 FIX $ESTIMATION SIG=6 MAX=2000 PRINT=5 NOABORT METHOD=1 LAPLACE LIKELIHOOD $COVARIANCE