Re: [NMusers] Use of ACCEPT in $DATA

2017-08-24 Thread Dennis Fisher
Colleagues

My apologies — my question reflected a (complicated) error on my part.  NMTRAN 
/ NONMEM were doing the correct thing.
Of note, Leonid proposed using .EQN — that does not appear to be necessary.

Dennis
 
Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com 




> On Aug 24, 2017, at 3:40 PM, Leonid Gibiansky  
> wrote:
> 
> from the manual:
> 
> "When the IGNORE option is used to filter records from the input file, the 
> .EQ., =, .NE., and /= symbols perform literal string comparisons. To provide 
> a numerical equality comparison, use .EQN. for numerical equals, and .NEN. 
> for numerical not equals."
> 
> May be there is a space there or something, try .EQN.
> 
> Leonid
> 
> 
> On 8/24/2017 6:16 PM, Dennis Fisher wrote:
>> NONMEM 7.4.1
>> Colleagues
>> I am trying to use the ACCEPT option in $DATA in order to select a subset of 
>> records (to evaluate the impact of the # of samples/subject on confidence 
>> intervals).
>> I used the following code:
>> ACCEPT=(TIME=0, TIME=1, TIME=2, TIME=4, TIME=6, TIME=24)
>> NMTRAN then creates a dataset but — to my surprise — TIME=6 is not in the 
>> dataset (all the others are).
>> I am copying the first few rows of the input dataset so that you can see 
>> what is being provided to NMTRAN:
>> ID,AGE,MONTHS,SEX,WT,AMT,RATE,_TIME_,EVID,MDV,REPLICATE,IPRED,CWRES,DV,PRED,RES,WRES
>> 1101,12,144,1,30.054,210.38,841.51,0,1,1,1,0,0,0,0,0,0
>> 1101,12,144,1,30.054,0,0,1,0,0,1,187.42,0,179.28,199.26,-19.979,0
>> 1101,12,144,1,30.054,0,0,2,0,0,1,180.92,0,187.92,194.09,-6.1659,0
>> 1101,12,144,1,30.054,0,0,4,0,0,1,169.84,0,177.66,184.37,-6.712,0
>> 1101,12,144,1,30.054,0,0,_6_,0,0,1,160.61,0,153.43,175.39,-21.96,0
>> The underlined / boldfaced value (6) in the final row is the problem.
>> I assume that NMTRAN is reading that value as something other than 6.0 
>> (e.g., 6.01) and thereby omitting it.
>> I have reviewed NMHELP to see if there is some other way to accomplish this. 
>>  Ideally, there would be something like:
>> TIME.GT.5.9.AND.TIME.LT.6.1
>> but that does not appear to be supported.
>> The alternative is to modify the dataset to include many possible MDV/EVID 
>> columns.  However, it would be more elegant to do this in the control stream.
>> Or, if there is some way to find out the exact value that NMTRAN sees, I 
>> could specify that value.
>> Any help would be appreciated.
>> Dennis
>> Dennis Fisher MD
>> P < (The "P Less Than" Company)
>> Phone / Fax: 1-866-PLessThan (1-866-753-7784)
>> www.PLessThan.com  > >



Re: [NMusers] Use of ACCEPT in $DATA

2017-08-24 Thread Dennis Fisher
Sergei

I would accept that if the problem related to decimals.  Your code does not 
apply to integers (please provide an example if that is the case) - so it would 
only apply if NMTRAN does something weird to integers.

Dennis


Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com <http://www.plessthan.com/>




