Learn R Programming

ssym (version 1.5.2)

np.graph: Tool for plotting natural cubic splines and P-splines

Description

np.graph displays a graph of a fitted non-parametric effect (either natural cubic spline or P-spline) from a object of class ``ssym".

Usage

np.graph(object, which, exp, xlab, ylab, main)

Arguments

object
object of class ``ssym" produced by ssym.l() or ssym.nl().
which
an integer indicating the interest submodel, e.g., 1 indicates location submodel, and 2 indicates dispersion submodel.
exp
logical. Should the fitted non-parametric effect be plotted in exponential scale? Default is FALSE.
xlab
an optional title for the x axis.
ylab
an optional title for the y axis.
main
an optional overall title for the plot.

References

Green, P.J. and Silverman, B.W. (1994) Nonparametric Regression and Generalized Linear Models, Boca Raton: Chapman and Hall. Eilers P.H.C. and Marx B.D. (1996). Flexible smoothing with B-splines and penalties. Statistical Science. 11, 89-121.

Examples

Run this code
data("Ovocytes", package="ssym")
fit <- ssym.l(fraction ~ type + psp(time) | type + psp(time), data=Ovocytes,
              family='Powerexp', xi=-0.65)

par(mfrow = c(1,2))
np.graph(fit, which=1, xlab="Time", main="Location")
np.graph(fit, which=2, exp=TRUE, xlab="Time", main="Dispersion")

Run the code above in your browser using DataLab