Re: consistent error in control stream
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*
>
>