> On Aug 24, 2017, at 4:25 PM, Leonov, Sergei <sergei.leo...@iconplc.com> wrote:
> 
> Hi Dennis,
>  
> Unfortunately, my reply will not provide a solution to your problem. It is 
> more about drawing attention to the fact that checking conditions numerically 
> is not exactly the same as checking conditions on a piece of a paper, because 
> of rounding. I’m sure that the users of the List are well aware of this fact, 
> just a reminder…
>  
> A simple example, I did this in Matlab, you can repeat it in R or other 
> programming language. I won’t waste your time by describing how I came to 
> this example. Compare the output of two expressions:
> >> a1=0.06;
> >> a2=0.05 + 0.01;
>  
> You would expect the equality between the two values, a1 and a2, right? True, 
> on paper. Here is the output of these two values with 20 decimals.
> >> fprintf('%22.20f\n',a1)
> 0.05999800
> >> fprintf('%22.20f\n',a2)
> 0.06000500
> And, of course, the output of the logical expression (a1 ==a2) is FALSE.
>  
> Regards,
> Sergei Leonov
> ICON Innovation Center
>  
> From: owner-nmus...@globomaxnm.com [mailto:owner-nmus...@globomaxnm.com] On 
> Behalf Of Bill Denney
> Sent: Thursday, August 24, 2017 6:45 PM
> To: Dennis Fisher; nmusers@globomaxnm.com
> Subject: RE: [NMusers] Use of ACCEPT in $DATA
>  
> Hi Dennis,
>  
> I don’t have an elegant solution for you (and I’ve been pining for the use of 
> combined Boolean operations like “TIME.GT.5.9.AND.TIME.LT.6.1” for a long 
> time).
>  
> An inelegant solution could be to run the model once with a write statement 
> to see if you can identify the value like 6.001 and use it.  That would 
> probably be fragile to different processor/compiler/math library 
> combinations, so I’d probably end up making the additional indicator column 
> for certainty.
> 
> Thanks,
>  
> Bill
>  
> From: owner-nmus...@globomaxnm.com <mailto:owner-nmus...@globomaxnm.com> 
> [mailto:owner-nmus...@globomaxnm.com <mailto:owner-nmus...@globomaxnm.com>] 
> On Behalf Of Dennis Fisher
> Sent: Thursday, August 24, 2017 6:16 PM
> To: nmusers@globomaxnm.com <mailto:nmusers@globomaxnm.com>
> Subject: [NMusers] Use of ACCEPT in $DATA
>  
> NONMEM 7.4.1
>  
> Colleagues
>  
> I am trying to use the ACCEPT option in $DATA in order to select a subset of 
> records (to evaluate the impact of the # of samples/subject on confidence 
> intervals).
>  
> I used the following code:
>ACCEPT=(TIME=0, TIME=1, TIME=2, TIME=4, TIME=6, TIME=24)
>  
> NMTRAN then creates a dataset but — to my surprise — TIME=6 is not in the 
> dataset (all the others are).
>  
> I am copying the first few rows of the input dataset so that you can see what 
> is being provided to NMTRAN:
>  
> ID,AGE,MONTHS,SEX,WT,AMT,RATE,TIME,EVID,MDV,REPLICATE,IPRED,CWRES,DV,PRED,RES,WRES
> 1101,12,144,1,30.054,210.38,841.51,0,1,1,1,0,0,0,0,0,0
> 1101,12,144,1,30.054,0,0,1,0,0,1,187.42,0,179.28,199.26,-19.979,0
> 1101,12,144,1,30.054,0,0,2,0,0,1,180.92,0,187.92,194.09,-6.1659,0
> 1101,12,144,1,30.054,0,0,4,0,0,1,169.84,0,177.66,184.37,-6.712,0
> 1101,12,144,1,30.054,0,0,6,0,0,1,160.61,0,153.43,175.39,-21.96,0
>  
> The underlined / boldfaced value (6) in the final row is the problem.
>  
> I assume that NMTRAN is reading that value as something other than 6.0 (e.g., 
> 6.01) and thereby omitting it.  
>  
> I have reviewed NMHELP to see if there is some other way to accomplish this.  
> Ideally, there would be something like:
>TIME.GT.5.9.AND.TIME.LT.6.1
> but that does not appear to be supported.
>  
> The alternative is to modify the dataset to include many possible MDV/EVID 
> columns.  However, it would be more elegant to do this in the control stream.
> Or, if there is some way to find out the exact value that NMTRAN sees, I 
> could specify that value.
>  
> Any help would be appreciated.
>  
> Dennis
>  
> Dennis Fisher MD
> P < (The "P Less Than" Company)
> Phone / Fax: 1-866-PLessThan (1-866-753-7784)
> www.PLessThan.com <http://www.plessthan.com/>
>  
>  
> 
>  
> 
> 
> ICON plc made the following annotations. 
> --
>  

