1.NONMEM control stream for the NIH Stroke Scale model

$PROBLEM Model for NIH Stroke Scale

$INPUT ID DAY NIH INH BNH IBNI PNH DV CHN TYP VIST=DROP FLAG

AGE DIU ALT=DROP TLS SEX=DROP WT=DROP RACE=DROP

HT=DROP BMI=DROP IND=DROP C2E=DROP DIC=DROP HEP=DROP

THR BB=DROP TIA=DROP KSA=DROP CAN=DROP ACE=DROP

CGL=DROP ANA=DROP ATA=DROP HYP=DROP ASA=DROP ASC=DROP

C3A=DROP ANG=DROP NEU=DROP AST=DROP TBI=DROP ALB=DROP

GGT=DROP ALK=DROP SED=DROP STUD

$DATA trans_nih100311.csv

IGNORE=@

$PRED

A2PNH=THETA(8)*PNH

DEPNH=THETA(9)*PNH

IMBNH=THETA(10)*BNH

A2TLS=THETA(11)*TLS

A1AGE=THETA(12)*(AGE-73)

A1COV=(A1AGE)

A2COV=(A2PNH+A2TLS)

A3COV=0

DECOV=(DEPNH)

IMCOV=(IMBNH)

TSS = DAY ; Time since stroke

; ------

; Linear model (type = 4)

; ------

RV = THETA(6)*EPS(1)

TVIM = THETA(4)

TVDE = THETA(5) ;

IM = IMCOV + TVIM + ETA(3) + RV

IF(DAY.GE.14) IM = IMCOV + THETA(16) + ETA(1) + RV

DE = DECOV + TVDE + ETA(4) + RV

IF(DAY.GE.14) DE = DECOV + THETA(5) + ETA(2) + RV

IMZ = EXP(IM)/(1+EXP(IM))

DEZ = EXP(DE)/(1+EXP(DE))

; ------

; Transforming IMZ/DEZ to "real"

; NIH score

; ------

NIM2 = (1 - IMZ) * (PNH + 1)

NDE = DEZ * (42 - PNH) + PNH

; ------

; Improvement/Decline (type = 1)

; ------

TVA1 = A1COV + THETA(1)

P1 = EXP(TVA1)/(1+EXP(TVA1))

; ------

; Max score (type = 2)

; ------

TVA2 = A2COV + THETA(2) ;

IF(DAY.GT.14.AND.DAY.LE.45) TVA2=A2COV+THETA(2)

IF(DAY.GT.45) TVA2=A2COV+THETA(15)

P2 = EXP(TVA2)/(1+EXP(TVA2))

; ------

; Dropout (type = 3)

; ------

TVNDE = A3COV + THETA(7)*NDE

TVA3 = THETA(3)*(1 + TVNDE)

IF(DAY.GT.14.AND.DAY.LE.45) TVA3=THETA(13)*(1 + TVNDE)

IF(DAY.GT.45) TVA3=THETA(14)*(1 + TVNDE)

P3 = EXP(TVA3)/(1+EXP(TVA3))

; ------

; Probabilities

; ------

P1A = P1 ; Improvement

P1B = 1-P1 ; Decline

P2A = P2 ; Not Max

P2B = (1-P2) ; Max

P3A = P3 ; Dropout

P3B = (1-P3) ; No Dropout

; ------

Y = 0

IF (TYP.EQ.1.AND.DV.EQ.1) THEN

F_FLAG = 1

Y=P1A ; P(impr)

ENDIF

IF (TYP.EQ.1.AND.DV.EQ.0) THEN

F_FLAG = 1

Y=P1B ; P(decl)

ENDIF

IF (TYP.EQ.2.AND.DV.EQ.0) THEN

F_FLAG = 1

Y=P2A ; P(Not Max)

ENDIF

IF (TYP.EQ.2.AND.DV.EQ.1) THEN

F_FLAG = 1

Y=P2B ; P(Max)

ENDIF

IF (TYP.EQ.3.AND.DV.EQ.1) THEN

F_FLAG = 1

Y=P3A ; P(Dropout)

ENDIF

IF (TYP.EQ.3.AND.DV.EQ.0) THEN

F_FLAG = 1

Y=P3B ; P(No Dropout)

ENDIF

