Description Usage Arguments Value Author(s) See Also Examples
Result table with odds ratios, 95%-CI, test statistics, and p-values from logistic regression models for binary or ordinal variables.
1 2 |
model |
an object of class |
caption |
Table caption. |
label |
A string containing the LaTeX table reference label. |
size |
A string to set 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. |
refLevels |
A character vector of size k number of regressors with custom reference level names. This option is designed when using |
lang |
Language of the confidence intervals term, "english"" (default) or "german". |
short |
A logical, if |
latex |
Logical, if |
rmStat |
Logical, if |
Depending on the value of the argument latex
, the function
either prints LaTeX code or returns a data frame.
Simon Schwab
1 2 3 4 5 6 7 8 9 10 11 | dat = carData::TitanicSurvival
dat$survived = relevel(dat$survived, ref = "yes") # relevel: baseline is survived yes.
model = glm(survived ~ sex + age + passengerClass,
data = dat, family = binomial())
labels = c("female", "1st") # reference levels of the two categorial variables
tableOR(model, latex = FALSE, short = TRUE, refLevels = labels, caption = "Changes in odds for risk of death in the Titanic tragedy.")
## using log regression for ordinal data
dat$passengerClass = factor(dat$passengerClass, ordered = TRUE)
model = MASS::polr(passengerClass ~ sex + age, data = dat, Hess = TRUE)
tableOR(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.