vgam-class
object can be plotted
with plotvgam()
. These are on the scale of the linear/additive
predictor.plotvgam(x, newdata = NULL, y = NULL, residuals = NULL,
rugplot = TRUE, se = FALSE, scale = 0, raw = TRUE,
offset.arg = 0, deriv.arg = 0, overlay = FALSE,
type.residuals = c("deviance", "working", "pearson", "response"),
plot.arg = TRUE, which.term = NULL, which.cf = NULL,
control = plotvgam.control(...), ...)
vgam()
, vglm()
, or rrvglm()
.TRUE
, residuals are plotted. See
type.residuals
TRUE
, a rug plot is plotted at the
foot of each plot. These values are jittered to expose ties.TRUE
, approximate $\pm 2$ pointwise
standard error bands are included in the plot.scale
wide.TRUE
, the smooth functions are those
obtained directly by the algorithm, and are
plotted without
having to premultiply with the constraint matrices.
If FALSE
, the smooth functions have been premultoverlay
is TRUE
.
If overlay
is TRUE
and there is one covariate, using s()
terms,
it plots the derivative.TRUE
, component functions of the same
covariate are overlaid on each other.
The functions are centered, so offset.arg
can be useful
when overlay
is TRUE
.residuals
is TRUE
, the first
possible value
of this vector, is used to specify the type of
residual.FALSE
, no plot is produced.which.term=c("s(age)", "s(height"))
or
which.term=c(2,5,9)
.
By default, all are plotted.plotvgam.control
.plotvgam.control
. This includes line colors,
line widths, line types, etc.preplot
slot of the object
assigned information regarding the plot.plotvgam()
's options can be found in
plotvgam.control
, e.g., line types, line widths,
colors.Documentation accompanying the
vgam
,
plotvgam.control
,
predict.vgam
,
vglm
.data(coalminers)
coalminers = transform(coalminers, Age = (age - 42) / 5)
fit = vgam(cbind(nBnW,nBW,BnW,BW) ~ s(Age), binom2.or(zero=NULL), coalminers)
par(mfrow=c(1,3))
plot(fit, se=TRUE, ylim=c(-3,2), las=1)
plot(fit, se=TRUE, which.cf=1:2, lcol="blue", scol="red", ylim=c(-3,2))
plot(fit, se=TRUE, which.cf=1:2, lcol="blue", scol="red", overlay=TRUE)
Run the code above in your browser using DataLab