quantregOR2 {bqror} | R Documentation |
Bayesian quantile regression in the OR2 model
Description
This function estimates Bayesian quantile regression in the OR2 model (ordinal quantile model with
exactly 3 outcomes) and reports the posterior mean, posterior standard deviation, 95
percent posterior credible intervals and inefficiency factor of (\beta, \sigma)
. The output also displays the log of
marginal likelihood and the DIC.
Usage
quantregOR2(y, x, b0, B0 , n0, d0, gammacp2, burn, mcmc, p, accutoff, maxlags, verbose)
Arguments
y |
observed ordinal outcomes, column vector of size |
x |
covariate matrix of size |
b0 |
prior mean for |
B0 |
prior covariance matrix for |
n0 |
prior shape parameter of the inverse-gamma distribution for |
d0 |
prior scale parameter of the inverse-gamma distribution for |
gammacp2 |
one and only cut-point other than 0, default is 3. |
burn |
number of burn-in MCMC iterations. |
mcmc |
number of MCMC iterations, post burn-in. |
p |
quantile level or skewness parameter, p in (0,1). |
accutoff |
autocorrelation cut-off to identify the number of lags and form batches to compute the inefficiency factor, default is 0.05. |
maxlags |
maximum lag at which to calculate the acf in inefficiency factor calculation, default is 400. |
verbose |
whether to print the final output and provide additional information or not, default is TRUE. |
Details
This function estimates Bayesian quantile regression for the
OR2 model using a Gibbs sampling procedure. The function takes the prior distributions
and other information as inputs and then iteratively samples \beta
, \sigma
,
latent weight \nu
, and latent variable z from their respective
conditional distributions.
The function also provides the logarithm of marginal likelihood and the DIC. These quantities can be utilized to compare two or more competing models at the same quantile. The model with a higher (lower) log marginal likelihood (DIC) provides a better model fit.
Value
Returns a bqrorOR2 object with components
summary: |
summary of the MCMC draws. |
postMeanbeta: |
posterior mean of |
postMeansigma: |
posterior mean of |
postStdbeta: |
posterior standard deviation of |
postStdsigma: |
posterior standard deviation of |
dicQuant: |
all quantities of DIC. |
logMargLike: |
an estimate of log marginal likelihood. |
ineffactor: |
inefficiency factor for each component of |
betadraws: |
dataframe of the |
sigmadraws: |
dataframe of the |
References
Rahman, M. A. (2016). '"Bayesian Quantile Regression for Ordinal Models."' Bayesian Analysis, 11(1): 1-24. DOI: 10.1214/15-BA939
See Also
Examples
set.seed(101)
data("data25j3")
y <- data25j3$y
xMat <- data25j3$x
k <- dim(xMat)[2]
b0 <- array(rep(0, k), dim = c(k, 1))
B0 <- 10*diag(k)
n0 <- 5
d0 <- 8
output <- quantregOR2(y = y, x = xMat, b0, B0, n0, d0, gammacp2 = 3,
burn = 10, mcmc = 40, p = 0.25, accutoff = 0.5, maxlags = 400, verbose = TRUE)
# Summary of MCMC draws :
# Post Mean Post Std Upper Credible Lower Credible Inef Factor
# beta_1 -4.5185 0.9837 -3.1726 -6.2000 1.5686
# beta_2 6.1825 0.9166 7.6179 4.8619 1.5240
# beta_3 5.2984 0.9653 6.9954 4.1619 1.4807
# sigma 1.0879 0.2073 1.5670 0.8436 2.4228
# Log of Marginal Likelihood: -404.57
# DIC: 801.82