plot.cozigam {COZIGAM}R Documentation

Default COZIGAM plotting

Description

Takes a fitted cozigam object produced by cozigam() and plots the additive component smooth functions, on the scale of the linear predictor.

Usage

## S3 method for class 'cozigam':
plot(x, plot.2d = "contour", too.far = 0, 
    n.1d = 100, n.2d = 30, theta = 30, phi = 30, select = NULL, image.col = "topo", 
    persp.col = "lightblue", contour.col = "red", n.Col = 100, shade.ci = FALSE,
    shade.col = "gray80", Rug = TRUE, ...)

Arguments

x A fitted cozigam object produced by the cozigam function.
plot.2d Plot the 2-dimenional functions using "contour" (default) or "persp".
select Select which term to be plotted, e.g. if you just want the plot for the second smooth term set select=2.
n.1d Number of grid points over which each 1-D function is plotted. Default value 100.
n.2d Square root of number of grid points over which to plot a 2-D function.
theta One of the perspective plot angles; needed if plot.2d="persp".
phi The other perspective plot angle.
too.far If greater than 0 then this is used to determine when a location is too far from data to be plotted when plotting 2-D smooths. This is useful since smooths tend to be unreliable beyond the range of the observed data. The data are scaled into the unit square before deciding what to exclude, and too.far is a distance within the unit square.
shade.ci Logical. If TRUE, produce shaded regions as confidence bands for smooths.
shade.col Define the color used for shading confidence bands.
image.col Define the color used for 2-D image plots.
persp.col Define the color used for 2-D perspective plots.
contour.col Define the color used for the 2-D contour lines.
n.Col Control the number of colors in 2-D image plots.
Rug Logical, if TRUE (default) then the covariate to which the plot applies is displayed as a rug plot at the foot of each plot of a 1-D smooth, and the locations of the covariates are plotted as points on the contour plot representing a 2-D smooth.
... Other graphics parameters to pass on to plotting commands.

Details

Produces default plot showing the smooth components of a fitted cozigam.

Smooths of more than 2 variables are not plotted but a warning is generated instead.

Value

The function simply generates plots.

Author(s)

Hai Liu and Kung-Sik Chan

See Also

cozigam,predict.cozigam

Examples

set.seed(11)
n <- 600
x1 <- runif(n, 0, 1)
x2 <- runif(n, 0, 1)
x3 <- runif(n, 0, 1)

f <- testfn(x1, x2)*4-mean(testfn(x1, x2)*4) + f0(x3)/2-mean(f0(x3)/2)
sig <- 0.5
mu0 <- f + 3
y <- mu0 + rnorm(n, 0, sig)

alpha0 <- -2.2
delta0 <- 1.2
p0 <- .Call("logit_linkinv", alpha0 + delta0 * mu0, PACKAGE = "stats")
z <- rbinom(rep(1,n), 1, p0)
y[z==0] <- 0

res <- cozigam(y~s(x1,x2)+s(x3), conv.crit.out = 1e-4, family = gaussian)

plot(res, plot.2d = "contour", image.col = "topo")
# A perspective plot
plot(res, plot.2d = "persp", select = 1)

[Package COZIGAM version 1.0-1 Index]