Learn R Programming

bayesm (version 3.0-2)

tuna: Data on Canned Tuna Sales

Description

Volume of canned tuna sales as well as a measure of display activity, log price and log wholesale price. Weekly data aggregated to the chain level. This data is extracted from the Dominick's Finer Foods database maintained by the Kilts center for marketing at the University of Chicago's Booth School of Business. Brands are seven of the top 10 UPCs in the canned tuna product category.

Usage

data(tuna)

Arguments

Format

A data frame with 338 observations on the following 30 variables.

WEEK

a numeric vector

MOVE1

unit sales of Star Kist 6 oz.

MOVE2

unit sales of Chicken of the Sea 6 oz.

MOVE3

unit sales of Bumble Bee Solid 6.12 oz.

MOVE4

unit sales of Bumble Bee Chunk 6.12 oz.

MOVE5

unit sales of Geisha 6 oz.

MOVE6

unit sales of Bumble Bee Large Cans.

MOVE7

unit sales of HH Chunk Lite 6.5 oz.

NSALE1

a measure of display activity of Star Kist 6 oz.

NSALE2

a measure of display activity of Chicken of the Sea 6 oz.

NSALE3

a measure of display activity of Bumble Bee Solid 6.12 oz.

NSALE4

a measure of display activity of Bumble Bee Chunk 6.12 oz.

NSALE5

a measure of display activity of Geisha 6 oz.

NSALE6

a measure of display activity of Bumble Bee Large Cans.

NSALE7

a measure of display activity of HH Chunk Lite 6.5 oz.

LPRICE1

log of price of Star Kist 6 oz.

LPRICE2

log of price of Chicken of the Sea 6 oz.

LPRICE3

log of price of Bumble Bee Solid 6.12 oz.

LPRICE4

log of price of Bumble Bee Chunk 6.12 oz.

LPRICE5

log of price of Geisha 6 oz.

LPRICE6

log of price of Bumble Bee Large Cans.

LPRICE7

log of price of HH Chunk Lite 6.5 oz.

LWHPRIC1

log of wholesale price of Star Kist 6 oz.

LWHPRIC2

log of wholesale price of Chicken of the Sea 6 oz.

LWHPRIC3

log of wholesale price of Bumble Bee Solid 6.12 oz.

LWHPRIC4

log of wholesale price of Bumble Bee Chunk 6.12 oz.

LWHPRIC5

log of wholesale price of Geisha 6 oz.

LWHPRIC6

log of wholesale price of Bumble Bee Large Cans.

LWHPRIC7

log of wholesale price of HH Chunk Lite 6.5 oz.

FULLCUST

total customers visits

References

Chapter 7, Bayesian Statistics and Marketing by Rossi, Allenby and McCulloch. http://www.perossi.org/home/bsm-1

Examples

Run this code
data(tuna)
cat(" Quantiles of sales",fill=TRUE)
mat=apply(as.matrix(tuna[,2:5]),2,quantile)
print(mat)

##
## example of processing for use with rivGibbs
##
if(0)
{
  data(tuna)                          
  t = dim(tuna)[1]    
  customers = tuna[,30]                 
  sales = tuna[,2:8]                                                        
  lnprice = tuna[,16:22]      
  lnwhPrice= tuna[,23:29]      
  share=sales/mean(customers)
  shareout=as.vector(1-rowSums(share))
  lnprob=log(share/shareout)  

# create w matrix

  I1=as.matrix(rep(1, t))
  I0=as.matrix(rep(0, t))
  intercept=rep(I1, 4)
  brand1=rbind(I1, I0, I0, I0)
  brand2=rbind(I0, I1, I0, I0)
  brand3=rbind(I0, I0, I1, I0)
  w=cbind(intercept, brand1, brand2, brand3)  
  
## choose brand 1 to 4        
          
  y=as.vector(as.matrix(lnprob[,1:4])) 
  X=as.vector(as.matrix(lnprice[,1:4]))     
  lnwhPrice=as.vector(as.matrix (lnwhPrice[1:4]))   
  z=cbind(w, lnwhPrice)
                        
  Data=list(z=z, w=w, x=X, y=y)
  Mcmc=list(R=R, keep=1)
  set.seed(66)
  out=rivGibbs(Data=Data,Mcmc=Mcmc)

  cat(" betadraws ",fill=TRUE)
  summary(out$betadraw)


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

  

Run the code above in your browser using DataLab