GenerateCrossTables: Generate Cross Tables

Description Usage Arguments Examples

View source: R/GenerateCrossTables.R

Description

This function generates cross tables for the columns of covariates in a data.table in relation to a binary dependent variable. It returns a list containing the cross tables

Usage

1
GenerateCrossTables(Target, Covariate, DT, Groups, UseLogit = T)

Arguments

Target

The name of the binary dependent variable.

Covariate

The name of the covariates for which the cross tables will be generated on.

DT

A data.table which contains the covariates and the binary dependent variable.

Groups

If the covariate is numeric, how many roughly equal-sized groups should they be divided into. This can be a vector of values. The highest value will first be attempted. If roughly equal-sized groups cannot be created, the second highest value will be attempted. If roughly equal-sized groups cannot be created from the lowest value, the covariate will be treated as categorical with each distinct value being a category.

UseLogit

Argument for NumericalTable()/ CategoricalTable(). 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
2
TableList <- GenerateCrossTables(Target = "am",
Covariate = c("mpg", "cyl", "hp"), Groups = c(3, 4))

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