Learn R Programming

ssym (version 1.5.6)

np.graph: Tool to plot natural cubic splines or P-splines.

Description

np.graph displays a graph of a fitted nonparametric effect, either natural cubic spline or P-spline, from an object of class ssym.

Usage

np.graph(object, which, var, exp, simul, obs, xlab, ylab, xlim, ylim, main)

Arguments

object
an object of the class ssym. This object is returned from the call to ssym.l(), ssym.nl() or ssym.l2().
which
an integer indicating the interest submodel. For example, 1 indicates location submodel, and 2 indicates skewness (or relative dispersion) submodel.
var
character. It allows to choosing the nonparametric effect using the name of the associated explanatory variable.
exp
logical. If TRUE, the fitted nonparametric effect is plotted in exponential scale. Default is FALSE.
simul
logical. If TRUE, the fitted nonparametric effect is plotted jointly with their $95\%$ simultaneous confidence intervals. If TRUE, the fitted nonparametric effect is plotted jointly with their $95\%$ pointwise confidence intervals. Default is TRUE.
obs
logical. If TRUE, the fitted nonparametric effect is plotted jointly with the observed data. Default is FALSE.
xlab
character. An optional label for the x axis.
ylab
character. An optional label for the y axis.
xlim
numeric. An optional range of values for the x axis.
ylim
numeric. An optional range of values for the y axis.
main
character. An optional overall title for the plot.

References

Lancaster, P. and Salkauskas, K. (1986) Curve and Surface Fitting: an introduction. Academic Press, London. 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.55)
#
#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