RE: [NMusers] Use of ACCEPT in $DATA

2017-08-24 Thread Leonov, Sergei
Hi Dennis,

Unfortunately, my reply will not provide a solution to your problem. It is more 
about drawing attention to the fact that checking conditions numerically is not 
exactly the same as checking conditions on a piece of a paper, because of 
rounding. I’m sure that the users of the List are well aware of this fact, just 
a reminder…

A simple example, I did this in Matlab, you can repeat it in R or other 
programming language. I won’t waste your time by describing how I came to this 
example. Compare the output of two expressions:
>> a1=0.06;
>> a2=0.05 + 0.01;

You would expect the equality between the two values, a1 and a2, right? True, 
on paper. Here is the output of these two values with 20 decimals.
>> fprintf('%22.20f\n',a1)
0.05999800
>> fprintf('%22.20f\n',a2)
0.06000500
And, of course, the output of the logical expression (a1 ==a2) is FALSE.

Regards,
Sergei Leonov
ICON Innovation Center

From: owner-nmus...@globomaxnm.com [mailto:owner-nmus...@globomaxnm.com] On 
Behalf Of Bill Denney
Sent: Thursday, August 24, 2017 6:45 PM
To: Dennis Fisher; nmusers@globomaxnm.com
Subject: RE: [NMusers] Use of ACCEPT in $DATA

Hi Dennis,

I don’t have an elegant solution for you (and I’ve been pining for the use of 
combined Boolean operations like “TIME.GT.5.9.AND.TIME.LT.6.1” for a long time).

An inelegant solution could be to run the model once with a write statement to 
see if you can identify the value like 6.001 and use it.  That would 
probably be fragile to different processor/compiler/math library combinations, 
so I’d probably end up making the additional indicator column for certainty.

Thanks,

Bill

From: owner-nmus...@globomaxnm.com<mailto:owner-nmus...@globomaxnm.com> 
[mailto:owner-nmus...@globomaxnm.com<mailto:owner-nmus...@globomaxnm.com>] On 
Behalf Of Dennis Fisher
Sent: Thursday, August 24, 2017 6:16 PM
To: nmusers@globomaxnm.com<mailto:nmusers@globomaxnm.com>
Subject: [NMusers] Use of ACCEPT in $DATA

NONMEM 7.4.1

Colleagues

I am trying to use the ACCEPT option in $DATA in order to select a subset of 
records (to evaluate the impact of the # of samples/subject on confidence 
intervals).

I used the following code:
   ACCEPT=(TIME=0, TIME=1, TIME=2, TIME=4, TIME=6, TIME=24)

NMTRAN then creates a dataset but — to my surprise — TIME=6 is not in the 
dataset (all the others are).

I am copying the first few rows of the input dataset so that you can see what 
is being provided to NMTRAN:

ID,AGE,MONTHS,SEX,WT,AMT,RATE,TIME,EVID,MDV,REPLICATE,IPRED,CWRES,DV,PRED,RES,WRES
1101,12,144,1,30.054,210.38,841.51,0,1,1,1,0,0,0,0,0,0
1101,12,144,1,30.054,0,0,1,0,0,1,187.42,0,179.28,199.26,-19.979,0
1101,12,144,1,30.054,0,0,2,0,0,1,180.92,0,187.92,194.09,-6.1659,0
1101,12,144,1,30.054,0,0,4,0,0,1,169.84,0,177.66,184.37,-6.712,0
1101,12,144,1,30.054,0,0,6,0,0,1,160.61,0,153.43,175.39,-21.96,0

The underlined / boldfaced value (6) in the final row is the problem.

I assume that NMTRAN is reading that value as something other than 6.0 (e.g., 
6.01) and thereby omitting it.

