R/plot.ptermMatrixNumeric.R
, R/plot_multi_ptermNumeric.R
, R/plot_ptermNumeric.R
plot.ptermNumeric.Rd
This is the plotting method for parametric numerical effects.
# S3 method for ptermMatrixNumeric plot(x, n = 100, xlim = NULL, trans = identity, ...) # S3 method for multi.ptermNumeric plot(x, ...) # S3 method for ptermNumeric plot(x, n = 100, xlim = NULL, maxpo = 10000, trans = identity, ...)
x | a numerical parametric effect object, extracted using mgcViz::pterm. |
---|---|
n | number of grid points used to compute main effect and c.i. lines. |
xlim | if supplied then this pair of numbers are used as the x limits for the plot. |
trans | monotonic function to apply to the fit, confidence intervals and residuals, before plotting. Monotonicity is not checked. |
... | currently unused. |
maxpo | maximum number of residuals points that will be used by layers such as
|
An object of class plotSmooth
.
#> Gu & Wahba 4 term additive modelbs <- "cr"; k <- 12 b <- gam(y ~ x0 + x1 + I(x1^2) + s(x2,bs=bs,k=k) + I(x1*x2) + s(x3, bs=bs), data=dat) o <- getViz(b, nsim = 0) # Extract first terms and plot it pt <- pterm(o, 1) plot(pt, n = 60) + l_ciPoly() + l_fitLine() + l_ciLine()# Extract I(x1^2) terms and plot it with partial residuals pt <- pterm(o, 3) plot(pt, n = 60) + l_ciPoly() + l_fitLine() + l_ciLine() + l_points()