NumericalTable: Cross Table of Numerical Covariates

Description Usage Arguments Examples

View source: R/NumericalTable.R

Description

This function generates a data.table tabulating the different ranges of a continuous covariate and the corresponding probabilities of the binary dependent variable taking the value of 1.

Usage

1
2
3
4
5
6
7
8
9
NumericalTable(
  Target,
  Covariate,
  DT,
  NumberOfBins = 5,
  UseCustomIntervals = F,
  CustomIntervals = NULL,
  UseLogit = T
)

Arguments

Target

The name of binary target to be predicted.

Covariate

The name of the covariate.

DT

A data.table containing both the target and covariate.

NumberOfBins

Number of bins the numerical value to be broken into.

UseCustomIntervals

Allowing a custom set of values to be used for binning.

CustomIntervals

The numerical values of the break points.

UseLogit

If the value is TRUE, Log Odds will be generated. Otherwise, a set of score derived from Log Odds, scaled from 0 to 100, will be generated.

Examples

1
NumericalTable(Target = "am", Covariate = "mpg", Data = mtcars)

Then-Terence/LXR documentation built on March 12, 2021, 12:04 a.m.