Plots the main and two-way interaction effects for objects of class "gsm".
# S3 method for gsm
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, ...)Produces a line or image plot for each requested term in the model.
a fit from gsm.
which terms to include in the plot. The default plots all terms.
a switch indicating if standard errors are required.
number of points to use for line plots. Note sqrt(n) points are used for image plots.
a switch indicating if an intercept should be added to the effect plot(s).
a swith indicating if the user should be prompted before switching plots (if length(terms) > 1)
a switch indicating if the zero line should be added to the effect plot(s).
line type for the zero line (if zero.line = TRUE).
color for the zero line (if zero.line = TRUE).
number of colors to use for image plot(s).
colors to use for image plots. Can input the name of a color palette (see hcl.colors) or a vector of colors to create a palette (see colorRampPalette).
if colors is the name of a palette, should it be reversed? See hcl.colors.
limits to use for image plot(s) when mapping numbers to colors.
color(s) to use for lines when plotting effects of continuous predictors.
location to place the legend for line plots involving interactions.
title for plot (ignored unless plotting a single term).
x-axis label for plot (ignored unless plotting a single term).
y-axis label for plot (ignored unless plotting a single term).
additional arguments passed to plotci or image
Nathaniel E. Helwig <helwig@umn.edu>
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).
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
gsm for fitting sm objects.
# see examples in gsm() help file
?gsm
Run the code above in your browser using DataLab