View source: R/influencePlot.R
influencePlot | R Documentation |
This function creates a “bubble” plot of Studentized residuals versus hat values, with the areas of the circles representing the observations proportional to the value Cook's distance. Vertical reference lines are drawn at twice and three times the average hat value, horizontal reference lines at -2, 0, and 2 on the Studentized-residual scale.
influencePlot(model, ...)
## S3 method for class 'lm'
influencePlot(model, scale=10,
xlab="Hat-Values", ylab="Studentized Residuals", id=TRUE,
fill=TRUE, fill.col=carPalette()[2], fill.alpha=0.5, ...)
## S3 method for class 'lmerMod'
influencePlot(model, ...)
model |
a linear, generalized-linear, or linear mixed model; the |
scale |
a factor to adjust the size of the circles. |
xlab , ylab |
axis labels. |
id |
settings for labelling points; see |
fill |
if |
fill.col |
color to use for the filled points, taken by default from the second element of the |
fill.alpha |
the maximum alpha (opacity) of the points. |
... |
arguments to pass to the |
If points are identified, returns a data frame with the hat values, Studentized residuals and Cook's distance of the identified points. If no points are identified, nothing is returned. This function is primarily used for its side-effect of drawing a plot.
John Fox jfox@mcmaster.ca, minor changes by S. Weisberg sandy@umn.edu and a contribution from Michael Friendly
Fox, J. (2016) Applied Regression Analysis and Generalized Linear Models, Third Edition. Sage.
Fox, J. and Weisberg, S. (2019) An R Companion to Applied Regression, Third Edition, Sage.
cooks.distance
, rstudent
, alpha
, carPalette
,
hatvalues
, showLabels
influencePlot(lm(prestige ~ income + education, data=Duncan))
## Not run: # requires user interaction to identify points
influencePlot(lm(prestige ~ income + education, data=Duncan),
id=list(method="identify"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.