makeCOVbin {nlmeVPC}R Documentation

Discretise numeric data into categorical data

Description

Discretise numeric value into a categorical variable using the user-defined breaks. If cutoffs and the number of bins (K) is NULL, find the best number of bins using the optK function and find the best cutoff values using the FindBestCut function.

Usage

makeCOVbin(X,
           K,
           cutoffs,
           adjust0bin = TRUE, ...)

Arguments

X

A numeric vector corresponding to Y.

K

Number of bins.

cutoffs

A numeric vector of two or more unique cut points.

adjust0bin

Adjust bin with 0 observation if TRUE.

...

Arguments to be passed to methods.

Value

The result of binning and the summary of the binning results

References

Lavielle, M. and Bleakley, K. (2011). Automatic data binning for improved visual diagnosis of pharmacometric models. Journal of pharmacokinetics and pharmacodynamics, 38(6), 861-871.

Examples

data(origdata)
CUT = FindBestCut(origdata$TIME,8)$cutoffs
makeCOVbin(origdata$TIME,K=8,cutoffs=CUT)

[Package nlmeVPC version 2.6 Index]