Description Usage Arguments Value Author(s) References See Also Examples
checkLogReg
is a wrapper of other functions (auc, binnedplot, gfitLogReg
) to
perform several tests and plots of goodness of fit and residuals from a logistic regression model
1 | checkLogReg(obs, pred, covs = NULL, ...)
|
obs |
numeric vector with observations (either 0 or 1) |
pred |
numeric vector (same length as obs) with fitted model probabilities |
covs |
Optional. A named list of one or more numeric vectors that were used as covariates in the model |
... |
further arguments passed to |
several plots and quantities
Paco
Gelman & Hill (2007)
binnedplot
, plotCalibration
, auc
1 2 3 4 5 6 7 8 9 10 11 | # Generate some data
x <- seq(1:1000)
yhat <- plogis(0.2 + 0.003*x) # inverse logit
y <- rbinom(1000, 1, yhat)
# Fit model and get predicted probabilities
model <- glm(y~x, family="binomial")
ypred <- predict(model, type="response")
checkLogReg(y, ypred)
checkLogReg(y, ypred, covs=list(predictor=x))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.