Dear NMUsers, I would like to implement a truncated normal distribution for weight for use in a simulation, with a pre-specified mean and standard deviation.
What works so far is this (w.o. truncation, which I found in the NONMEM user guides): $PK IF (ICALL.EQ.4.AND.NEWIND.NE.2) THEN CALL RANDOM(5,R) ENDIF IF (ICALL.EQ.4) WT=70+10*R; mean of 70 with SD 10 $SIM (12345) (...) (...) (...) (54676 NORMAL); I have a total of five random number generators i.e. 4 different covariates, which I want to simulate distributions for. Adding a DOWHILE loop does not seem to work (either I get error messages or NONMEM stagnates after performing the sims and never finishes) - I think it's a coding issue on my part, in regard to the IF THEN ELSE statements and DOWHILE statement: IF (ICALL.EQ.4.AND.NEWIND.NE.2) THEN CALL RANDOM(5,R) ENDIF IF (ICALL.EQ.4) WT=70+10*R; DOWHILE (WT.GT.50.OR.WT.LT.100); truncation limits of 50 and 100 ENDDO Other ways to generate a normal truncated distribution can be coded as (from Metrum Institute course 210): $PK IF (ICALL.EQ.4) THEN WT=THETA(1) + ETA(1) DOWHILE (WT.LT.20.OR.WT.GT.100) CALL SIMETA(ETA) WT=THETA(1) + ETA(1) ENDDO ENDIF $SIM (2345 NEW) Yet, I am unsure of how to incorporate my known mean and standard deviation using this approach. Hope you can help. Thanks in advance. Best regards, Yassine