uniBinner {AssocBin}R Documentation

Single margin binning

Description

'uniBinner' is an iterative implementation of a recursive binary partitioning algorithm which accepts the splitting and stopping functions that guide partitioning as arguments and applies them to the margin 'y' alone.

Usage

uniBinner(x, y, stopper, splitter, dropPoints = FALSE)

Arguments

x

factor vector for the the first variable

y

numeric vector of the second variable (to be split)

stopper

function which accepts a list with elements 'x', 'y', 'bnds', 'expn', and 'n' and returns a logical indicating whether a split should occur for the bin defined by that list

splitter

function which accepts a list of lists with elements 'x', 'y', 'bnds', 'expn', and 'n' and returns a list where each element is a list of two corresponding to a split of the bin at that position in the original list

dropPoints

logical; should points be dropped from final bins?

Details

'binner' creates a one-dimensional histogram of 'y' for each categorical value of 'x' by recursively splitting partitions of the data using 'splitter' until 'stopper' indicates that all partitions are not to be split.

Value

A list of lists each with elements 'x', 'y', 'bnds', 'expn', 'n', and 'stopped'.

Author(s)

Chris Salahub


[Package AssocBin version 1.0-0 Index]