I have reviewed NMHELP to see if there is some other way to accomplish this.  
Ideally, there would be something like:
   TIME.GT.5.9.AND.TIME.LT.6.1
but that does not appear to be supported.

The alternative is to modify the dataset to include many possible MDV/EVID 
columns.  However, it would be more elegant to do this in the control stream.
Or, if there is some way to find out the exact value that NMTRAN sees, I could 
specify that value.

Any help would be appreciated.

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com<http://www.plessthan.com/>

ICON plc made the following annotations.
--
This e-mail transmission may contain confidential or legally privileged 
information that is intended only for the individual or entity named in the 
e-mail address. If you
are not the intended recipient, you are hereby notified that any disclosure, 
copying, distribution, or reliance upon the contents of this e-mail is strictly 
prohibited. If
you have received this e-mail transmission in error, please reply to the 
sender, so that ICON plc can arrange for proper delivery, and then please 
delete the message.

Thank You,

ICON plc
South County Business Park
Leopardstown
Dublin 18
Ireland
Registered number: 145835


Re: [NMusers] Use of ACCEPT in $DATA

2017-08-24 Thread Devin Pastoor
Similar to Bill, I also have an inelegant, but workable, solution, which is
to brute force the ignore times by templating them in R.

For example, you can use a simple glue template to churn out ignore
statements. For simplicity this could then be then just copied into control
streams.

library(whisker)
all_times <- c(0, 1, 2, 4, 6, 8, 10, 12, 14, 16, 20, 24)keep_times <-
c(0, 1, 2, 4, 6, 24)drop_times <- all_times[!(all_times %in%
keep_times)]glue::glue(
  "IGNORE=(TIME.EQN.{time})", time = drop_times
  )#> IGNORE=(TIME.EQN.8)#> IGNORE=(TIME.EQN.10)#>
IGNORE=(TIME.EQN.12)#> IGNORE=(TIME.EQN.14)#> IGNORE=(TIME.EQN.16)#>
IGNORE=(TIME.EQN.20)

# make multiple time scenarios and generate the ignores for all of
them in one goscenarios = list(
  c(0, 1, 2, 4, 6, 24),
  c(0, 2, 4, 8, 24))
lapply(scenarios, function(.s) {
  all_times <- c(0, 1, 2, 4, 6, 8, 10, 12, 14, 16, 20, 24)
  keep_times <- .s
  drop_times <- all_times[!(all_times %in% keep_times)]
  glue::glue(
"IGNORE=(TIME.EQN.{time})", time = drop_times
  )})#> [[1]]#> IGNORE=(TIME.EQN.8)#> IGNORE=(TIME.EQN.10)#>
IGNORE=(TIME.EQN.12)#> IGNORE=(TIME.EQN.14)#> IGNORE=(TIME.EQN.16)#>
IGNORE=(TIME.EQN.20)#> #> [[2]]#> IGNORE=(TIME.EQN.1)#>
IGNORE=(TIME.EQN.6)#> IGNORE=(TIME.EQN.10)#> IGNORE=(TIME.EQN.12)#>
IGNORE=(TIME.EQN.14)#> IGNORE=(TIME.EQN.16)#> IGNORE=(TIME.EQN.20)


If you want something more automated and powerful, at the expense of more R
code, you can use the whisker library to actually use full templates. I've
done some bayesian prior sensitivity analysis generating 1000's of control
streams to great success that way. If this is of interest, speak up and I
can provide a more complete example.

Cheers,

Devin

On Thu, Aug 24, 2017 at 6:48 PM Bill Denney 
wrote:

