rscaleUsage              package:bayesm              R Documentation

_M_C_M_C _A_l_g_o_r_i_t_h_m _f_o_r _M_u_l_t_i_v_a_r_i_a_t_e _O_r_d_i_n_a_l _D_a_t_a _w_i_t_h _S_c_a_l_e _U_s_a_g_e _H_e_t_e_r_o_g_e_n_e_i_t_y.

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     rscaleUsage(Data,Prior, Mcmc)

_A_r_g_u_m_e_n_t_s:

    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) 

_D_e_t_a_i_l_s:

     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} <= y_{ij} <= c_d. 
      d=1,...,k. c_d = a + bd +ed^2. 

     y_i = mu + tau_i*iota + sigma_i*z_i.  z_i ~ N(0,Sigma). 

     Priors:
      (tau_i,ln(sigma_i)) ~ N(phi,Lamda).  phi=(0,lambda_{22}). 
      mu ~ N(mubar, Am{^-1}).
      Sigma ~ IW(nu,V).
      Lambda ~ IW(Lambdanu,LambdaV).
      e ~ unif on a grid. 

_V_a_l_u_e:

     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

_W_a_r_n_i_n_g:

     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!

_N_o_t_e:

     It is *highly* recommended that the user choose the default
     settings. This means not specifying the argument 'Prior' and
     setting 'R' in Mcmc and 'Data' only.  If you wish to change prior
     settings and/or the grids used, please read the case study in
     Allenby et al carefully.

_A_u_t_h_o_r(_s):

     Rob McCulloch and Peter Rossi, Graduate School of Business,
     University of Chicago, Peter.Rossi@ChicagoGsb.edu.

_R_e_f_e_r_e_n_c_e_s:

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

_E_x_a_m_p_l_e_s:

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

     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)

     }

