logRegBin | R Documentation |
Binomial Logistic Regression
logRegBin(data, dep, covs = NULL, factors = NULL,
blocks = list(list()), refLevels = NULL, modelTest = FALSE,
dev = TRUE, aic = TRUE, bic = FALSE, pseudoR2 = list("r2mf"),
omni = FALSE, ci = FALSE, ciWidth = 95, OR = FALSE,
ciOR = FALSE, ciWidthOR = 95, emMeans = list(list()),
ciEmm = TRUE, ciWidthEmm = 95, emmPlots = TRUE,
emmTables = FALSE, emmWeights = TRUE, class = FALSE, acc = FALSE,
spec = FALSE, sens = FALSE, auc = FALSE, rocPlot = FALSE,
cutOff = 0.5, cutOffPlot = FALSE, collin = FALSE,
boxTidwell = FALSE, cooks = FALSE)
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 |
|
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 |
emMeans |
a list of lists specifying the variables for which the estimated marginal means need to be calculate. Supports up to three variables per term. |
ciEmm |
|
ciWidthEmm |
a number between 50 and 99.9 (default: 95) specifying the confidence interval width for the estimated marginal means |
emmPlots |
|
emmTables |
|
emmWeights |
|
class |
|
acc |
|
spec |
|
sens |
|
auc |
|
rocPlot |
|
cutOff |
|
cutOffPlot |
|
collin |
|
boxTidwell |
|
cooks |
|
A results object containing:
results$modelFit | a table | ||||
results$modelComp | a table | ||||
results$models | an array of model specific results | ||||
results$predictOV | an output | ||||
results$residsOV | an output | ||||
results$cooksOV | an output | ||||
Tables can be converted to data frames with asDF
or as.data.frame
. For example:
results$modelFit$asDF
as.data.frame(results$modelFit)
data('birthwt', package='MASS')
dat <- data.frame(
low = factor(birthwt$low),
age = birthwt$age,
bwt = birthwt$bwt)
logRegBin(data = dat, dep = low,
covs = vars(age, bwt),
blocks = list(list("age", "bwt")),
refLevels = list(list(var="low", ref="0")))
#
# BINOMIAL LOGISTIC REGRESSION
#
# Model Fit Measures
# ---------------------------------------
# Model Deviance AIC R²-McF
# ---------------------------------------
# 1 4.97e-7 6.00 1.000
# ---------------------------------------
#
#
# MODEL SPECIFIC RESULTS
#
# MODEL 1
#
# Model Coefficients
# ------------------------------------------------------------
# Predictor Estimate SE Z p
# ------------------------------------------------------------
# Intercept 2974.73225 218237.2 0.0136 0.989
# age -0.00653 482.7 -1.35e-5 1.000
# bwt -1.18532 87.0 -0.0136 0.989
# ------------------------------------------------------------
# Note. Estimates represent the log odds of "low = 1"
# vs. "low = 0"
#
#
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.