
Last chance! 50% off unlimited learning
Sale ends in
prior
creates an S3 object of class bayesQR.prior
that contains all necessary prior information to estimate a Bayesian quantile regression model.
prior(formula, data, alasso, ...)
An object of class bayesQR
, basically a list containing the following elements:
a string containing the method that was used, i.e. indicating whether the dependent variable was continuous or binary and whether adaptive lasso variable selection was used.
the prior parameters that are dependent on the method that is used (see details section).
a symbolic description of the model to be fit.
an optional data frame containing the variables in the model.
logical flag for adaptive lasso variable selection (default=FALSE).
the prior parameters that are dependent on the method that is used. If omitted, a standard diffuse prior will be used (see details section).
Dries F. Benoit
The function prior
builds the prior for four types of models, depending on whether the dependent variable is continuous or binary and whether adaptive lasso variable selection is used.
Every non-specified prior parameter will get the default value.
Continuous dependent variable without adaptive lasso variable selection:
beta0 : nvar(X) x 1 vector of prior means (default: 0)
V0 : nvar(X) x nvar(X) prior covariance matrix (default: 100*diag(ncol(X)))
shape0 : shape parameter for inverse Gamma prior for sigma (default: 0.01)
scale0 : scale parameter for inverse Gamma prior for sigma (default: 0.01)
Continuous dependent variable with adaptive lasso variable selection:
sigma_shape : shape parameter for the inverse gamma prior on sigma (default: 0.01)
sigma_scale : scale parameter for the inverse gamma prior on sigma (default: 0.01)
etasq_shape : shape parameter for the gamma prior on etasq (default: 0.01)
etasq_scale : scale parameter for the gamma prior on etasq (default: 0.01)
Binary dependent variable without adaptive lasso variable selection:
beta0 : nvar(X) x 1 vector of prior means (default: 0)
V0 : nvar(X) x nvar(X) prior covariance matrix (default: 100*diag(ncol(X)))
Binary dependent variable with adaptive lasso variable selection:
lambdasq_shape : shape parameter for the gamma prior on lambdasq (default: 0.01)
lambdasq_scale : scale parameter for the gamma prior on lambdasq (default: 0.01)
# Load the Prostate cancer dataset
data(Prostate)
# Create informative prior object
prior <- prior(lpsa~., data=Prostate, beta0=rep(5,9), V0=diag(9))
# Investigate structure of bayesQR.prior object
str(prior)
# Estimate the model parameters with informative prior
out <- bayesQR(lpsa~., data=Prostate, prior=prior, ndraw=5000)
# Print results
summary(out)
Run the code above in your browser using DataLab