> Hi Dennis,
>
>
>
> I don’t have an elegant solution for you (and I’ve been pining for the use
> of combined Boolean operations like “TIME.GT.5.9.AND.TIME.LT.6.1” for a
> long time).
>
>
>
> An inelegant solution could be to run the model once with a write
> statement to see if you can identify the value like 6.001 and use it.
> That would probably be fragile to different processor/compiler/math library
> combinations, so I’d probably end up making the additional indicator column
> for certainty.
>
>
> Thanks,
>
>
>
> Bill
>
>
>
> *From:* owner-nmus...@globomaxnm.com [mailto:owner-nmus...@globomaxnm.com]
> *On Behalf Of *Dennis Fisher
> *Sent:* Thursday, August 24, 2017 6:16 PM
> *To:* nmusers@globomaxnm.com
> *Subject:* [NMusers] Use of ACCEPT in $DATA
>
>
>
> NONMEM 7.4.1
>
>
>
> Colleagues
>
>
>
> I am trying to use the ACCEPT option in $DATA in order to select a subset
> of records (to evaluate the impact of the # of samples/subject on
> confidence intervals).
>
>
>
> I used the following code:
>
>ACCEPT=(TIME=0, TIME=1, TIME=2, TIME=4, TIME=6, TIME=24)
>
>
>
> NMTRAN then creates a dataset but — to my surprise — TIME=6 is not in the
> dataset (all the others are).
>
>
>
> I am copying the first few rows of the input dataset so that you can see
> what is being provided to NMTRAN:
>
>
>
> ID,AGE,MONTHS,SEX,WT,AMT,RATE,*TIME*
> ,EVID,MDV,REPLICATE,IPRED,CWRES,DV,PRED,RES,WRES
> 1101,12,144,1,30.054,210.38,841.51,0,1,1,1,0,0,0,0,0,0
> 1101,12,144,1,30.054,0,0,1,0,0,1,187.42,0,179.28,199.26,-19.979,0
> 1101,12,144,1,30.054,0,0,2,0,0,1,180.92,0,187.92,194.09,-6.1659,0
> 1101,12,144,1,30.054,0,0,4,0,0,1,169.84,0,177.66,184.37,-6.712,0
> 1101,12,144,1,30.054,0,0,*6*,0,0,1,160.61,0,153.43,175.39,-21.96,0
>
>
>
> The underlined / boldfaced value (6) in the final row is the problem.
>
>
>
> I assume that NMTRAN is reading that value as something other than 6.0
> (e.g., 6.01) and thereby omitting it.
>
>
>
> I have reviewed NMHELP to see if there is some other way to accomplish
> this.  Ideally, there would be something like:
>
>TIME.GT.5.9.AND.TIME.LT.6.1
>
> but that does not appear to be supported.
>
>
>
> The alternative is to modify the dataset to include many possible MDV/EVID
> columns.  However, it would be more elegant to do this in the control
> stream.
>
> Or, if there is some way to find out the exact value that NMTRAN sees, I
> could specify that value.
>
>
>
> Any help would be appreciated.
>
>
>
> Dennis
>
>
>
> Dennis Fisher MD
> P < (The "P Less Than" Company)
> Phone / Fax: 1-866-PLessThan (1-866-753-7784 <(866)%20753-7784>)
> www.PLessThan.com 
>
>
>
>
>
>
>


RE: [NMusers] Use of ACCEPT in $DATA

2017-08-24 Thread Bill Denney
Hi Dennis,



I don’t have an elegant solution for you (and I’ve been pining for the use
of combined Boolean operations like “TIME.GT.5.9.AND.TIME.LT.6.1” for a
long time).



An inelegant solution could be to run the model once with a write statement
to see if you can identify the value like 6.001 and use it.  That would
probably be fragile to different processor/compiler/math library
combinations, so I’d probably end up making the additional indicator column
for certainty.


Thanks,



Bill



*From:* owner-nmus...@globomaxnm.com [mailto:owner-nmus...@globomaxnm.com] *On
Behalf Of *Dennis Fisher
*Sent:* Thursday, August 24, 2017 6:16 PM
*To:* nmusers@globomaxnm.com
*Subject:* [NMusers] Use of ACCEPT in $DATA



NONMEM 7.4.1



Colleagues



I am trying to use the ACCEPT option in $DATA in order to select a subset
of records (to evaluate the impact of the # of samples/subject on
confidence intervals).



I used the following code:

   ACCEPT=(TIME=0, TIME=1, TIME=2, TIME=4, TIME=6, TIME=24)



