powered by
This function provides several plots of the result of fitting a simple two-predictor linear model.
# S3 method for lm plot3d(x, which = 1, plane.col = "gray", plane.alpha = 0.5, sharedMouse = TRUE, ...)
An object of class "lm" resulting from fitting a two-predictor linear model.
"lm"
Which plot to show? See Details below.
All plots draw a plane; these parameters control its colour and transparency respectively.
If multiple plots are requested, should they share mouse controls, so that they move in sync?
Other parameters to pass to the default plot3d method, to control the appearance of aspects of the plot other than the plane.
plot3d
Called for the side effect of drawing one or more plots.
Invisibly returns a high-level vector of object ids. Names of object ids have the plot number (in drawing order) appended.
Three plots are possible, depending on the value(s) in which:
which
(default) Show the points and the fitted plane.
Show the residuals and the plane at z = 0.
z = 0
Show the predicted values on the fitted plane.
# NOT RUN { ids <- plot3d(lm(mpg ~ wt + qsec, data = mtcars), which = 1:3) names(ids) # }
Run the code above in your browser using DataLab