prior {bayesQR}R Documentation

Create prior for Bayesian quantile regression

Description

prior creates an S3 object of class bayesQR.prior that contains all necessary prior information to estimate a Bayesian quantile regression model.

Usage

  prior(formula, data, alasso, ...)

Arguments

formula

a symbolic description of the model to be fit.

data

an optional data frame containing the variables in the model.

alasso

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

Details

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:

Continuous dependent variable with adaptive lasso variable selection:

Binary dependent variable without adaptive lasso variable selection:

Binary dependent variable with adaptive lasso variable selection:

Value

An object of class bayesQR, basically a list containing the following elements:

method

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

Author(s)

Dries F. Benoit

Examples

# 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)

[Package bayesQR version 2.3 Index]