Dear Nonmem users and experts -
I am attempting to model a data set using the M3 method, with interoccassion
variability. I've attempted to code this in multiple ways, but seem unable to
include the ETAs for the various occassions, without getting a control stream
error that the characters ETA are in error - this error seems to be an issue in
the coding of the control stream, but I cannot find it. The error is
consistently worded:
AN ERROR WAS FOUND IN THE CONTROL STATEMENTS
AN ERROR WAS FOUND ON LINE _(insert line here)_ AT THE APPROXIMATE POSITION
NOTED:
$PK ETA(X) ETA(X) ETA(X) ETA(X) ; where X is the eta in question
THE CHARACTERS IN ERROR ARE: ETA
207 THIS VARIABLE MAY NOT BE GIVEN A VALUE BY THIS STATEMENT
or
202 FORTRAN SYNTAX IS INCORRECT OR INAPPROPRIATE IN THIS CONTEXT
I've attached the data file, as well as the two approaches to the control
stream I've tried.
Control stream #1 - this will minimize if I comment out the final OCC3*ETA(6)
;2-Compartment Model with Oral Administration
$PROBLEM
$INPUT ID TIME DV AMT EVID MDV CMT TYPE OCC2 OCC3
$DATA ..\Data.csv IGNORE=#
$SUBROUTINES ADVAN4 TRANS4
$PK CL=THETA(1)*EXP(ETA(1)+OCC2*ETA(5)+OCC3*ETA(6))
Q=THETA(2)*EXP(ETA(3))
V2=THETA(3)*EXP(ETA(2))
V3=THETA(4)*EXP(ETA(4))
KA=THETA(5)
S2=V2
E1=ETA(1)
E2=ETA(2)
E3=ETA(3)
E4=ETA(4)
E5=ETA(5)
E6=ETA(6)
$ERROR
SIG=THETA(6)
LOQ=10
IPRED=F
IF (TYPE.EQ.1)THEN
F_FLAG=0
Y =F+SIG*ERR(1)
ENDIF
IF (TYPE.EQ.2)THEN
F_FLAG=1
DUM=(LOQ-IPRED)/SIG
CUMD=PHI(DUM)
Y=CUMD
ENDIF
W=IPRED+0.000001
IRES=DV-IPRED
IWRES=IRES/W
$THETA
(0.0001, 10 ) ; THETA1 is CL
(0.0001, 100 ) ; THETA2 is Q
(0.0001, 100 ) ; THETA3 is V2
(0.0001, 4000 ) ; THETA4 is V3
(0.0001, 1, 2 ) ; THETA5 is KA
(6) ; THETA6 is SIG
$OMEGA
(0.3 ) ; CL
(0.3 ) ; V2
(0.3 ) ; Q
(0.3 ) ; V3
(0.1 ) ; OCC1
(0.1 ) ; OCC2
$SIGMA
(1 FIX ) ; SIGMA1
$ESTIMATION METHOD= COND LAP INTERACTION SLOW MAX=9999 NOABORT POSTHOC
$TABLE ID EVID AMT TIME IPRED CWRES
NOPRINT FILE=AllRecords
$TABLE
ID CL Q V2 V3 KA
E1 E2 E3 E4 E5 E6
FIRSTONLY NOPRINT NOAPPEND FILE=FirstRecords
Control Stream #2 - this will also not run and gives an error that the ETA(5)
is incorrect
$PROBLEM
$INPUT ID TIME DV AMT EVID MDV CMT TYPE OCC2 OCC3
$DATA ..\Data.csv IGNORE=#
$SUBROUTINES ADVAN4 TRANS4
$PK
IOCL=(ETA(5)*OCC2+ETA(6)*OCC3)
TVCL=THETA(1)
CL=TVCL*EXP(ETA(1)+IOCL)
TVQ=THETA(2)
Q=TVQ*EXP(ETA(3))
TVV2=THETA(3)
V2=TVV2*EXP(ETA(2))
TVV3=THETA(4)
V3=TVV3*EXP(ETA(4))
TVKA=THETA(5)
KA=TVKA
S2=V2
$ERROR
SIG=THETA(6)
LOQ=10
IPRED=F
IF (TYPE.EQ.1)THEN
F_FLAG=0
Y =F+SIG*ERR(1)
ENDIF
IF (TYPE.EQ.2)THEN
F_FLAG=1
DUM=(LOQ-IPRED)/SIG
CUMD=PHI(DUM)
Y=CUMD
ENDIF
W=IPRED+0.000001
IRES=DV-IPRED
IWRES=IRES/W
$THETA
(0.0001, 10 ) ; THETA1 is CL
(0.0001, 100 ) ; THETA2 is Q
(0.0001, 100 ) ; THETA3 is V2
(0.0001, 4000 ) ; THETA4 is V3
(0.0001, 1, 2 ) ; THETA5 is KA
(6 ) ; THETA6 is SIG
$OMEGA
(0.3) ; CL
(0.3) ; V2
(0.3) ; Q
(0.3) ; V3
(0.1) ; OCC2
(0.1) ; OCC3
$SIGMA
(1 FIX) ; SIGMA1
$ESTIMATION METHOD=1 LAP INTERACTION SLOW MAX=9999 NOABORT
$COV
$TABLE ID EVID AMT TIME IPRED CWRES
NOPRINT FILE=AllRecords
$TABLE
ID CL Q V2 V3 KA
FIRSTONLY NOPRINT NOAPPEND FILE=FirstRecords
I've tried in NONMEM 6, 7, and 7.2 with the same errors. Any help on
strategies to get this to run at all would be greatly appreciated!
Thanks,
Matthew
Data.csv
Description:
Data.csv
consistent error in control stream
4 messages
4 people
Latest: Jan 12, 2012
Any chance that you are using a DOS file on a non-DOS system or vice versa?
Strother, R Matthew wrote:
> The addition of carriage return after the $PK, as indicated in your email, did not work.
>
> I still get the same error --
>
> AN ERROR WAS FOUND IN THE CONTROL STATEMENTS.
>
> AN ERROR WAS FOUND ON LINE 6 AT THE APPROXIMATE POSITION NOTED:
>
> $PK ETA(6) ETA(6) ETA(6)
>
> X
>
> THE CHARACTERS IN ERROR ARE: ETA
>
> 207 THIS VARIABLE MAY NOT BE GIVEN A VALUE BY THIS STATEMENT
>
> *From:* nmconsult [mailto:[email protected]]
> *Sent:* Wednesday, January 11, 2012 2:52 PM
> *To:* Strother, R Matthew
> *Subject:* RE: [NMusers] consistent error in control stream
>
> You can't start modeling statements on the $PK record:
>
> $PK CL=THETA(1)*EXP(ETA(1)+OCC2*ETA(5)+OCC3*ETA(6))
>
> This below will run (but terminates with rounding errors):
>
> ;2-Compartment Model with Oral Administration
>
> $PROBLEM
>
> $INPUT ID TIME DV AMT EVID MDV CMT TYPE OCC2 OCC3
>
> $DATA Data.csv IGNORE=#
>
> $SUBROUTINES ADVAN4 TRANS4
>
> $PK
>
> CL=THETA(1)*EXP(ETA(1)+OCC2*ETA(5)+OCC3*ETA(6))
>
> Q=THETA(2)*EXP(ETA(3))
>
> V2=THETA(3)*EXP(ETA(2))
>
> V3=THETA(4)*EXP(ETA(4))
>
> KA=THETA(5)
>
> S2=V2
>
> E1=ETA(1)
>
> E2=ETA(2)
>
> E3=ETA(3)
>
> E4=ETA(4)
>
> E5=ETA(5)
>
> E6=ETA(6)
>
> *From:* [email protected] < mailto: [email protected] > [ mailto: [email protected] ] < mailto:%5Bmailto: [email protected] %5D > *On Behalf Of *Strother, R Matthew
>
> *Sent:* Wednesday, January 11, 2012 2:06 PM
> *To:* [email protected] <mailto:[email protected]>
> *Subject:* [NMusers] consistent error in control stream
>
> Dear Nonmem users and experts -
>
> I am attempting to model a data set using the M3 method, with interoccassion variability. I've attempted to code this in multiple ways, but seem unable to include the ETAs for the various occassions, without getting a control stream error that the characters ETA are in error - this error seems to be an issue in the coding of the control stream, but I cannot find it. The error is consistently worded:
>
> AN ERROR WAS FOUND IN THE CONTROL STATEMENTS
>
> AN ERROR WAS FOUND ON LINE _(insert line here)_ AT THE APPROXIMATE POSITION NOTED:
>
> $PK ETA(X) ETA(X) ETA(X) ETA(X) ; where X is the eta in question
>
> THE CHARACTERS IN ERROR ARE: ETA
> 207 THIS VARIABLE MAY NOT BE GIVEN A VALUE BY THIS STATEMENT
>
> or
>
> 202 FORTRAN SYNTAX IS INCORRECT OR INAPPROPRIATE IN THIS CONTEXT
>
> I've attached the data file, as well as the two approaches to the control stream I've tried. *Control stream #1 - this will minimize if I comment out the final OCC3*ETA(6)*
>
> ;2-Compartment Model with Oral Administration
>
> $PROBLEM $INPUT ID TIME DV AMT EVID MDV CMT TYPE OCC2 OCC3
>
> $DATA ..\Data.csv IGNORE=#
> $SUBROUTINES ADVAN4 TRANS4
> $PK CL=THETA(1)*EXP(ETA(1)+OCC2*ETA(5)+OCC3*ETA(6))
> Q=THETA(2)*EXP(ETA(3))
> V2=THETA(3)*EXP(ETA(2))
> V3=THETA(4)*EXP(ETA(4))
> KA=THETA(5)
>
> S2=V2
>
> E1=ETA(1)
> E2=ETA(2)
> E3=ETA(3)
> E4=ETA(4)
> E5=ETA(5)
> E6=ETA(6)
>
> $ERROR SIG=THETA(6)
>
> LOQ=10
> IPRED=F
>
> IF (TYPE.EQ.1)THEN
>
> F_FLAG=0
> Y =F+SIG*ERR(1)
> ENDIF
> IF (TYPE.EQ.2)THEN
> F_FLAG=1
>
> DUM=(LOQ-IPRED)/SIG
>
> CUMD=PHI(DUM)
> Y=CUMD
> ENDIF
>
> W=IPRED+0.000001
> IRES=DV-IPRED
> IWRES=IRES/W
>
> $THETA (0.0001, 10 ) ; THETA1 is CL
>
> (0.0001, 100 ) ; THETA2 is Q
> (0.0001, 100 ) ; THETA3 is V2
> (0.0001, 4000 ) ; THETA4 is V3
> (0.0001, 1, 2 ) ; THETA5 is KA
> (6) ; THETA6 is SIG
>
> $OMEGA
> (0.3 ) ; CL
> (0.3 ) ; V2
> (0.3 ) ; Q
> (0.3 ) ; V3
> (0.1 ) ; OCC1
>
> (0.1 ) ; OCC2 $SIGMA (1 FIX ) ; SIGMA1
>
> $ESTIMATION METHOD= COND LAP INTERACTION SLOW MAX=9999 NOABORT POSTHOC $TABLE ID EVID AMT TIME IPRED CWRES
>
> NOPRINT FILE=AllRecords
>
> $TABLE ID CL Q V2 V3 KA
>
> E1 E2 E3 E4 E5 E6
> FIRSTONLY NOPRINT NOAPPEND FILE=FirstRecords
> *
>
> Control Stream #2 - this will also not run and gives an error that the ETA(5) is incorrect*
>
> $PROBLEM $INPUT ID TIME DV AMT EVID MDV CMT TYPE OCC2 OCC3
>
> $DATA ..\Data.csv IGNORE=#
> $SUBROUTINES ADVAN4 TRANS4
>
> $PK IOCL=(ETA(5)*OCC2+ETA(6)*OCC3)
>
> TVCL=THETA(1)
> CL=TVCL*EXP(ETA(1)+IOCL)
> TVQ=THETA(2)
> Q=TVQ*EXP(ETA(3))
> TVV2=THETA(3)
> V2=TVV2*EXP(ETA(2))
> TVV3=THETA(4)
> V3=TVV3*EXP(ETA(4))
> TVKA=THETA(5)
> KA=TVKA
>
> S2=V2 $ERROR SIG=THETA(6)
>
> LOQ=10
> IPRED=F
>
> IF (TYPE.EQ.1)THEN
> F_FLAG=0
> Y =F+SIG*ERR(1)
> ENDIF
> IF (TYPE.EQ.2)THEN
> F_FLAG=1
>
> DUM=(LOQ-IPRED)/SIG
>
> CUMD=PHI(DUM)
> Y=CUMD
> ENDIF
>
> W=IPRED+0.000001
>
> IRES=DV-IPRED
> IWRES=IRES/W
>
> $THETA (0.0001, 10 ) ; THETA1 is CL
>
> (0.0001, 100 ) ; THETA2 is Q
> (0.0001, 100 ) ; THETA3 is V2
> (0.0001, 4000 ) ; THETA4 is V3
> (0.0001, 1, 2 ) ; THETA5 is KA
> (6 ) ; THETA6 is SIG
>
> $OMEGA
> (0.3) ; CL
> (0.3) ; V2
> (0.3) ; Q
> (0.3) ; V3
> (0.1) ; OCC2
>
> (0.1) ; OCC3 $SIGMA (1 FIX) ; SIGMA1
>
> $ESTIMATION METHOD=1 LAP INTERACTION SLOW MAX=9999 NOABORT $COV
>
> $TABLE ID EVID AMT TIME IPRED CWRES
> NOPRINT FILE=AllRecords
>
> $TABLE ID CL Q V2 V3 KA FIRSTONLY NOPRINT NOAPPEND FILE=FirstRecords
>
> *I've tried in NONMEM 6, 7, and 7.2 with the same errors. Any help on strategies to get this to run at all would be greatly appreciated!
>
> Thanks,
> Matthew*
>
>
That's odd, it runs on my system:
MONITORING OF SEARCH:
0ITERATION NO.: 0 OBJECTIVE VALUE: 457.033490614776 NO.
OF FUNC. EVALS.: 13
CUMULATIVE NO. OF FUNC. EVALS.: 13
NPARAMETR: 1.0000E+01 1.0000E+02 1.0000E+02 4.0000E+03 1.0000E+00
6.0000E+00 3.0000E-01 3.0000E-01 3.0000E-01 3.0000E-01
1.0000E-01 1.0000E-01
PARAMETER: 1.0000E-01 1.0000E-01 1.0000E-01 1.0000E-01 1.0000E-01
1.0000E-01 1.0000E-01 1.0000E-01 1.0000E-01 1.0000E-01
1.0000E-01 1.0000E-01
GRADIENT: -1.6867E+01 -1.9433E+01 -1.7770E+01 -1.1841E+01 1.1993E+01
1.9319E+02 -8.4576E+00 -1.0215E+00 -2.8266E+01 -4.1328E+00
-3.2837E-01 -1.6150E-01
0ITERATION NO.: 23 OBJECTIVE VALUE: 424.092076076490 NO.
OF FUNC. EVALS.: 6
CUMULATIVE NO. OF FUNC. EVALS.: 555
NPARAMETR: 1.7376E+01 1.3011E+02 1.5651E+02 4.8553E+03 9.4233E-01
5.3465E+00 1.1237E+00 1.0545E-01 1.9029E+00 4.3044E-01
6.9493E-02 9.2908E-03
PARAMETER: 6.5253E-01 3.6325E-01 5.4797E-01 2.9378E-01 -1.5486E-02
8.9074E-02 7.6031E-01 -4.2275E-01 1.0237E+00 2.8051E-01
-8.1975E-02 -1.0870E+00
GRADIENT: 7.7884E+01 1.5537E+02 -5.0961E+00 -2.7771E+02 -4.1339E+03
-1.2553E+04 -7.1758E+01 1.1815E+03 -5.4575E+01 6.6948E+01
-8.7212E+01 7.3282E-02
NUMSIGDIG: 5.1 5.1 6.4 4.9 4.1
3.5 5.1 4.0 5.1 5.5
5.9 2.9
#TERM:
0MINIMIZATION TERMINATED
DUE TO ROUNDING ERRORS (ERROR=134)
NO. OF FUNCTION EVALUATIONS USED: 555
NO. OF SIG. DIGITS IN FINAL EST.: 3.0
ETABAR IS THE ARITHMETIC MEAN OF THE ETA-ESTIMATES,
AND THE P-VALUE IS GIVEN FOR THE NULL HYPOTHESIS THAT THE TRUE MEAN IS
0.
ETABAR: 7.2765E-02 -3.3708E-03 -1.3910E-03 -5.2871E-02
-1.3625E-02 6.9843E-04
SE: 1.8423E-01 5.7770E-02 3.4730E-01 1.0172E-01
1.2564E-02 1.3606E-03
P VAL.: 6.9286E-01 9.5347E-01 9.9680E-01 6.0322E-01
2.7818E-01 6.0773E-01
ETAshrink(%): 3.9548E+01 3.8118E+01 1.2423E+01 4.6070E+01
8.3421E+01 9.5095E+01
EPSshrink(%): 7.5100E+00
Quoted reply history
From: [email protected] [mailto:[email protected]]
On Behalf Of Strother, R Matthew
Sent: Wednesday, January 11, 2012 3:00 PM
To: nmconsult
Cc: '[email protected]'
Subject: RE: [NMusers] consistent error in control stream
The addition of carriage return after the $PK, as indicated in your
email, did not work.
I still get the same error -
AN ERROR WAS FOUND IN THE CONTROL STATEMENTS.
AN ERROR WAS FOUND ON LINE 6 AT THE APPROXIMATE POSITION NOTED:
$PK ETA(6) ETA(6) ETA(6)
X
THE CHARACTERS IN ERROR ARE: ETA
207 THIS VARIABLE MAY NOT BE GIVEN A VALUE BY THIS STATEMENT
From: nmconsult [mailto:[email protected]]
Sent: Wednesday, January 11, 2012 2:52 PM
To: Strother, R Matthew
Subject: RE: [NMusers] consistent error in control stream
You can't start modeling statements on the $PK record:
$PK CL=THETA(1)*EXP(ETA(1)+OCC2*ETA(5)+OCC3*ETA(6))
This below will run (but terminates with rounding errors):
;2-Compartment Model with Oral Administration
$PROBLEM
$INPUT ID TIME DV AMT EVID MDV CMT TYPE OCC2 OCC3
$DATA Data.csv IGNORE=#
$SUBROUTINES ADVAN4 TRANS4
$PK
CL=THETA(1)*EXP(ETA(1)+OCC2*ETA(5)+OCC3*ETA(6))
Q=THETA(2)*EXP(ETA(3))
V2=THETA(3)*EXP(ETA(2))
V3=THETA(4)*EXP(ETA(4))
KA=THETA(5)
S2=V2
E1=ETA(1)
E2=ETA(2)
E3=ETA(3)
E4=ETA(4)
E5=ETA(5)
E6=ETA(6)
From: [email protected] [mailto:[email protected]]
On Behalf Of Strother, R Matthew
Sent: Wednesday, January 11, 2012 2:06 PM
To: [email protected]
Subject: [NMusers] consistent error in control stream
Dear Nonmem users and experts -
I am attempting to model a data set using the M3 method, with
interoccassion variability. I've attempted to code this in multiple
ways, but seem unable to include the ETAs for the various occassions,
without getting a control stream error that the characters ETA are in
error - this error seems to be an issue in the coding of the control
stream, but I cannot find it. The error is consistently worded:
AN ERROR WAS FOUND IN THE CONTROL STATEMENTS
AN ERROR WAS FOUND ON LINE _(insert line here)_ AT THE APPROXIMATE
POSITION NOTED:
$PK ETA(X) ETA(X) ETA(X) ETA(X) ; where X is the eta in question
THE CHARACTERS IN ERROR ARE: ETA
207 THIS VARIABLE MAY NOT BE GIVEN A VALUE BY THIS STATEMENT
or
202 FORTRAN SYNTAX IS INCORRECT OR INAPPROPRIATE IN THIS CONTEXT
I've attached the data file, as well as the two approaches to the
control stream I've tried.
Control stream #1 - this will minimize if I comment out the final
OCC3*ETA(6)
;2-Compartment Model with Oral Administration
$PROBLEM
$INPUT ID TIME DV AMT EVID MDV CMT TYPE OCC2 OCC3
$DATA ..\Data.csv IGNORE=#
$SUBROUTINES ADVAN4 TRANS4
$PK CL=THETA(1)*EXP(ETA(1)+OCC2*ETA(5)+OCC3*ETA(6))
Q=THETA(2)*EXP(ETA(3))
V2=THETA(3)*EXP(ETA(2))
V3=THETA(4)*EXP(ETA(4))
KA=THETA(5)
S2=V2
E1=ETA(1)
E2=ETA(2)
E3=ETA(3)
E4=ETA(4)
E5=ETA(5)
E6=ETA(6)
$ERROR
SIG=THETA(6)
LOQ=10
IPRED=F
IF (TYPE.EQ.1)THEN
F_FLAG=0
Y =F+SIG*ERR(1)
ENDIF
IF (TYPE.EQ.2)THEN
F_FLAG=1
DUM=(LOQ-IPRED)/SIG
CUMD=PHI(DUM)
Y=CUMD
ENDIF
W=IPRED+0.000001
IRES=DV-IPRED
IWRES=IRES/W
$THETA
(0.0001, 10 ) ; THETA1 is CL
(0.0001, 100 ) ; THETA2 is Q
(0.0001, 100 ) ; THETA3 is V2
(0.0001, 4000 ) ; THETA4 is V3
(0.0001, 1, 2 ) ; THETA5 is KA
(6) ; THETA6 is SIG
$OMEGA
(0.3 ) ; CL
(0.3 ) ; V2
(0.3 ) ; Q
(0.3 ) ; V3
(0.1 ) ; OCC1
(0.1 ) ; OCC2
$SIGMA
(1 FIX ) ; SIGMA1
$ESTIMATION METHOD= COND LAP INTERACTION SLOW MAX=9999 NOABORT
POSTHOC
$TABLE ID EVID AMT TIME IPRED CWRES
NOPRINT FILE=AllRecords
$TABLE
ID CL Q V2 V3 KA
E1 E2 E3 E4 E5 E6
FIRSTONLY NOPRINT NOAPPEND FILE=FirstRecords
Control Stream #2 - this will also not run and gives an error that the
ETA(5) is incorrect
$PROBLEM
$INPUT ID TIME DV AMT EVID MDV CMT TYPE OCC2 OCC3
$DATA ..\Data.csv IGNORE=#
$SUBROUTINES ADVAN4 TRANS4
$PK
IOCL=(ETA(5)*OCC2+ETA(6)*OCC3)
TVCL=THETA(1)
CL=TVCL*EXP(ETA(1)+IOCL)
TVQ=THETA(2)
Q=TVQ*EXP(ETA(3))
TVV2=THETA(3)
V2=TVV2*EXP(ETA(2))
TVV3=THETA(4)
V3=TVV3*EXP(ETA(4))
TVKA=THETA(5)
KA=TVKA
S2=V2
$ERROR
SIG=THETA(6)
LOQ=10
IPRED=F
IF (TYPE.EQ.1)THEN
F_FLAG=0
Y =F+SIG*ERR(1)
ENDIF
IF (TYPE.EQ.2)THEN
F_FLAG=1
DUM=(LOQ-IPRED)/SIG
CUMD=PHI(DUM)
Y=CUMD
ENDIF
W=IPRED+0.000001
IRES=DV-IPRED
IWRES=IRES/W
$THETA
(0.0001, 10 ) ; THETA1 is CL
(0.0001, 100 ) ; THETA2 is Q
(0.0001, 100 ) ; THETA3 is V2
(0.0001, 4000 ) ; THETA4 is V3
(0.0001, 1, 2 ) ; THETA5 is KA
(6 ) ; THETA6 is SIG
$OMEGA
(0.3) ; CL
(0.3) ; V2
(0.3) ; Q
(0.3) ; V3
(0.1) ; OCC2
(0.1) ; OCC3
$SIGMA
(1 FIX) ; SIGMA1
$ESTIMATION METHOD=1 LAP INTERACTION SLOW MAX=9999 NOABORT
$COV
$TABLE ID EVID AMT TIME IPRED CWRES
NOPRINT FILE=AllRecords
$TABLE
ID CL Q V2 V3 KA
FIRSTONLY NOPRINT NOAPPEND FILE=FirstRecords
I've tried in NONMEM 6, 7, and 7.2 with the same errors. Any help on
strategies to get this to run at all would be greatly appreciated!
Thanks,
Matthew
Hi,
The issue reported by Matthew was caused by using Wings for NONMEM with an unsuitable control stream.
The problem is due to having OCC2 as a data item in $INPUT and also using OCC2 as a comment for the last OMEGA. WFN tries to use the names implied by the comments when it translates the control stream for NM-TRAN. Because Matthew was using OCC2 as a data item and also as an implied OMEGA name the translation was not correct.
When using WFN you need to pay attention to the names that are implied by the comments. The advantage of these names is that the WFN output can use them to identify parameters by name instead of THETA(1), THETA(2) etc. There are also some other advantages which you can find by reading the WFN online help
http://wfn.sourceforge.net/wfncs.htm#control_streams
Best wishes,
Nick
Quoted reply history
On 12/01/2012 8:59 a.m., Strother, R Matthew wrote:
> The addition of carriage return after the $PK, as indicated in your email, did not work.
>
> I still get the same error –
>
> AN ERROR WAS FOUND IN THE CONTROL STATEMENTS.
>
> AN ERROR WAS FOUND ON LINE 6 AT THE APPROXIMATE POSITION NOTED:
>
> $PK ETA(6) ETA(6) ETA(6)
>
> X
>
> THE CHARACTERS IN ERROR ARE: ETA
>
> 207 THIS VARIABLE MAY NOT BE GIVEN A VALUE BY THIS STATEMENT
>
> *From:*nmconsult [mailto:[email protected]]
> *Sent:* Wednesday, January 11, 2012 2:52 PM
> *To:* Strother, R Matthew
> *Subject:* RE: [NMusers] consistent error in control stream
>
> You can’t start modeling statements on the $PK record:
>
> $PK CL=THETA(1)*EXP(ETA(1)+OCC2*ETA(5)+OCC3*ETA(6))
>
> This below will run (but terminates with rounding errors):
>
> ;2-Compartment Model with Oral Administration
>
> $PROBLEM
>
> $INPUT ID TIME DV AMT EVID MDV CMT TYPE OCC2 OCC3
>
> $DATA Data.csv IGNORE=#
>
> $SUBROUTINES ADVAN4 TRANS4
>
> $PK
>
> CL=THETA(1)*EXP(ETA(1)+OCC2*ETA(5)+OCC3*ETA(6))
>
> Q=THETA(2)*EXP(ETA(3))
>
> V2=THETA(3)*EXP(ETA(2))
>
> V3=THETA(4)*EXP(ETA(4))
>
> KA=THETA(5)
>
> S2=V2
>
> E1=ETA(1)
>
> E2=ETA(2)
>
> E3=ETA(3)
>
> E4=ETA(4)
>
> E5=ETA(5)
>
> E6=ETA(6)
>
> *From:* [email protected] < mailto: [email protected] > [ mailto: [email protected] ] < mailto:[mailto: [email protected] ]> *On Behalf Of *Strother, R Matthew
>
> *Sent:* Wednesday, January 11, 2012 2:06 PM
> *To:* [email protected] <mailto:[email protected]>
> *Subject:* [NMusers] consistent error in control stream
>
> Dear Nonmem users and experts -
>
> I am attempting to model a data set using the M3 method, with interoccassion variability. I've attempted to code this in multiple ways, but seem unable to include the ETAs for the various occassions, without getting a control stream error that the characters ETA are in error - this error seems to be an issue in the coding of the control stream, but I cannot find it. The error is consistently worded:
>
> AN ERROR WAS FOUND IN THE CONTROL STATEMENTS
>
> AN ERROR WAS FOUND ON LINE _(insert line here)_ AT THE APPROXIMATE POSITION NOTED:
>
> $PK ETA(X) ETA(X) ETA(X) ETA(X) ; where X is the eta in question
>
> THE CHARACTERS IN ERROR ARE: ETA
> 207 THIS VARIABLE MAY NOT BE GIVEN A VALUE BY THIS STATEMENT
>
> or
>
> 202 FORTRAN SYNTAX IS INCORRECT OR INAPPROPRIATE IN THIS CONTEXT
>
> I've attached the data file, as well as the two approaches to the control stream I've tried.
>
> *Control stream #1 - this will minimize if I comment out the final OCC3*ETA(6)*
>
> ;2-Compartment Model with Oral Administration
> $PROBLEM
> $INPUT ID TIME DV AMT EVID MDV CMT TYPE OCC2 OCC3
> $DATA ..\Data.csv IGNORE=#
> $SUBROUTINES ADVAN4 TRANS4
> $PK CL=THETA(1)*EXP(ETA(1)+OCC2*ETA(5)+OCC3*ETA(6))
> Q=THETA(2)*EXP(ETA(3))
> V2=THETA(3)*EXP(ETA(2))
> V3=THETA(4)*EXP(ETA(4))
> KA=THETA(5)
> S2=V2
>
> E1=ETA(1)
> E2=ETA(2)
> E3=ETA(3)
> E4=ETA(4)
> E5=ETA(5)
> E6=ETA(6)
>
> $ERROR
> SIG=THETA(6)
> LOQ=10
> IPRED=F
>
> IF (TYPE.EQ.1)THEN
> F_FLAG=0
> Y =F+SIG*ERR(1)
> ENDIF
> IF (TYPE.EQ.2)THEN
> F_FLAG=1
>
> DUM=(LOQ-IPRED)/SIG
> CUMD=PHI(DUM)
> Y=CUMD
> ENDIF
>
> W=IPRED+0.000001
> IRES=DV-IPRED
> IWRES=IRES/W
>
> $THETA
> (0.0001, 10 ) ; THETA1 is CL
> (0.0001, 100 ) ; THETA2 is Q
> (0.0001, 100 ) ; THETA3 is V2
> (0.0001, 4000 ) ; THETA4 is V3
> (0.0001, 1, 2 ) ; THETA5 is KA
> (6) ; THETA6 is SIG
>
> $OMEGA
> (0.3 ) ; CL
> (0.3 ) ; V2
> (0.3 ) ; Q
> (0.3 ) ; V3
> (0.1 ) ; OCC1
> (0.1 ) ; OCC2
>
> $SIGMA
> (1 FIX ) ; SIGMA1
>
> $ESTIMATION METHOD= COND LAP INTERACTION SLOW MAX=9999 NOABORT POSTHOC
> $TABLE ID EVID AMT TIME IPRED CWRES
> NOPRINT FILE=AllRecords
>
> $TABLE
> ID CL Q V2 V3 KA
> E1 E2 E3 E4 E5 E6
> FIRSTONLY NOPRINT NOAPPEND FILE=FirstRecords
> *
>
> Control Stream #2 - this will also not run and gives an error that the ETA(5) is incorrect*
>
> $PROBLEM
> $INPUT ID TIME DV AMT EVID MDV CMT TYPE OCC2 OCC3
> $DATA ..\Data.csv IGNORE=#
> $SUBROUTINES ADVAN4 TRANS4
> $PK
> IOCL=(ETA(5)*OCC2+ETA(6)*OCC3)
> TVCL=THETA(1)
> CL=TVCL*EXP(ETA(1)+IOCL)
> TVQ=THETA(2)
> Q=TVQ*EXP(ETA(3))
> TVV2=THETA(3)
> V2=TVV2*EXP(ETA(2))
> TVV3=THETA(4)
> V3=TVV3*EXP(ETA(4))
> TVKA=THETA(5)
> KA=TVKA
> S2=V2
> $ERROR
> SIG=THETA(6)
> LOQ=10
> IPRED=F
>
> IF (TYPE.EQ.1)THEN
> F_FLAG=0
> Y =F+SIG*ERR(1)
> ENDIF
> IF (TYPE.EQ.2)THEN
> F_FLAG=1
>
> DUM=(LOQ-IPRED)/SIG
> CUMD=PHI(DUM)
> Y=CUMD
> ENDIF
>
> W=IPRED+0.000001
> IRES=DV-IPRED
> IWRES=IRES/W
>
> $THETA
> (0.0001, 10 ) ; THETA1 is CL
> (0.0001, 100 ) ; THETA2 is Q
> (0.0001, 100 ) ; THETA3 is V2
> (0.0001, 4000 ) ; THETA4 is V3
> (0.0001, 1, 2 ) ; THETA5 is KA
> (6 ) ; THETA6 is SIG
>
> $OMEGA
> (0.3) ; CL
> (0.3) ; V2
> (0.3) ; Q
> (0.3) ; V3
> (0.1) ; OCC2
> (0.1) ; OCC3
>
> $SIGMA
> (1 FIX) ; SIGMA1
>
> $ESTIMATION METHOD=1 LAP INTERACTION SLOW MAX=9999 NOABORT
> $COV
> $TABLE ID EVID AMT TIME IPRED CWRES
> NOPRINT FILE=AllRecords
>
> $TABLE
> ID CL Q V2 V3 KA
>
> FIRSTONLY NOPRINT NOAPPEND FILE=FirstRecords
>
> *I've tried in NONMEM 6, 7, and 7.2 with the same errors. Any help on strategies to get this to run at all would be greatly appreciated!
>
> Thanks,
> Matthew*
>
>