plot.asp: Plots fitted curves or their derivatives

View source: R/plot.asp.r

plot.aspR Documentation

Plots fitted curves or their derivatives

Description

Plots fitted curves or their derivatives together with simultaneous confidence bands.

Usage

## S3 method for class 'asp'
plot(x, select=NULL, drv=0, bands=TRUE, level=0.95, grid=50, pages=0, 
				plot=TRUE, ylim=NULL, xlab=NULL, ylab=NULL,
     			scb.lwd=1, scb.lty="dotted", shade=FALSE, shade.col=grey(0.85),
     			residuals=FALSE, residuals.col="steelblue", 
     			bayes=FALSE, rug=TRUE,...)

Arguments

x

an asp object created by asp or aspHetero

select

vector specifying which curves in an additive model should be plotted. If NULL, all curves are plotted.

drv

the derivative order. Defaults to 0, i.e. the estimated curves themselves are plotted. First and second derivatives are supported. Does not apply to objects created by scbM.

bands

TRUE in order to include simultaneous confidence bands.

grid

number of points used for the plot, default value 50.

plot

if FALSE no plot is given

ylim

vector or list of vecotrs of limits on y axes. If NULL limits are automatically chosen. If multiple curves are plotted and a two-dimensional vector is given, y axes for all curves will be equal. A list with length equal to the number of smooth curves in the model can be given to specify different y-axes for each smooth.

pages

The number of pages over which to spread the output as in package mgcv. For example, if pages=1 then all terms will be plotted on one page in an automatic fashion. If pages=0 (default) all graphics settings are left as they are.

level

the level of confidence (does not apply to objects created by scbM).

xlab

label for the x axis. A list with length equal to the number of smooth curves in the model can be given to specify different labels for each smooth.

ylab

label for the y axis. A list with length equal to the number of smooth curves in the model can be given to specify different labels for each smooth.

scb.lwd

line width for simultaneous confidence bands

scb.lty

line type for simultaneous confidence bands. Use scb.lty="blank", if you only want to plot the shades.

shade

set to TRUE to produce shaded regions as simultaneous confidence bands for smooths

shade.col

define the color used for shading confidence bands

residuals

if TRUE, partial residuals are added to the plot

residuals.col

color of partial residuals

rug

adds a rug representation (1-d plot) of the data to the plot.

bayes

FALSE for simultaneous confidence bands with (approximate) frequentist coverage probability, TRUE for (approximate) Bayesian coverage probability. See Krivobokova et al. (2010) for details.

...

further arguments to be passed to plot()

Details

plot.asp() first calls scbM and then plot.scbm() to plot an asp object. If plotting takes long (because of a large data set) and you want to plot multiple times with different settings, use scbM and then plot the resulting scbm object with plot.scbm(). Estimated fits are centred to have zero mean. The simultaneous confidence bands have (approximate) frequentist coverage probabilities with automatic bias correction (see references).

Value

grid.x

list of the grid values used

fitted

list of the fitted values on the grid

lcb

list of the lower bounds of the confidence bands

ucb

list of the upper bounds of the confidence bands

drv

the derivative order

Stdev.fit

the standard deviations on the grid

ylim

list of ylim used for plotting

residuals

the partial residuals.

References

Krivobokova, T., Kneib, T., and Claeskens, G. (2010)
Simultaneous confidence bands for penalized spline estimators. Journal of the American Statistical Association, 105(490):852-863.

Wiesenfarth, M., Krivobokova, T., Klasen, S., Sperlich, S. (2012).
Direct Simultaneous Inference in Additive Models and its Application to Model Undernutrition. Journal of the American Statistical Association, 107(500): 1286-1296.

See Also

plot.spm in package SemiPar

Examples

# see asp2()

AdaptFitOS documentation built on July 21, 2022, 5:10 p.m.