rscaleUsage {bayesm} | R Documentation |
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(x, k) |
Prior |
list(nu, V, mubar, Am, gs, Lambdanu, LambdaV) |
Mcmc |
list(R, keep, nprint, ndghk, e, y, mu, Sigma, sigma, tau, Lambda) |
Details
Model and Priors
=
nrow(x)
individuals respond to =
ncol(x)
questions;
all questions are on a scale for respondent
and question
,
if
where
and
with
unif on a grid
It is highly recommended that the user choose the default prior settings. If you wish to change prior settings and/or the grids used, please carefully read the case study listed in the reference below.
Argument Details
Data = list(x, k)
x: | matrix of discrete responses |
k: | number of discrete rating scale options |
Prior = list(nu, V, mubar, Am, gs, Lambdanu, LambdaV)
[optional]
nu: | d.f. parameter for Sigma prior (def: p + 3) |
V: | scale location matrix for Sigma prior (def: nu*I) |
mubar: | vector of prior means (def: rep(k/2,p) ) |
Am: | prior precision matrix (def: 0.01*I) |
gs: | grid size for sigma (def: 100) |
Lambdanu: | d.f. parameter for Lambda prior (def: 20) |
LambdaV: | scale location matrix for Lambda prior (def: (Lambdanu - 3)*Lambda) |
Mcmc = list(R, keep, nprint, ndghk, e, y, mu, Sigma, sigma, tau, Lambda)
[only R
required]
R: | number of MCMC draws (def: 1000) |
keep: | MCMC thinning parameter -- keep every keep th draw (def: 1) |
nprint: | print the estimated time remaining for every nprint 'th draw (def: 100, set to 0 for no print) |
ndghk: | number of draws for a GHK integration (def: 100) |
e: | initial value (def: 0) |
y: | initial values (def: x) |
mu: | initial values (def: apply(y,2,mean) , a p-length vector) |
Sigma: | initial value (def: var(y) ) |
sigma: | initial values (def: rep(1,n) ) |
tau: | initial values (def: rep(0,n) ) |
Lambda: | initial values (def: matrix(c(4,0,0,.5),ncol=2) )
|
Value
A list containing:
Sigmadraw |
|
mudraw |
|
taudraw |
|
sigmadraw |
|
Lambdadraw |
|
edraw |
|
Warning
,
are identified from the scale usage patterns in the
questions asked per respondent (# cols of
). Do not attempt to use this on datasets with only a small number of total questions.
Author(s)
Rob McCulloch (Arizona State University) and Peter Rossi (Anderson School, UCLA), perossichi@gmail.com.
References
For further discussion, see Case Study 3 on Overcoming Scale Usage Heterogeneity, Bayesian Statistics and Marketing by Rossi, Allenby, and McCulloch.
Examples
if(nchar(Sys.getenv("LONG_TEST")) != 0) {R=1000} else {R=5}
set.seed(66)
data(customerSat)
surveydat = list(k=10, x=as.matrix(customerSat))
out = rscaleUsage(Data=surveydat, Mcmc=list(R=R))
summary(out$mudraw)