GenerateLogit: Generate Logit

Description Usage Arguments Examples

Description

This function generates a new column containing the conditional logit corresponding to a covariate.

Usage

1
GenerateLogit(Data, CrossTable, Covariate, UseLogit = T)

Arguments

Data

A data.frame or data.table for which a new column will be generated in.

CrossTable

A cross table with the different levels of the covariate.

Covariate

The name of the covariate.

UseLogit

If the value is TRUE, the join will be based on a column named "Logit". Otherwise, it will look for a column named "Score".

Examples

1
2
3
4
5
Discretize a continuous covariate
mtcars[, mpgCat := cut(mpg, breaks = c(10, 17, 21, 35), include.lowest = T)]

Generate the conditional logit
mtcars <- GenerateLogit(mtcars, mpgTable, "mpgCat")

Then-Terence/LiteXploreR documentation built on May 18, 2019, 8:07 p.m.