View source: R/GLM_functions.R
PlotHat | R Documentation |
This function plots leverage hat values from a glm() model fit against the observation index, and highlights observations with values exceeding a recommended cutoff.
PlotHat(x, id.n = 10)
x |
A glm() model fit object. |
id.n |
An integer specifying how many observations to label. |
=============================================================================
Fox (1997, p. 281) suggested a cutoff value for identifying observations with high leverage hat values in a GLM model. Plotting the hat values against the observation number (row index) and highlighting the values that exceed the cutoff is a quick way to inspect a model fit.
None. This produces a plot via ggplot().
Fox, J. (1997). Applied regression analysis, linear models, and related methods. Thousand Oaks, CA: Sage Publications.
hatco
for leverage cutoff.
m1 <- glm(formula = vs ~ wt + disp, family = binomial, data = mtcars)
PlotHat(m1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.