Learn R Programming

bayesm (version 1.1-2)

rscaleUsage: MCMC Algorithm for Multivariate Ordinal Data with Scale Usage Heterogeneity.

Description

rscaleUsage implements an MCMC algorithm for multivariate ordinal data with scale usage heterogeniety.

Usage

rscaleUsage(Data,Prior, Mcmc)

Arguments

Data
list(k,x)
Prior
list(nu,V,mubar,Am,gsigma,gl11,gl22,gl12,Lambdanu,LambdaV,ge) (optional)
Mcmc
list(R,keep,ndghk,printevery,e,y,mu,Sigma,sigma,tau,Lambda) (optional)

Value

  • a list containing:
  • SigmadrawR/keep x m*m array of Sigma draws
  • mudrawR/keep x m array of mu draws
  • taudrawR/keep x n array of tau draws
  • sigmadrawR/keep x n array of sigma draws
  • LambdadrawR/keep x 4 array of Lamda draws
  • edrawR/keep x 1 array of e draws

concept

  • MCMC
  • bayes
  • ordinal data
  • scale usage
  • hierarchical models

Warning

$tau_i$, $sigma_i$ are identified from the scale usage patterns in the m questions asked per respondent (# cols of x). Do not attempt to use this on data sets with only a small number of total questions!

Details

Model: n=nrow(x) individuals respond to m=ncol(x) questions. all questions are on a scale 1, ..., k. for respondent i and question j, $x_{ij} = d$, if $c_{d-1} \le y_{ij} \le c_d$. d=1,...,k. $c_d = a + bd +ed^2$. $y_i = mu + tau_i*iota + sigma_i*z_i$. $z_i$ $\sim$ $N(0,Sigma)$. Priors: $(tau_i,ln(sigma_i))$ $\sim$ $N(phi,Lamda)$. $phi=(0,lambda_{22})$. mu $\sim$ $N(mubar, Am{^-1})$. Sigma $\sim$ IW(nu,V). Lambda $\sim$ IW(Lambdanu,LambdaV). e $\sim$ unif on a grid.

References

For further discussion, see Bayesian Statistics and Marketing by Allenby, McCulloch, and Rossi, Case Study on Scale Usage Heterogeneity. http://gsbwww.uchicago.edu/fac/peter.rossi/research/bsm.html

Examples

Run this code
##
if(nchar(Sys.getenv("LONG_TEST")) != 0) 
{
data(customerSat)
surveydat = list(k=10,x=as.matrix(customerSat))

R=1000
mcmc = list(R=R)
set.seed(66)
out=rscaleUsage(Data=surveydat,Mcmc=mcmc)

cat("mudraws ",fill=TRUE)
mat=apply(out$mudraw,2,quantile,probs=c(.01,.05,.5,.95,.99))
print(mat)

}

Run the code above in your browser using DataLab