broken.lm {breakDown}R Documentation

Create the broken object for lm models

Description

Create the broken object for lm models

Usage

## S3 method for class 'lm'
broken(model, new_observation, ..., baseline = 0)

Arguments

model

a lm model

new_observation

a new observation with collumns that corresponds to variables used in the model

...

other parameters

baseline

the orgin/baseline for the breakDown plots, where the rectangles start. It may be a number or a character "Intercept". In the latter case the orgin will be set to model intercept.

Value

an object of the broken class

Examples

model <- lm(Sepal.Length~., data=iris)
new_observation <- iris[1,]
br <- broken(model, new_observation)
plot(br)

# works for interactions as well
model <- lm(Sepal.Length ~ Petal.Width*Species, data = iris)
new_observation <- iris[1,]
br <- broken(model, new_observation)
plot(br)

[Package breakDown version 0.1.3 Index]