$PROBLEM 2 compartment fitting $INPUT ID TIME AMT DV WTKG GENDER AGE {D1LAG[1]} $DATA {data_dir}/datalarge.csv IGNORE=@ $SUBROUTINE {ADVAN[1]} ;; ADVAN2, ADVAN4, ADVAN12 $PK CWTKGONE = WTKG/70 ;; CENTERED ON ONE CWTKGZERO = WTKG-70 ;; CENTERED ON ZERO CAGE = AGE/40 TVV2=THETA(2){V2~WT[1]} {V2~GENDER[1]} ;; optional covariates effects of WT and Gender V2=TVV2*EXP(ETA(2)) TVCL= THETA(1) {CL~WT[1]} {CL~AGE[1]} ;; optional covariates effects of WT and AGE CL=TVCL*EXP(ETA(1)) K=CL/V2 {ADVAN[2]} ;; for K23,K32,K24,K42 needed? {D1LAG[2]} ;; include D1 and lag, with diag or block OMEGA TVKA=THETA(3) KA=TVKA {KAETA[1]} S2 = V2/1000 $ERROR REP = IREP IPRED =F IOBS = F {RESERR[1]} Y=IOBS $THETA ;; must be one THETA per line. (0.001,100) ; THETA(1) CL UNITS = L/HR (0.001,500) ; THETA(2) V UNITS = L (0.001,2) ; THETA(3) KA UNITS = 1/HR {ADVAN[3]} ;; are initial estimates for K23,K32,K24,K42 needed? {V2~WT[2]} ;;; is initial estimate for Volume a function of weight needed? {V2~GENDER[2]} ;;; is initial estimate for Volume a function of gender needed? {CL~WT[2]} {CL~AGE[2]} {D1LAG[3]} $OMEGA ;; must be one ETA/line 0.2 ; ETA(1) CLEARANCE $OMEGA 0.2 ; ETA(2) VOLUME ;; optional $OMEGA blocks ;; optional initial estimates for ETA on KA {KAETA[2]} ;; optional initial estimates for ETA on D1 and ALAG1 {D1LAG[4]} $SIGMA {RESERR[2]} ;; additive or proportional or combined $EST METHOD=COND INTER MAX = 9999 MSFO=MSF1 $COV UNCOND PRINT=E