Learn R Programming

summclust (version 0.7.2)

plot.summclust: Plotting method for objects of type summclust

Description

Plots residual leverage, partial leverage and the leave-one-cluster-out regression coefficients

Usage

# S3 method for summclust
plot(x, ...)

Value

A list containing

residual_leverage

A ggplot of the residual leverages

coef_leverage

A ggplot of the coefficient leverages

coef_beta

A ggplot of the leave-one-out cluster jackknife regression coefficients

Arguments

x

An object of type summclust

...

other optional function arguments

Details

Note that the function requires ggplot2 to be installed.

References

MacKinnon, James G., Morten Ørregaard Nielsen, and Matthew D. Webb. "Leverage, influence, and the jackknife in clustered regression models: Reliable inference using summclust." arXiv preprint arXiv:2205.03288 (2022).

Examples

Run this code

library(summclust)
data(mtcars)
mtcars

fit <- lm(mpg ~ cyl + disp + hp, data = mtcars)
summ <- summclust(fit, params = ~cyl + disp, cluster = ~carb)
summary(summ)
tidy(summ)
plot(summ)

Run the code above in your browser using DataLab