View source: R/diagnostics.glm.R
diagnostics.glm | R Documentation |
Provides regression diagnostics for a generalized linear model fit with
glm
or regress
. Currently, binary logistic
regression models are supported.
## S3 method for class 'glm' diagnostics(x, alpha = 0.4, span = 0.8, plot = TRUE, ...)
x |
an object of class |
alpha |
numeric; transparency for plot points (default=0.4) |
span |
numeric; smoothing parameter for loess fit lines (default=0.8) |
plot |
logical; If |
... |
not currently used |
The diagnostics
function is a wrapper for several
diagnostic plotting functions:
Linearity of the explanatory-response relationships
are assessed via Component + Residual (partial residual) plots
(cr_plots
). If there is a single predictor, a scatter plot
with linear and loess lines is produced.
Multicollinearity is assessed via variance inflation factors
(vif_plot
). If there is a single predictor variable, this section
is skipped.
A influence plot identifies
outliers and influential observations (influence_plot
).
A three component list containing ggplot2
graphs:
crplots, vifplot, and influenceplot.
Each function relies heavily on the car
package. See the
help for individual functions for details.
diagnostics
, vif
,
outlierTest
, influencePlot
,
crPlots
fit <- glm(caesarian ~ age + bp + delivery.time, family = binomial, data = caesarian) diagnostics(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.