Learn R Programming

bayespref (version 1.0)

credibleIntervals: Calculates credible intervals for preferences

Description

This function calculates the credible intervals for preference parameters for individuals and the population using the object created by the function bayesPref.

Usage

credibleIntervals(prefres = NULL, burn = 0, interval = 0.95)

Arguments

prefres
An object returned by bayesPref.
burn
A value indicating the number of burnin samples discarded.
interval
A value between 0 and 1 indicating the size of the credible interval calculated.

Value

  • A list containing the following
  • IndPrefAn array containing the lower credible interval, the median, and upper credible interval for the individual-level preference parameters.
  • PopPrefAn array containing the lower credible interval, the median, and upper credible interval for the population-level preference parameters.
  • PopVarA vector for the lower credible interval, the median, and upper credible interval for the variance of the population-level preference parameters (variance of alphas in Dirichlet).

Examples

Run this code
data(YGGV)
res <- bayesPref(pData=YGGV,mcmcL=1000)
credibleIntervals(prefres=res[[1]],burn=100) #credible intervals for population 1

Run the code above in your browser using DataLab