mlqmm: 'mlqmm' fits multiple linear quantile mixed model

View source: R/mlqmm.R

mlqmmR Documentation

mlqmm fits multiple linear quantile mixed model

Description

Function using JAGS to estimate a multivariate linear quantile mixed model assuming multivariate asymmetric Laplace distribution for residual error.

Usage

mlqmm(
  formFixed,
  formRandom,
  formGroup,
  data,
  tau,
  corr_structure = "middle",
  RE_ind = FALSE,
  n.chains = 3,
  n.iter = 10000,
  n.burnin = 5000,
  n.thin = 1,
  n.adapt = NULL,
  precision = 10,
  save_jagsUI = TRUE,
  parallel = FALSE
)

Arguments

formFixed

formula for fixed part of longitudinal submodel with response variable

formRandom

formula for random part of longitudinal submodel without response variable

formGroup

formula specifying the cluster variable (e.g. = ~ subject)

data

dataset of observed variables

tau

vector of quantiles to be estimated. This must be a number between 0 and 1, otherwise the execution is stopped. If more than one quantile is specified, rounding off to the 4th decimal must give non–duplicated values of tau, otherwise the execution is stopped.

corr_structure

string specifying the correlation structure between $Y|W_tau$: "free", "middle" or "none". If 'none', the dependendance is only caught by the common covariance matrix of all random effects; if 'middle', the model assumes a correlation structure based on both a common correlation parameter and the distances between considered quantiles's orders; if 'free", a specific correlation parameter is assumed for each multivariate responses.

RE_ind

if TRUE, the random effects are assumed to be independent between different quantile. Otherwise (FALSE by default), correlation between quantile (markers) is also caught through common covariance matrix of random effects.

n.chains

the number of parallel chains for the model; default is 1.

n.iter

integer specifying the total number of iterations; default is 10000

n.burnin

integer specifying how many of n.iter to discard as burn-in ; default is 5000

n.thin

integer specifying the thinning of the chains; default is 1

n.adapt

integer specifying the number of iterations to use for adaptation; default is NULL

precision

variance by default for vague prior distribution

save_jagsUI

If TRUE (by default), the output of jagsUI package is return by the function

parallel

see jagsUI::jags() function

Value

A BQt object is a list with the following elements:

mean

list of posterior mean for each parameter

median

list of posterior median for each parameter

modes

list of posterior mode for each parameter

StErr

list of standard error for each parameter

StDev

list of standard deviation for each parameter

ICs

list of the credibility interval at 0.95 for each parameters excepted for covariance parameters in covariance matrix of random effects. Otherwise, use save_jagsUI=TRUE to have the associated quantiles.

data

data included in argument

sims.list

list of the MCMC chains of the parameters and random effects

control

list of arguments giving details about the estimation

random_effect

list for each quantile including both posterior mean and posterior standard deviation of subject-specific random effects

out_jagsUI

only if save_jagsUI=TRUE in argument: list including posterior mean, median, quantiles (2.5 Moreover, this list also returns the MCMC draws, the Gelman and Rubin diagnostics (see output of jagsUI objects)

Author(s)

Antoine Barbieri

References

Lea Petrella and Valentina Raponi (2019). Joint estimation of conditional quantiles in multivariate linear regression models with an application to financial distress. Journal of Multivariate Analysis, 173:70-84. doi: 10.1016/j.jmva.2019.02.008.

Elisabeth Waldmann and Thomas Kneib (2015). Bayesian bivariate quantile regression. Statistical Modelling, 15(4):326-344. doi: 10.1177/1471082X14551247.

Examples


## Not run: 
#---- Orthodont data from lqmm package
data("aids", package = "joineR")

#---- Fit regression model for the first quartile
BQt_mQr <- mlqmm(formFixed = CD4 ~ obstime,
                 formRandom = ~ obstime,
                 formGroup = ~ id,
                 data = aids,
                 tau = c(0.25,0.5,0.75),
                 n.iter = 1000,
                 n.burnin = 500)

#---- Get the estimated coefficients (posterior means)
BQt_mQr$mean

#---- Summary of output
summary(BQt_mQr)

#---- Traces of somes parameters
traceplot(x = BQt_mQr$out_jagsUI,
          parameters = c("beta", "sigma", "rho"))

## End(Not run)

AntoineBbi/BQt documentation built on June 25, 2022, 3:32 p.m.