ordgam_additive {ordgam} | R Documentation |
Compute the additive terms estimated using an 'ordgam' model
Description
Compute the additive terms estimated using an 'ordgam' model
Usage
ordgam_additive(obj.ordgam, ngrid = 300, ci.level = 0.95)
Arguments
obj.ordgam |
An object of class 'ordgam'. |
ngrid |
Number of grid points where the additive terms are computed. |
ci.level |
Credibility level for the pointwise credible region for the additive terms |
Value
a list containing:
nalpha
:
number of intercepts in the proportional odds model.nfixed
:
number of non-penalized regression parameters in 'beta'.J
:
number of additive terms.additive.lab
:
labels of the additive terms.K
:
number of spline parameters to specify an additive term.knots
:
list of length J containing the knots for the B-spline basis associated to a given additive term.f.grid
:
list of length J with, for each additive term, a list of length 2 with 'x': a vector of grid values for the covariate ; 'y.mat': a matrix with 3 columns (est,low,up) giving the additive term and its pointwise credible regionf
:
a list of length J with, for each additive term <x>, a list with f$x: a function computing the additive term f(x) for a given covariate value 'x' ; attributes(f$x): support, label, range.f.se
:
a list of length J with, for each additive term <x>, a list with f.se$x: a function computing the s.e. of f(x) for a given covariate value 'x' ; attributes(f.se$x): support, label, range
Author(s)
Philippe Lambert p.lambert@uliege.be
References
Lambert, P. and Gressani, 0. (2023) Penalty parameter selection and asymmetry corrections to Laplace approximations in Bayesian P-splines models. Statistical Modelling. <doi:10.1177/1471082X231181173>. Preprint: <arXiv:2210.01668>.
Examples
library(ordgam)
data(freehmsData)
mod = ordgam(freehms ~ gndr + s(eduyrs) + s(age),
data=freehmsData, descending=TRUE)
obj = ordgam_additive(mod)
names(obj)
with(obj$f.grid$age,
matplot(x, y.mat, lty=c(1,2,2),type="l",col=1,
xlab="Age", ylab="f(Age)"))