Precompute a Plotting Object - Generic Function

DESCRIPTION:
Performs computations that are necessary to plot an object.

This function is generic (see Methods); method functions can be written to handle specific classes of data. Classes which already have methods for this function include: gam, loess.


USAGE:
preplot(object, newdata)

REQUIRED ARGUMENTS:
object:
a fitted model object, such as those produced by gam() and loess().

OPTIONAL ARGUMENTS:
newdata:
a data frame containing the values at which evaluations are required. This is often missing, in which case evaluations are made at the same values used to compute the object. Only those predictors referred to in the right side of the formula in object need be present by name in newdata.

VALUE:
an object set up for plotting to describe the fit, optionally at the location specified in newdata. The purpose of calling preplot() is to precompute information to be used in the plot, without necessarily doing the plot at the same time. The object returned differs depending on the kind of fit (that is, on which method is being used), but in all cases can be given directly to the plot() function. This implies that a suitable plot method has been written for whatever class of object preplot() returns.

DETAILS:
Saves the confidence intervals and fit for future plotting by plot().

SEE ALSO:
gam , loess , plot , predict , preplot .

EXAMPLES:
gam.object <- gam(Kyphosis ~ s(Age,4) + Number, family = binomial,
                  data = kyphosis)
preob <- preplot(gam.object)
plot(preob, resid = T, se = T)