Learn R Programming

bayesm (version 3.0-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,nprint,e,y,mu,Sigma,sigma,tau,Lambda) (optional)

Value

a list containing:

Sigmadraw

R/keep x m*m array of Sigma draws

mudraw

R/keep x m array of mu draws

taudraw

R/keep x n array of tau draws

sigmadraw

R/keep x n array of sigma draws

Lambdadraw

R/keep x 4 array of Lamda draws

edraw

R/keep x 1 array of e draws

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 Rossi, Allenby, and McCulloch, Case Study on Scale Usage Heterogeneity. http://www.perossi.org/home/bsm-1

Examples

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

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

summary(out$mudraw)

}

Run the code above in your browser using DataLab