plot.sm | R Documentation |
Plots the main and two-way interaction effects for objects of class "sm".
## S3 method for class 'sm'
plot(x, terms = x$terms, se = TRUE, n = 201, intercept = FALSE,
ask = prod(par("mfcol")) < length(terms) && dev.interactive(),
zero.line = TRUE, zero.lty = 3, zero.col = "black", ncolor = 21,
colors = NULL, rev = FALSE, zlim = NULL, lty.col = NULL,
legend.xy = "top", main = NULL, xlab = NULL, ylab = NULL, ...)
x |
a fit from |
terms |
which terms to include in the plot. The default plots all terms. |
se |
a switch indicating if standard errors are required. |
n |
number of points to use for line plots. Note |
intercept |
a switch indicating if an intercept should be added to the effect plot(s). |
ask |
a swith indicating if the user should be prompted before switching plots (if |
zero.line |
a switch indicating if the zero line should be added to the effect plot(s). |
zero.lty |
line type for the zero line (if |
zero.col |
color for the zero line (if |
ncolor |
number of colors to use for image plot(s). |
colors |
colors to use for image plots. Can input the name of a color palette (see |
rev |
if |
zlim |
limits to use for image plot(s) when mapping numbers to colors. |
lty.col |
color(s) to use for lines when plotting effects of continuous predictors. |
legend.xy |
location to place the legend for line plots involving interactions. |
main |
title for plot (ignored unless plotting a single term). |
xlab |
x-axis label for plot (ignored unless plotting a single term). |
ylab |
y-axis label for plot (ignored unless plotting a single term). |
... |
additional arguments passed to |
Plots main and two-way interaction effects for fit smooth models using either line or image plots. The terms
arugment can be used to plot a specific effect term. Main and interaction effects are plotted by creating predictions from the fit model that only include the requested terms (see predict.sm
), and then using either the plotci
function (for line plots) or the image
function (for heatmaps).
Produces a line or image plot for each requested term in the model.
Three-way interaction effects are not plotted.
Nathaniel E. Helwig <helwig@umn.edu>
Helwig, N. E. (2020). Multiple and Generalized Nonparametric Regression. In P. Atkinson, S. Delamont, A. Cernat, J. W. Sakshaug, & R. A. Williams (Eds.), SAGE Research Methods Foundations. https://doi.org/10.4135/9781526421036885885
sm
for fitting sm
objects.
# see examples in sm() help file
?sm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.