preplot.gam Object
preplot.gam object.
gplot(x, y, se.y = NULL, xlab = "", ylab = "", residuals = NULL,
rugplot = F, scale = 0, se = F, fit = T, ...)
x variable for plotting
y; can be
NULL.
y; can be
NULL.
TRUE, a
rugplot is produced at the base of the plot
TRUE, pointwise standard errors are included in the plot
TRUE, plot a curve to the data.
This is a generic plotting function for representing fitted
gam functions.
The type of function plot depends on the class of
x.
Methods exists for several data classes.
The default behavior is to produce no plot and issue a warning.
If
x is
numeric, the function is represented by a polygon
connecting the fitted values
y ordered by
x.
If the class is
factor, the values of
y are constant within
each level of
x, and the function is represented by a step-function.
If
x is a
list (with two numeric variables),
or
matrix (2 column), the function is represented by a perspective surface.
gplot is not called directly by users; rather,
it is called by
plot.preplot.gam, the plot method
for
preplot.gam objects. Such an object is a list of fitted terms,
each of which has components
x,
y,
se.y, etc,
and
plot.preplot.gam simply dispatches them as arguments to
gplot.
Users will occasionally encounter examples where no
gplot method
corresponding to the data class of
x exists.
In this case, no plot is produced, and two possible avenues exist.
Either one can write a new
gplot method for that particular class
which would then be available for all future encounters, or one could
simply construct a plot on a one time basis using the precomputed
data in the
preplot.gam object.