Point-wise and simultaneous confidence intervals for smooths
Calculates point-wise confidence or simultaneous intervals for the smooth terms of a fitted GAM.
## S3 method for class 'gam' confint( object, parm, level = 0.95, newdata = NULL, n = 200, type = c("confidence", "simultaneous"), nsim = 10000, shift = FALSE, transform = FALSE, unconditional = FALSE, ncores = 1, partial_match = FALSE, ... ) ## S3 method for class 'gamm' confint(object, ...) ## S3 method for class 'list' confint(object, ...)
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 |
ncores |
number of cores for generating random variables from a
multivariate normal distribution. Passed to |
partial_match |
logical; should matching |
... |
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
% confidence interval.
Gavin L. Simpson
load_mgcv() dat <- gamSim(1, n = 500, 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 = "s(x1)", type = "confidence") ci ## simultaneous interval for smooth term of x1 si <- confint(mod, parm = "s(x1)", type = "simultaneous", nsim = 100) si
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.