tableOR | R Documentation |
Result table with odds ratios, 95%-CI, test statistics, and p-values from logistic regression models for binary or ordinal variables.
tableOR(
model,
caption = "",
label = "",
size = "scriptsize",
factorNames = NULL,
table.placement = "ht",
refLevels = NULL,
language = c("english", "german"),
short = FALSE,
latex = TRUE,
rmStat = FALSE,
wald = FALSE
)
model |
Object of class |
caption |
Character vector of length 1 containing the table caption. |
label |
Character vector of length 1 containing the reference label of the Latex table. |
size |
Character vector of length 1 setting LaTeX font site, e.g. "small", "scriptsize", etc. |
factorNames |
A character vector of size k number of factors or regressor with custom factor labels. |
table.placement |
LaTeX table positioning. The default is "ht".
See |
refLevels |
A character vector of size k number of regressors with
custom reference level names. This argument is usuful for objects of class
|
language |
Language of the table, either "english" (default) or "german". |
short |
If |
latex |
If |
rmStat |
Logical, if |
wald |
Logical, if |
The table as data.frame and, depending on the value of the argument latex
,
the function a print of the LaTeX code.
Simon Schwab
tableRegression
, xtable
, print.xtable
data <- carData::TitanicSurvival
# relevel: baseline is survived yes.
data$survived <- relevel(x = data$survived, ref = "yes")
model <- glm(survived ~ sex + age + passengerClass, data = data, family = binomial())
tableOR(model = model, latex = FALSE, short = TRUE,
refLevels = c("female", "1st"),
caption = "Changes in odds for risk of death in the Titanic tragedy.")
## using log regression for ordinal data
data$passengerClass <- factor(x = data$passengerClass, ordered = TRUE)
model <- MASS::polr(passengerClass ~ sex + age, data = data, Hess = TRUE)
tableOR(model = model, latex = FALSE, short = TRUE,
caption = "Changes in odds for being in a lower class, i.e. 2nd or 3rd class")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.