Section author: Ravi Selker, Jonathon Love, Damian Dropmann
Ordinal Logistic Regression (logRegOrd)
Description
Ordinal Logistic Regression
Usage
logRegOrd(
data,
dep,
covs = NULL,
factors = NULL,
blocks = list(list()),
refLevels = NULL,
modelTest = FALSE,
dev = TRUE,
aic = TRUE,
bic = FALSE,
pseudoR2 = list("r2mf"),
omni = FALSE,
thres = FALSE,
ci = FALSE,
ciWidth = 95,
OR = FALSE,
ciOR = FALSE,
ciWidthOR = 95
)
Arguments
|
the data as a data frame |
|
a string naming the dependent variable from |
|
a vector of strings naming the covariates from |
|
a vector of strings naming the fixed factors from |
|
a list containing vectors of strings that name the predictors that are added to the model. The elements are added to the model according to their order in the list |
|
a list of lists specifying reference levels of the dependent variable and all the factors |
|
|
|
|
|
|
|
|
|
one or more of |
|
|
|
|
|
|
|
a number between 50 and 99.9 (default: 95) specifying the confidence interval width |
|
|
|
|
|
a number between 50 and 99.9 (default: 95) specifying the confidence interval width |
Output
A results object containing:
|
a table |
|
a table |
|
an array of model specific results |
Tables can be converted to data frames with asDF or as.data.frame(). For example:
results$modelFit$asDF
as.data.frame(results$modelFit)
Examples
set.seed(1337)
y <- factor(sample(1:3, 100, replace = TRUE))
x1 <- rnorm(100)
x2 <- rnorm(100)
df <- data.frame(y=y, x1=x1, x2=x2)
logRegOrd(data = df, dep = y,
covs = vars(x1, x2),
blocks = list(list("x1", "x2")))
#
# ORDINAL LOGISTIC REGRESSION
#
# Model Fit Measures
# ---------------------------------------
# Model Deviance AIC R²-McF
# ---------------------------------------
# 1 218 226 5.68e-4
# ---------------------------------------
#
#
# MODEL SPECIFIC RESULTS
#
# MODEL 1
#
# Model Coefficients
# ----------------------------------------------------
# Predictor Estimate SE Z p
# ----------------------------------------------------
# x1 0.0579 0.193 0.300 0.764
# x2 0.0330 0.172 0.192 0.848
# ----------------------------------------------------
#
#