lqm {BeQut} | R Documentation |
lqm
fits linear quantile regression model
Description
Function using 'JAGS' software to estimate the linear quantile regression model assuming asymmetric Laplace distribution for residual error.
Usage
lqm(
formula,
data,
tau = 0.5,
n.chains = 3,
n.iter = 10000,
n.burnin = 5000,
n.thin = 1,
n.adapt = NULL,
save_jagsUI = TRUE,
parallel = FALSE
)
Arguments
formula |
formula for the quantile regression including response variable |
data |
dataset of observed variables |
tau |
the quantile(s) 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 |
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.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 |
save_jagsUI |
If |
parallel |
see |
Value
A Blqm
object which 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
Rhat
Gelman and Rubin diagnostic for all parameters
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
W
list including both posterior mean and posterior standard deviation of subject-specific random variable W
out_jagsUI
only if
save_jagsUI=TRUE
in argument: list including posterior mean, median, quantiles (2.5%, 25%, 50%, 75%, 97.5%), standard deviation for each parameter and each random effect. Moreover, this list also returns the MCMC draws, the Gelman and Rubin diagnostics (see output of jagsUI objects)
Author(s)
Antoine Barbieri
Examples
#---- Use data
data(wave)
#---- Fit regression model for the first quartile
lqm_025 <- lqm(formula = h110d~vent_vit_moy,
data = wave,
n.iter = 1000,
n.burnin = 500,
tau = 0.25)
#---- Get the posterior mean of parameters
lqm_025$mean
#---- Visualize the trace for beta parameters
jagsUI::traceplot(lqm_025$out_jagsUI, parameters = "beta" )
#---- Summary of output
summary(lqm_025)