IF (TYP.EQ.4.AND.CHN.EQ.1) THEN

Y = IMZ

ENDIF

IF (TYP.EQ.4.AND.CHN.EQ.0) THEN

Y = DEZ

ENDIF

IPRED = Y

$THETA 0.587000 ; PrIM ; 1

$THETA -1.73000 ; PrMAX ; 2

$THETA -4.14000 ; PrDO interval 1 ; 3

$THETA 0.599000 ; Impr ; 4

$THETA -3.56000 ; Decl ; 5

$THETA 0.595000 ; ResErr ; 6

$THETA -0.03340 ; InfDropout ; 7

$THETA 0.474000 ; A2PNH ; 8

$THETA 0.076500 ; DEPNH ; 9

$THETA -0.06020 ; IMBNH ; 10

$THETA 0.027700 ; A2TLS ; 11

$THETA -0.01830 ; A1AGE ; 12

$THETA -2.97000 ; PrDO interval 2 ; 13

$THETA -4.05000 ; PrDO interval 3 ; 14

$THETA -2.64000 ; PrMAX interval 3 ; 15

$THETA 0.365000 ; Impr ; 16

$OMEGA 0.434000 ; IIV on improvement ; 1

$OMEGA 0.690000 ; IIV on decline ; 2

$OMEGA 0.902000 ; IIV on improvement DAY 7 ; 3

$OMEGA 2.270000 ; IIV on decline DAY 7 ; 4

$SIGMA 1 FIX

$ESTIMATION METHOD=1 LAPLACE MAXEVAL=9999 PRINT=3 SIGDIG=3

$COVARIANCE PRINT=E SLOW

2.NONMEM control stream for the Barthel Index model

$PROBLEM Model for Barthel Index scores

$INPUT ID DAY BI IBI=DROP BASE=DROP IBAS=DROP PBI DV CHN TYP

VIST FLAG FLG2 AGE DIU ALT=DROP TLS SEX=DROP

WT=DROP RACE=DROP HT=DROP BMI=DROP IND=DROP

C2E=DROP DIC=DROP HEP=DROP THR=DROP BB=DROP

TIA=DROP KSA=DROP CAN=DROP ACE=DROP CGL=DROP

ANA=DROP ATA=DROP HYP=DROP ASA=DROP ASC=DROP

C3A=DROP ANG NEU=DROP AST=DROP TBI=DROP

ALB=DROP GGT ALK

SED=DROP NIH=DROP SSS=DROP BI2=DROP PNIH=DROP

PSSS=DROP PBI2=DROP BNIH BSSS=DROP STUD

$DATA trans_bi100331.csv

IGNORE=@

$PRED

TSS = DAY ; Time since stroke

CBNH = 42 - BNIH

A2PBI = THETA(8)*PBI

DETLS = THETA(9)*TLS

A1PBI = THETA(10)*PBI

IMPBI = THETA(11)*PBI

A2TSS = THETA(12)*TSS

IMBNH = THETA(15)*BNIH

IF(AGE.EQ.-99) THEN

A1AGE = 0

ELSE

A1AGE = THETA(13)*(AGE - 73)

ENDIF

IF(AGE.EQ.-99) THEN

IMAGE = 0

ELSE

IMAGE = THETA(14)*(AGE - 73)

ENDIF

IMCOV = IMPBI + IMAGE + IMBNH

DECOV = DETLS + DEGGT + DEANG

A1COV = A1PBI + A1AGE + A1CGL

A2COV = A2PBI + A2TLS + A2TSS

A3COV = 0

; ------

; Linear model (type = 4)

; ------

RV = THETA(6)*EPS(1)

TVIM = THETA(4) + IMCOV

TVDE = THETA(5) + DECOV

IM = TVIM + RV

DE = TVDE + ETA(1) + RV

IMZ = EXP(IM)/(1+EXP(IM))

DEZ = EXP(DE)/(1+EXP(DE))

; ------

; Transforming IMZ/DEZ to "real"

; NIH score

; ------

BIM1 = PBI + IMZ*(100 - PBI)

BDE2 = (1 - DEZ) * (PBI + 1)

; ------

; Improvement/Decline (type = 1)

; ------

TVA1 = THETA(1) + A1COV

P1 = EXP(TVA1)/(1+EXP(TVA1))

