makeCOVbin: Discretise numeric data into categorical data

View source: R/makeCOVbin.R

makeCOVbinR 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)

nlmeVPC documentation built on Dec. 28, 2022, 2:49 a.m.

Related to makeCOVbin in nlmeVPC...