orangeJuice              package:bayesm              R Documentation

_S_t_o_r_e-_l_e_v_e_l _P_a_n_e_l _D_a_t_a _o_n _O_r_a_n_g_e _J_u_i_c_e _S_a_l_e_s

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

     yx, weekly sales of refrigerated orange juice at 83 stores. 
      storedemo, contains demographic information on those stores. 

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

     data(orangeJuice)

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

     This R object is a list of two data frames, list(yx,storedemo).

     List of 2 
      $ yx       :'data.frame':     106139 obs. of  19 variables:
      ... $ store   : int [1:106139] 2 2 2 2 2 2 2 2 2 2 
      ... $ brand   : int [1:106139] 1 1 1 1 1 1 1 1 1 1 
      ... $ week    : int [1:106139] 40 46 47 48 50 51 52 53 54 57 
      ... $ logmove : num [1:106139] 9.02 8.72 8.25 8.99 9.09 
      ... $ constant: int [1:106139] 1 1 1 1 1 1 1 1 1 1 
      ... $ price1  : num [1:106139] 0.0605 0.0605 0.0605 0.0605 0.0605 
      ... $ price2  : num [1:106139] 0.0605 0.0603 0.0603 0.0603 0.0603 
      ... $ price3  : num [1:106139] 0.0420 0.0452 0.0452 0.0498 0.0436 
      ... $ price4  : num [1:106139] 0.0295 0.0467 0.0467 0.0373 0.0311 
      ... $ price5  : num [1:106139] 0.0495 0.0495 0.0373 0.0495 0.0495 
      ... $ price6  : num [1:106139] 0.0530 0.0478 0.0530 0.0530 0.0530 
      ... $ price7  : num [1:106139] 0.0389 0.0458 0.0458 0.0458 0.0466 
      ... $ price8  : num [1:106139] 0.0414 0.0280 0.0414 0.0414 0.0414 
      ... $ price9  : num [1:106139] 0.0289 0.0430 0.0481 0.0423 0.0423 
      ... $ price10 : num [1:106139] 0.0248 0.0420 0.0327 0.0327 0.0327 
      ... $ price11 : num [1:106139] 0.0390 0.0390 0.0390 0.0390 0.0382 
      ... $ deal    : int [1:106139] 1 0 0 0 0 0 1 1 1 1 
      ... $ feat    : num [1:106139] 0 0 0 0 0 0 0 0 0 0 
      ... $ profit  : num [1:106139] 38.0 30.1 30.0 29.9 29.9 

     1 Tropicana Premium 64 oz;   2 Tropicana Premium 96 oz;  3
     Florida's Natural 64 oz; 
         4 Tropicana 64 oz;           5 Minute Maid 64 oz;        6
     Minute Maid 96 oz; 
      7 Citrus Hill 64 oz;         8 Tree Fresh 64 oz;         9
     Florida Gold 64 oz; 
             10 Dominicks 64 oz;          11 Dominicks 128 oz.  

     $ storedemo:'data.frame':     83 obs. of  12 variables:
      ... $ STORE   : int [1:83] 2 5 8 9 12 14 18 21 28 32 
      ... $ AGE60   : num [1:83] 0.233 0.117 0.252 0.269 0.178 
      ... $ EDUC    : num [1:83] 0.2489 0.3212 0.0952 0.2222 0.2534 
      ... $ ETHNIC  : num [1:83] 0.1143 0.0539 0.0352 0.0326 0.3807 
      ... $ INCOME  : num [1:83] 10.6 10.9 10.6 10.8 10.0 
      ... $ HHLARGE : num [1:83] 0.1040 0.1031 0.1317 0.0968 0.0572 
      ... $ WORKWOM : num [1:83] 0.304 0.411 0.283 0.359 0.391 
      ... $ HVAL150 : num [1:83] 0.4639 0.5359 0.0542 0.5057 0.3866 
      ... $ SSTRDIST: num [1:83] 2.11 3.80 2.64 1.10 9.20 
      ... $ SSTRVOL : num [1:83] 1.143 0.682 1.500 0.667 1.111 
      ... $ CPDIST5 : num [1:83] 1.93 1.60 2.91 1.82 0.84 
      ... $ CPWVOL5 : num [1:83] 0.377 0.736 0.641 0.441 0.106 

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


     '_s_t_o_r_e' store number

     '_b_r_a_n_d' brand indicator

     '_w_e_e_k' week number

     '_l_o_g_m_o_v_e' log of the number of units sold

     '_c_o_n_s_t_a_n_t' a vector of 1

     '_p_r_i_c_e_1' price of brand 1

     '_d_e_a_l' in-store coupon activity

     '_f_e_a_t_u_r_e' feature advertisement

     '_S_T_O_R_E' store number

     '_A_G_E_6_0' percentage of the population that is aged 60 or older

     '_E_D_U_C' percentage of the population that has a college degree

     '_E_T_H_N_I_C' percent of the population that is black or Hispanic

     '_I_N_C_O_M_E' median income

     '_H_H_L_A_R_G_E' percentage of households with 5 or more persons

     '_W_O_R_K_W_O_M' percentage of women with full-time jobs

     '_H_V_A_L_1_5_0' percentage of households worth more than $150,000

     '_S_S_T_R_D_I_S_T' distance to the nearest warehouse store

     '_S_S_T_R_V_O_L' ratio of sales of this store to the nearest warehouse
          store

     '_C_P_D_I_S_T_5' average distance in miles to the nearest 5 supermarkets

     '_C_P_W_V_O_L_5' ratio of sales of this store to the average of the
          nearest five stores

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

     Alan L. Montgomery (1997), "Creating Micro-Marketing Pricing
     Strategies Using Supermarket Scanner Data," _Marketing Science_
     16(4) 315-337.

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

     Chapter 5, _Bayesian Statistics and Marketing_ by Rossi et al.
      <URL:
     http://faculty.chicagogsb.edu/peter.rossi/research/bsm.html>

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

     ## Example 
     ## load data
     data(orangeJuice)

     ## print some quantiles of yx data  
     cat("Quantiles of the Variables in yx data",fill=TRUE)
     mat=apply(as.matrix(orangeJuice$yx),2,quantile)
     print(mat)

     ## print some quantiles of storedemo data
     cat("Quantiles of the Variables in storedemo data",fill=TRUE)
     mat=apply(as.matrix(orangeJuice$storedemo),2,quantile)
     print(mat)

     ## Example 2 processing for use with rhierLinearModel
     ##
     ##
     if(0)
     {

     ## select brand 1 for analysis
     brand1=orangeJuice$yx[(orangeJuice$yx$brand==1),]

     store = sort(unique(brand1$store))
     nreg = length(store)
     nvar=14

     regdata=NULL
     for (reg in 1:nreg) {
             y=brand1$logmove[brand1$store==store[reg]]
             iota=c(rep(1,length(y)))
             X=cbind(iota,log(brand1$price1[brand1$store==store[reg]]),
                          log(brand1$price2[brand1$store==store[reg]]),
                          log(brand1$price3[brand1$store==store[reg]]),
                          log(brand1$price4[brand1$store==store[reg]]),
                          log(brand1$price5[brand1$store==store[reg]]),
                          log(brand1$price6[brand1$store==store[reg]]),
                          log(brand1$price7[brand1$store==store[reg]]),
                          log(brand1$price8[brand1$store==store[reg]]),
                          log(brand1$price9[brand1$store==store[reg]]),
                          log(brand1$price10[brand1$store==store[reg]]),
                          log(brand1$price11[brand1$store==store[reg]]),
                          brand1$deal[brand1$store==store[reg]],
                          brand1$feat[brand1$store==store[reg]])
             regdata[[reg]]=list(y=y,X=X)
           }

     ## storedemo is standardized to zero mean.

     Z=as.matrix(orangeJuice$storedemo[,2:12]) 
     dmean=apply(Z,2,mean)
     for (s in 1:nreg){
             Z[s,]=Z[s,]-dmean
     }
     iotaz=c(rep(1,nrow(Z)))
     Z=cbind(iotaz,Z)
     nz=ncol(Z)

     Data=list(regdata=regdata,Z=Z)
     Mcmc=list(R=R,keep=1)

     out=rhierLinearModel(Data=Data,Mcmc=Mcmc)

     summary(out$Deltadraw)
     summary(out$Vbetadraw)

     if(0){
     ## plotting examples
     plot(out$betadraw)
     }
     }

