NONMEM results

From: Alison Boeckmann Date: June 01, 2000 technical Source: cognigencorp.com
From: ABoeckmann <alison@c255.ucsf.edu> Subject: NONMEM results Date: Thu, 1 Jun 2000 13:51:20 -0700 (PDT) Dick Wixley asked about "the problem of extracting a sufficient and accurate reporting of the statistical analysis from NONMEM output." One response was from Mark Sale, who said he has a special version of the NONMEM CFILES routine to obtain this information "on the fly", i.e., using code that is part of the NONMEM executable, rather than extracting it from the NONMEM output. In fact, NONMEM allows anyone to write code that saves quantities of interest in an external file. I've posted email on this topic before, but I will repeat it here because the code is somewhat garbled in the NMUSERS email archive. - Alison =================== The final parameter estimates, standard errors, and other quantities are available in NONMEM read-only commons ROCM6, ROCM7, ROCM8, and ROCM9. These are discussed in Guide VIII, or try "nmhelp rocm6" etc. If you use $PRED, you can obtain them in a block of code that tests for ICALL.EQ.3. Or if you use PREDPP, you can use code such as the following in an INFN routine. E.g., if the code is in a file named myinfn, then specify $SUBROUTINES ... INFN=myinfn Here's the code. It is suitable for diagonal omega and sigma, but needs some modification for full omega or sigma. (Constants 40 and 30 in the declarations for THETAF etc. should be the same as the values given to LTH and LVR in file NSIZES, in case you changed those values.) It also performs a pass thru the data file to obtain individual etas, which you may delete if you do not want them. SUBROUTINE INFN(ICALL,THETA,DATREC,INDXS,NEWIND) DIMENSION THETA(*),DATREC(*),INDXS(*) DOUBLE PRECISION THETA COMMON /ROCM6/ THETAF(40), OMEGAF(30,30), SIGMAF(30,30) COMMON /ROCM7/ SETH(40),SEOM(30,30),SESIG(30,30) COMMON /ROCM8/ OBJECT COMMON /ROCM9/ IERE,IERC DOUBLE PRECISION THETAF, OMEGAF, SIGMAF DOUBLE PRECISION OBJECT REAL SETH,SEOM,SESIG DOUBLE PRECISION ETA(10) INTEGER J,I INTEGER IERE,IERC INTEGER MODE INTEGER NTH,NETA,NEPS C THE NEXT 3 LINES SHOULD BE EDITED FOR THE NUMBERS OF ETAs, THETAs C AND EPSILONs IN YOUR PROBLEM NTH=8 NETA=6 NEPS=2 IF (ICALL.EQ.0) THEN OPEN(49,FILE='ETA') OPEN(50,FILE='OBJECT') OPEN(51,FILE='THETA') OPEN(52,FILE='SETHETA') OPEN(53,FILE='OMEGA') OPEN(54,FILE='SEOMEGA') OPEN(55,FILE='SIGMA') OPEN(56,FILE='SESIGMA') OPEN(57,FILE='IERE_C') ENDIF C THE NEXT 11 LINES WRITE INDIVIDUAL ETAS IF 'POSTHOC' C OPTION CHOSEN IN THE ESTIMATION STEP IF (ICALL.EQ.3) THEN MODE=0 CALL PASS(MODE) MODE=1 20 CALL PASS(MODE) IF (MODE.EQ.0) GO TO 30 IF (NEWIND.NE.2) THEN CALL GETETA(ETA) WRITE (49,97) (ETA(I),I=1,NETA) ENDIF GO TO 20 30 CONTINUE WRITE (50,99) OBJECT WRITE (51,99) (THETAF(J),J=1,NTH) WRITE (52,99) (SETH(J),J=1,NTH) 7000 WRITE (53,99) (OMEGAF(J,J),J=1,NETA) WRITE (54,99) (SEOM(J,J),J=1,NETA) 7999 WRITE (55,99) (SIGMAF(J,J),J=1,NEPS) WRITE (56,99) (SESIG(J,J), J=1,NEPS) WRITE (57,98) IERE,IERC ENDIF 99 FORMAT (20F15.8) 98 FORMAT (2I8) 97 FORMAT (F8.0, 10E15.8) RETURN END With (say) $OMEGA BLOCK(3) .... the change is as follows: Locate: NETA=6 7000 WRITE (53,99) (OMEGAF(J,J),J=1,NETA) WRITE (54,99) (SEOM(J,J),J=1,NETA) Change to: NETA=3 7000 WRITE (53,99) ((OMEGAF(J,I),J=1,I),I=1,NETA) WRITE (54,99) ((SEOM(J,I),J=1,I),I=1,NETA)