Description Usage Arguments Examples
View source: R/GenerateLogit.R
This function generates a new column containing the conditional logit corresponding to a covariate.
1 2 3 4 5 6 7 8 | GenerateLogit(
DT,
CrossTable,
Covariate,
Suffix = "Logit",
SelectCol = NULL,
NewName = NULL
)
|
CrossTable |
A cross table with the different levels of the covariate. |
Covariate |
The name of the covariate. |
Data |
A data.frame or data.table for which a new column will be generated in. |
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". |
1 2 3 4 5 6 7 8 | Discretize a continuous covariate
mtcars[, mpgCat := cut(mpg, breaks = c(10, 17, 21, 35), include.lowest = T)]
Generate a cross table
mpgTable <- CategoricalTable("am", "mpgCat", mtcars)
Generate the conditional logit
GenerateLogit(mtcars, mpgTable, "mpgCat")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.