Description Usage Arguments Value Author(s) Examples
Calculates point-wise confidence or simultaneous intervals for the smooth terms of a fitted GAM.
1 2 3 4 5 6 7 |
object |
an object of class |
parm |
which parameters (smooth terms) are to be given intervals as a vector of terms. If missing, all parameters are considered, although this is not currently implemented. |
level |
numeric, |
newdata |
data frame; containing new values of the covariates used in the model fit. The selected smooth(s) wil be evaluated at the supplied values. |
n |
numeric; the number of points to evaluate smooths at. |
type |
character; the type of interval to compute. One of |
nsim |
integer; the number of simulations used in computing the simultaneous intervals. |
shift |
logical; should the constant term be add to the smooth? |
transform |
logical; should the smooth be evaluated on a transformed scale? For generalised models, this involves applying the inverse of the link function used to fit the model. Alternatively, the name of, or an actual, function can be supplied to transform the smooth and it's confidence interval. |
unconditional |
logical; if |
... |
additional arguments for methods |
a data frame with components:
term
; factor indicating to which term each row relates,
x
; the vector of values at which the smooth was evaluated,
lower
; lower limit of the confidence or simultaneous interval,
est
; estimated value of the smooth
upper
; upper limit of the confidence or simultaneous interval,
crit
; critical value for the 100 * level
Gavin L. Simpson
1 2 3 4 5 6 7 8 9 10 11 12 13 | library("mgcv")
set.seed(2)
dat <- gamSim(1, n = 400, dist = "normal", scale = 2)
mod <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat, method = "REML")
##'
## point-wise interval
ci <- confint(mod, parm = "x1", type = "confidence")
head(ci)
##'
## simultaneous interval for smooth term of x1
set.seed(42)
si <- confint(mod, parm = "x1", type = "simultaneous", nsim = 100)
head(si)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.