Diag.5: Residuals vs Leverage

Description Usage Arguments Value Author(s) Examples

Description

Quick Model Diagnostics in GGplot. Residuals vs Leverage Using the Base version diagnostic plots as a template.

Usage

1
Diag.5(My.Model)

Arguments

My.Model

A model in a list format. eg lm or glm

Value

A ggplot object; a diagnostic plot (modeled on the base version)

Author(s)

Justin Castagna, justin.castagna@students.mq.edu.au

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Residuals vs Leverage
# Test models

lm.1 <- lm(mpg ~ wt,data=mtcars)
glm.1 <- glm(formula= vs ~ wt + disp, data=mtcars, family=binomial)

# Example as function()
Diag.5(lm.1)
Diag.5(glm.1)

# Example with magrittr pipe
lm.1 %>% Diag.5()
glm.1 %>% Diag.5()

# Output shoud be a ggplot object in form of diagnostic plot.

# Coresponding Base example
plot(lm.1, which=5)
plot(glm.1, which=5)

jcastagna/ggDiagnostic documentation built on May 30, 2019, 4:34 p.m.