logRegOrd | R Documentation |
Ordinal Logistic Regression
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)
data |
the data as a data frame |
dep |
a string naming the dependent variable from |
covs |
a vector of strings naming the covariates from |
factors |
a vector of strings naming the fixed factors from
|
blocks |
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 |
refLevels |
a list of lists specifying reference levels of the dependent variable and all the factors |
modelTest |
|
dev |
|
aic |
|
bic |
|
pseudoR2 |
one or more of |
omni |
|
thres |
|
ci |
|
ciWidth |
a number between 50 and 99.9 (default: 95) specifying the confidence interval width |
OR |
|
ciOR |
|
ciWidthOR |
a number between 50 and 99.9 (default: 95) specifying the confidence interval width |
A results object containing:
results$modelFit | a table | ||||
results$modelComp | a table | ||||
results$models | 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)
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
# ----------------------------------------------------
#
#
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.