Scotch                package:bayesm                R Documentation

_S_u_r_v_e_y _D_a_t_a _o_n _B_r_a_n_d_s _o_f _S_c_o_t_c_h _C_o_n_s_u_m_e_d

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

     from Simmons Survey.  Brands used in last year for those
     respondents who report consuming scotch.

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

     data(Scotch)

_F_o_r_m_a_t:

     A data frame with 2218 observations on the following 21 variables.
     All variables are coded 1 if consumed in last year, 0 if not.

     '_C_h_i_v_a_s._R_e_g_a_l' a numeric vector

     '_D_e_w_a_r._s._W_h_i_t_e._L_a_b_e_l' a numeric vector

     '_J_o_h_n_n_i_e._W_a_l_k_e_r._B_l_a_c_k._L_a_b_e_l' a numeric vector

     '_J..._B' a numeric vector

     '_J_o_h_n_n_i_e._W_a_l_k_e_r._R_e_d._L_a_b_e_l' a numeric vector

     '_O_t_h_e_r._B_r_a_n_d_s' a numeric vector

     '_G_l_e_n_l_i_v_e_t' a numeric vector

     '_C_u_t_t_y._S_a_r_k' a numeric vector

     '_G_l_e_n_f_i_d_d_i_c_h' a numeric vector

     '_P_i_n_c_h.._H_a_i_g.' a numeric vector

     '_C_l_a_n._M_a_c_G_r_e_g_o_r' a numeric vector

     '_B_a_l_l_a_n_t_i_n_e' a numeric vector

     '_M_a_c_a_l_l_a_n' a numeric vector

     '_P_a_s_s_p_o_r_t' a numeric vector

     '_B_l_a_c_k..._W_h_i_t_e' a numeric vector

     '_S_c_o_r_e_s_b_y._R_a_r_e' a numeric vector

     '_G_r_a_n_t_s' a numeric vector

     '_U_s_h_e_r_s' a numeric vector

     '_W_h_i_t_e._H_o_r_s_e' a numeric vector

     '_K_n_o_c_k_a_n_d_o' a numeric vector

     '_t_h_e._S_i_n_g_l_e_t_o_n' a numeric vector

_S_o_u_r_c_e:

     Edwards, Y. and G. Allenby (2003), "Multivariate Analysis of
     Multiple Response Data," _JMR_  40, 321-334.

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

     Chapter 4, _Bayesian Statistics and Marketing_ by Rossi et al.
       <URL:
     http://gsbwww.uchicago.edu/fac/peter.rossi/research/bsm.html>

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

     data(Scotch)
     cat(" Frequencies of Brands", fill=TRUE)
     mat=apply(as.matrix(Scotch),2,mean)
     print(mat)
     ##
     ## use Scotch data to run Multivariate Probit Model
     ##
     if(nchar(Sys.getenv("LONG_TEST")) != 0){
     ##

     y=as.matrix(Scotch)
     p=ncol(y); n=nrow(y)
     dimnames(y)=NULL
     y=as.vector(t(y))
     y=as.integer(y)
     I_p=diag(p)
     X=rep(I_p,n)
     X=matrix(X,nrow=p)
     X=t(X)

     R=2000
     Data=list(p=p,X=X,y=y)
     Mcmc=list(R=R)
     set.seed(66)
     out=rmvpGibbs(Data=Data,Mcmc=Mcmc)

     ind=(0:(p-1))*p + (1:p)
     cat(" Betadraws ",fill=TRUE)
     mat=apply(out$betadraw/sqrt(out$sigmadraw[,ind]),2,quantile,probs=c(.01,.05,.5,.95,.99))
     print(mat)
     rdraw=matrix(double((R)*p*p),ncol=p*p)
     rdraw=t(apply(out$sigmadraw,1,nmat))
     cat(" Draws of Correlation Matrix ",fill=TRUE)
     mat=apply(rdraw,2,quantile,probs=c(.01,.05,.5,.95,.99))
     ## correlation matrix too large to print -- summarize
     quantile(round(mat,digits=2))

     }

