plot.cozigam {COZIGAM} | R Documentation |
Takes a fitted cozigam
object produced by cozigam()
and plots
the component smooth functions that make it up, on the scale of the linear predictor.
## 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, xlab, ylab, ...)
x |
A fitted cozigam object produced by cozigam() . |
plot.2d |
One of ``contour" (default) or ``persp". |
select |
Allows the plot for a single model term to be selected for printing.
e.g. if you just want the plot for the second smooth term set select=2. |
n.1d |
Number of points used for each 1-D plot. Default value 100. |
n.2d |
Square root of number of points used to grid estimates of 2-D functions for contouring. |
theta |
One of the perspective plot angles. |
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 go wild away from 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. |
xlab, ylab |
Titles for the x and y axes. |
... |
Other graphics parameters to pass on to plotting commands. |
Produces default plot showing the smooth components of a fitted cozigam
.
Smooths of more than 2 variables are not currently dealt with, but simply generate a warning.
The function simply generates plots.
Hai Liu and Kung-Sik Chan
set.seed(11) n <- 400 x1 <- runif(n, 0, 1) x2 <- runif(n, 0, 1) x3 <- runif(n, 0, 1) f <- test(x1,x2)*4-mean(test(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), constraint = "proportional", family = gaussian) plot(res, plot.2d = "contour", image.col="topo") # contour plot plot(res, plot.2d = "persp", select=1) # perspective plot