ET1 = ETA(1)

; ------

; Max score (type = 2)

; ------

TVA2 = THETA(2) + A2COV

P2 = EXP(TVA2)/(1+EXP(TVA2))

; ------

; Dropout (type = 3)

; ------

TVBDE = (THETA(7)*BDE2) + A3COV

TVA3 = THETA(3)*(1 + TVBDE)

P3 = EXP(TVA3)/(1+EXP(TVA3))

; ------

; Probabilities

; ------

P1A = P1 ; Improvement

P1B = 1-P1 ; Decline

P2A = P2 ; Not Max

P2B = 1-P2 ; Max

P3A = P3 ; Dropout

P3B = 1-P3 ; No Dropout

; ------

Y = 0

IF (TYP.EQ.1.AND.DV.EQ.1) THEN

F_FLAG = 1

Y=P1A ; P(impr)

ENDIF

IF (TYP.EQ.1.AND.DV.EQ.0) THEN

F_FLAG = 1

Y=P1B ; P(decl)

ENDIF

IF (TYP.EQ.2.AND.DV.EQ.0) THEN

F_FLAG = 1

Y=P2A ; P(Not Max)

ENDIF

IF (TYP.EQ.2.AND.DV.EQ.1) THEN

F_FLAG = 1

Y=P2B ; P(Max)

ENDIF

IF (TYP.EQ.3.AND.DV.EQ.1) THEN

F_FLAG = 1

Y=P3A ; P(Dropout)

ENDIF

IF (TYP.EQ.3.AND.DV.EQ.0) THEN

F_FLAG = 1

Y=P3B ; P(No Dropout)

ENDIF

IF (TYP.EQ.4.AND.CHN.EQ.1) THEN

Y = IMZ

ENDIF

IF (TYP.EQ.4.AND.CHN.EQ.0) THEN

Y = DEZ

ENDIF

$THETA 0.097600 ; 1 Probability of decline (logit scale)

$THETA 5.920000 ; 2 Probability of not max score (logit scale)

$THETA -0.51100 ; 3 Probability of dropout (logit scale)

$THETA -0.63800 ; 4 Improvement

$THETA 0.122000 ; 5 Decline

$THETA 1.110000 ; 6 Residual error

$THETA 0.133000 ; 7 Informative dropout

$THETA -0.09840 ; 8 PBI on A2

$THETA -0.03770 ; 9 10 TLS on DE

$THETA 0.010800 ; 10 PBI on A1

$THETA 0.015200 ; 11 PBI on IM

$THETA 0.019500 ; 12 TSS on A2

$THETA -0.03360 ; 13 AGE on A1

$THETA -0.01150 ; 14 AGE on IM

$THETA -0.03200 ; 15 BNIH on IM

$OMEGA 2.080000 ; 1 IIV on decline

$SIGMA 1 FIX

$EST METHOD=1 LAPLACE MAXEVAL=9999 PRINT=3 SIGDIG=3

$COV PRINT=E SLOW

1

Dataset excerpt for the NIHSS model

ID / DAY / NIHSS / cNIH / BASE / cBASE / PNIH / DV / CHN / TYPE / VISIT / AGE / TLS
1 / 7 / 23 / 19 / 17 / 25 / 17 / 0 / 0 / 1 / 2 / 88 / 6
1 / 7 / 23 / 19 / 17 / 25 / 17 / 0 / 0 / 3 / 2 / 88 / 6
1 / 7 / 23 / 19 / 17 / 25 / 17 / 0.24 / 0 / 4 / 2 / 88 / 6
1 / 29 / 23 / 19 / 17 / 25 / 23 / 0 / 0 / 1 / 3 / 88 / 22
1 / 29 / 23 / 19 / 17 / 25 / 23 / 0 / 0 / 3 / 3 / 88 / 22
1 / 29 / 23 / 19 / 17 / 25 / 23 / 0.0526 / 0 / 4 / 3 / 88 / 22
1 / 89 / 21 / 21 / 17 / 25 / 23 / 1 / 1 / 1 / 5 / 88 / 60
1 / 89 / 21 / 21 / 17 / 25 / 23 / 0 / 0 / 2 / 5 / 88 / 60
1 / 89 / 21 / 21 / 17 / 25 / 23 / 0.087 / 1 / 4 / 5 / 88 / 60
2 / 8 / 28 / 14 / 21 / 21 / 21 / 0 / 0 / 1 / 2 / 82 / 7
2 / 8 / 28 / 14 / 21 / 21 / 21 / 0 / 0 / 3 / 2 / 82 / 7
2 / 8 / 28 / 14 / 21 / 21 / 21 / 0.3333 / 0 / 4 / 2 / 82 / 7
2 / 33 / 36 / 6 / 21 / 21 / 28 / 0 / 0 / 1 / 3 / 82 / 25
2 / 33 / 36 / 6 / 21 / 21 / 28 / 0 / 0 / 3 / 3 / 82 / 25
2 / 33 / 36 / 6 / 21 / 21 / 28 / 0.5714 / 0 / 4 / 3 / 82 / 25
2 / 62 / -99 / 6 / 21 / 21 / 36 / 0 / 0 / 1 / 4 / 82 / 29
2 / 62 / -99 / 6 / 21 / 21 / 36 / 1 / 1 / 3 / 4 / 82 / 29

