DFbeta {glmxdiag} | R Documentation |
Visualize DFbetas
Description
Graphical visualization of DFbetas for each observation and chosen variables within input model.
Usage
DFbeta(object, variables, centered = TRUE, label.id, n.label.id,
xlab, ylab, main, pos, pch, cex, lcol, lwd, lty, ...)
Arguments
object |
object of class 'influence', see Details. |
variables |
a vector of characters containing names of variables; if nothing is specified, DFbetas for all variables are plotted. |
centered |
logical, if TRUE the plot is centered on the coefficients of the full model and each point corresponds to the coefficient if the i-th observation is excluded. if FALSE, usual DFbetas centered on zero are plotted. |
label.id |
labels of observations, should be a vector with n elements. |
n.label.id |
number of observations with highest DFbetas to label in the plot. |
xlab |
title for the x axis. |
ylab |
title for the y axis. |
main |
an overall title for the plot. |
pos |
position of observations labels. Values |
pch |
type of points. |
cex |
size of points. |
lcol |
color of line. |
lwd |
width of line. |
lty |
type of line. |
... |
further arguments passed to |
Details
This function only works with objects given as output from influenceDiag
.
DFbetas are calculated as B - B(-i) hence they are not standardized; if centered
is set to TRUE then each plotted point corresponds to B(-i), otherwise to B - B(-i).
Value
Doesn't return a value, called for side effects.
Author(s)
Giuseppe Reale
Examples
data("mtcars")
mod <- glm(mpg ~ cyl + hp + carb, family = Gamma, data = mtcars)
inf <- influenceDiag(mod)
DFbeta(inf, label.id = rownames(mtcars))
DFbeta(inf, variables = 'cyl', label.id = rownames(mtcars), pos = 2)
# to visualize all of them in a single plot
par(mfrow = c(2, 2))
DFbeta(inf, label.id = rownames(mtcars))
# press <Enter> four times
par(mfrow = c(1, 1))