addl: Calculate a NONMEM ADDL data item from explicit records.

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

The NONMEM data item ADDL on a dose record expresses the number of additional implicit doses that should follow at a regular interval II. In the case where explicit doses exist, addl supports compacting them into ADDL/II notation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
	## Default S3 method:
addl(x, interval=1,...)
	## S3 method for class 'data.frame'
addl(
		x, 
		interval=24, 
		collapse=TRUE,
		cols=c('SUBJ','TIME','AMT','ADDL','II'),
		...
	)

Arguments

x

numeric

interval

numeric, e.g. hours

collapse

boolean: drop explicit records that are implied by ADDL

cols

conventional column names, as for as.nm

...

ignored

Details

For the default method, if an element of x is followed by n elements that occur at a fixed interval interval, n is returned at that position and NA is returned for each of the following elements. n may be zero.

It is the responsibility of the user to apply the function to meaningful subsets of the data, if any: e.g., sequential records with common subject and dose.

For the data.frame method, an attempt is made to apply the default method, making assumptions about the structure of the data set. An error results if non-zero ADDL is calculated where ADDL is already non-zero. If collapse is TRUE, superfluous records are dropped; otherwise, their rownames are prefixed with "-".

Value

a numeric vector as long as x

Author(s)

Tim Bergsma

References

http://metrumrg.googlecode.com

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
test <- data.frame(
	SUBJ=c(1,1,1,1,1,2,2,2,2,2),
	TIME=c(1,2,3,4,5,1,2,3,4,5),
	EVID=c(1,1,1,1,0,1,1,1,1,0),
	AMT =c(1,1,1,1,0,1,1,1,2,0),
	DV  =c(0,0,0,0,1,0,0,0,0,1)
)
test
addl(test,interval=1)
addl(test,interval=1,collapse=FALSE)

metrumrg documentation built on May 2, 2019, 5:55 p.m.