Breaking Down of Model Predictions for lm models
Breaking Down of Model Predictions for lm models
## S3 method for class 'lm' broken( model, new_observation, ..., baseline = 0, predict.function = stats::predict.lm )
model |
a lm model |
new_observation |
a new observation with columns 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. |
predict.function |
function that will calculate predictions out of model (typically |
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) summary(model) new_observation <- iris[1,] br <- broken(model, new_observation) br plot(br) br2 <- broken(model, new_observation, predict.function = betas) br2 plot(br2)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.