Plot data, the linear model, and a residual plot simultaneously.
lmPlot(
x,
y,
xAxis = 0,
yAxis = 4,
resAxis = 3,
resSymm = TRUE,
wBox = TRUE,
wLine = TRUE,
lCol = "#00000088",
lty = 1,
lwd = 1,
xlab = "",
ylab = "",
marRes = NULL,
col = "#22558888",
pch = 20,
cex = 1.5,
xR = 0.02,
yR = 0.1,
xlim = NULL,
ylim = NULL,
subset = NULL,
parCustom = FALSE,
myHeight = c(1, 0.45),
plots = c("both", "mainOnly", "resOnly"),
highlight = NULL,
hlCol = NULL,
hlCex = 1.5,
hlPch = 20,
na.rm = TRUE,
...
)
The x coordinates of points in the plot.
The y coordinates of points in the plot.
The maximum number of x axis labels.
The maximum number of y axis labels.
The maximum number of y axis labels in the residual plot.
Boolean determining whether the range of the residual plot should be symmetric about zero.
Boolean determining whether a box should be added around each plot.
Boolean determining whether to add a regression line to the plot.
The color of the regression line to be added.
The line type of the regression line to be added.
The line width of the regression line to be added.
A label for the x axis.
A label for the y axis
Margin specified for the residuals.
Color of points.
Plotting character.
Plotting character size.
Scaling the limits of the x axis. Ignored if xlim
specified.
Scaling the limits of the y axis. Ignored if ylim
specified.
Limits for the x axis.
Limits for the y axis.
A subset of the data to be used for the linear model.
If TRUE
, then the plotting margins are not modified
automatically. This value should also be TRUE
if the plots are being
placed within a plot of multiple panels.
A numerical vector of length 2 representing the ratio of the primary plot to the residual plot, in height.
Not currently utilized.
Numerical vector specifying particular points to highlight.
Color of highlighted points.
Size of highlighted points.
Plotting characters of highlighted points.
Remove cases with NA
values.
Additional arguments to plot
.
David Diez
makeTube
lmPlot(satgpa$sat_sum, satgpa$fy_gpa)
lmPlot(gradestv$tv, gradestv$grades,
xAxis = 4,
xlab = "time watching TV", yR = 0.2, highlight = c(1, 15, 20)
)
Run the code above in your browser using DataLab