| broken.lm {breakDown} | R Documentation |
Create the broken object for lm models
## S3 method for class 'lm' broken(model, new_observation, ..., baseline = 0)
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. |
an object of the broken class
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)