ID = Patient ID

DAY = Day of observation since start of study

NIHSS = NIHSS score

cNIH = Reversed NIHSS score

BASE = Baseline NIHSS score

cBASE = Reversed baseline NIHSS score

PNIH = Previous NIHSS score

DV = Dependent variable

CNH = Identifier for improvement/decline

TYPE = Identifier for the sub models (1=p(improvement),2=p(full recovery),3=p(dropout),

4=magnitude of improvement/decline)

AGE = Age in years at start of study

TLS = Time since start of study (i.e. time since stroke) in days

Dataset excerpt for the BI model

ID / DAY / BI / cBI / BASE / cBASE / PBI / DV / CHN / TYPE / VISIT / AGE / TLS
1 / 29 / 10 / 10 / 0 / 0 / 0 / 1 / 1 / 1 / 3 / 88 / 22
1 / 29 / 10 / 10 / 0 / 0 / 0 / 0 / 0 / 2 / 3 / 88 / 22
1 / 29 / 10 / 10 / 0 / 0 / 0 / 0.1 / 1 / 4 / 3 / 88 / 22
1 / 60 / 10 / 10 / 0 / 0 / 10 / 0 / 0 / 1 / 4 / 88 / 31
1 / 60 / 10 / 10 / 0 / 0 / 10 / 0 / 0 / 3 / 4 / 88 / 31
1 / 60 / 10 / 10 / 0 / 0 / 10 / 0.1 / 0 / 4 / 4 / 88 / 31
1 / 89 / 10 / 10 / 0 / 0 / 10 / 0 / 0 / 1 / 5 / 88 / 29
1 / 89 / 10 / 10 / 0 / 0 / 10 / 0 / 0 / 3 / 5 / 88 / 29
1 / 89 / 10 / 10 / 0 / 0 / 10 / 0.1 / 0 / 4 / 5 / 88 / 29
2 / 33 / 0 / 0 / 0 / 0 / 0 / 0 / 0 / 1 / 3 / 82 / 25
2 / 33 / 0 / 0 / 0 / 0 / 0 / 0 / 0 / 3 / 3 / 82 / 25
2 / 33 / 0 / 0 / 0 / 0 / 0 / 0.00001 / 0 / 4 / 3 / 82 / 25
2 / 46 / -99 / -99 / 0 / 0 / 0 / 0 / 0 / 1 / 4 / 82 / 13
2 / 46 / -99 / -99 / 0 / 0 / 0 / 1 / 1 / 3 / 4 / 82 / 13
2 / 60 / -99 / -99 / 0 / 0 / 0 / 1 / 1 / 5 / 4 / 82 / 27

ID = Patient ID

DAY = Day of observation since start of study

NIHSS = BI score

cNIH = BI score (redundant)

BASE = First BI score (expected at day 7)

cBASE = First BI score (redundant)

PNIH = Previous BI score

DV = Dependent variable

CNH = Identifier for improvement/decline

TYPE = Identifier for the sub models (1=p(improvement),2=p(full recovery),3=p(dropout),

4=magnitude of improvement/decline)

AGE = Age in years at start of study

TLS = Time since start of study (i.e. time since stroke) in days

1