ordgam {ordgam}R Documentation

Fit of an additive proportional odds model for ordinal data using Laplace approximations and P-splines

Description

Fit of an additive proportional odds model for ordinal data using Laplace approximations and P-splines

Usage

ordgam(
  formula,
  data,
  nc = NULL,
  K = 10,
  pen.order = 2,
  descending = TRUE,
  select.lambda = TRUE,
  lambda.family = "dgamma",
  lambda.optimizer = "nlminb",
  lprior.lambda = function(x) dgamma(x, 1, 1e-04, log = TRUE),
  theta0 = NULL,
  lambda0 = NULL,
  ci.level = 0.95,
  verbose = FALSE
)

Arguments

formula

A model formula

data

A data frame containing a column 'y' with the ordinal response (taking integer values) besides the covariates.

nc

(optional) Number of categories for the ordinal response.

K

Number of B-splines to model each additive term (Default: 10).

pen.order

Penalty order (Default: 2).

descending

Logical indicating if the odds of the response taking a value in the upper scale should be preferred over values in the lower scale (Default: TRUE).

select.lambda

Logical indicating if the penalty parameters should be tuned (Default: TRUE).

lambda.family

Prior for <lambda>. Possible choices are "none", "dgamma", "BetaPrime" or "myprior" for a user specified function for the prior of <lambda>.

lambda.optimizer

Algorithm used to maximize p(lambda|data). Possible choices are "nlminb","ucminf","nlm","LevMarq" (Default: "nlminb").

lprior.lambda

Log of the prior density for a <lambda> component if lambda.family set to "myprior".

theta0

(Optional) Vector containing starting values for the regression parameters.

lambda0

Vector of penalty parameters for the additive terms (Default: 10 for each additive term).

ci.level

Confidence levels of the computed credible intervals for the regression parameters.

verbose

Verbose mode (logical)

Value

an object of type ordgam.object.

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>.

See Also

ordregr, ordgam.object.

Examples

library(ordgam)
data(freehmsData)
mod = ordgam(freehms ~ gndr + s(eduyrs) + s(age),
             data=freehmsData, descending=TRUE)
print(mod)
plot(mod)


[Package ordgam version 0.9.1 Index]