NMTRAN then creates a dataset but — to my surprise — TIME=6 is not in the
dataset (all the others are).



I am copying the first few rows of the input dataset so that you can see
what is being provided to NMTRAN:



ID,AGE,MONTHS,SEX,WT,AMT,RATE,*TIME*
,EVID,MDV,REPLICATE,IPRED,CWRES,DV,PRED,RES,WRES
1101,12,144,1,30.054,210.38,841.51,0,1,1,1,0,0,0,0,0,0
1101,12,144,1,30.054,0,0,1,0,0,1,187.42,0,179.28,199.26,-19.979,0
1101,12,144,1,30.054,0,0,2,0,0,1,180.92,0,187.92,194.09,-6.1659,0
1101,12,144,1,30.054,0,0,4,0,0,1,169.84,0,177.66,184.37,-6.712,0
1101,12,144,1,30.054,0,0,*6*,0,0,1,160.61,0,153.43,175.39,-21.96,0



The underlined / boldfaced value (6) in the final row is the problem.



I assume that NMTRAN is reading that value as something other than 6.0
(e.g., 6.01) and thereby omitting it.



I have reviewed NMHELP to see if there is some other way to accomplish
this.  Ideally, there would be something like:

   TIME.GT.5.9.AND.TIME.LT.6.1

but that does not appear to be supported.



The alternative is to modify the dataset to include many possible MDV/EVID
columns.  However, it would be more elegant to do this in the control
stream.

Or, if there is some way to find out the exact value that NMTRAN sees, I
could specify that value.



Any help would be appreciated.



Dennis



Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com 


Re: [NMusers] Use of ACCEPT in $DATA

2017-08-24 Thread Leonid Gibiansky

from the manual:

"When the IGNORE option is used to filter records from the input file, 
the .EQ., =, .NE., and /= symbols perform literal string comparisons. To 
provide a numerical equality comparison, use .EQN. for numerical equals, 
and .NEN. for numerical not equals."


May be there is a space there or something, try .EQN.

Leonid


On 8/24/2017 6:16 PM, Dennis Fisher wrote:

NONMEM 7.4.1

Colleagues

I am trying to use the ACCEPT option in $DATA in order to select a 
subset of records (to evaluate the impact of the # of samples/subject on 
confidence intervals).


I used the following code:
ACCEPT=(TIME=0, TIME=1, TIME=2, TIME=4, TIME=6, TIME=24)

NMTRAN then creates a dataset but — to my surprise — TIME=6 is not in 
the dataset (all the others are).


I am copying the first few rows of the input dataset so that you can see 
what is being provided to NMTRAN:


ID,AGE,MONTHS,SEX,WT,AMT,RATE,_TIME_,EVID,MDV,REPLICATE,IPRED,CWRES,DV,PRED,RES,WRES
1101,12,144,1,30.054,210.38,841.51,0,1,1,1,0,0,0,0,0,0
1101,12,144,1,30.054,0,0,1,0,0,1,187.42,0,179.28,199.26,-19.979,0
1101,12,144,1,30.054,0,0,2,0,0,1,180.92,0,187.92,194.09,-6.1659,0
1101,12,144,1,30.054,0,0,4,0,0,1,169.84,0,177.66,184.37,-6.712,0
1101,12,144,1,30.054,0,0,_6_,0,0,1,160.61,0,153.43,175.39,-21.96,0

The underlined / boldfaced value (6) in the final row is the problem.

I assume that NMTRAN is reading that value as something other than 6.0 
(e.g., 6.01) and thereby omitting it.


I have reviewed NMHELP to see if there is some other way to accomplish 
this.  Ideally, there would be something like:

TIME.GT.5.9.AND.TIME.LT.6.1
but that does not appear to be supported.

The alternative is to modify the dataset to include many possible 
MDV/EVID columns.  However, it would be more elegant to do this in the 
control stream.
Or, if there is some way to find out the exact value that NMTRAN sees, I 
could specify that value.


Any help would be appreciated.

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com