Welcome to R for Marketing Research and Analytics

Note, April 2019: The 2nd Edition of R for Marketing Research and Analyticsi> was released this month. All code and exercises are posted here as .R files. We will update Exercise Notebooks in coming weeks (basic solutions in R code are available now).

R for Marketing Research and Analytics by Chris Chapman and Elea McDonnell Feit is designed to teach R to marketing practitioners and data scientists. This site contains the latest, updated .R code files; data files; classroom slides; and errata.

Book cover

Recent Updates

Date Announcement
May 12, 2019

Important 'errata': In April 2019, just after publication of the book, R 3.6.0 changed the way it generates random numbers. In many chapters we simulate data and perform other functions that use random numbers. Those results will change slightly from what the book shows. Options include:

  • To match the book, when using downloaded data: no action is needed. You will notice few differences, except for minor details such as results from the some() function, and slightly different results in some Bayesian statistics (which use randomization).

  • To match the book exactly (especially when simulating the data as we recommend): give the command RNGversion("3.5.0") after starting R and before running code from the book.

  • To see how things change: just go ahead and use R's new default random number generator. Compare results to the book. They will be slightly different in the exact data points, yet quite similar for the overall statistical results.

  • If you're interested to read more about the reason for the change, see Bias in R's random integers?
  • April 10, 2019 What's new in the 2nd edition?

    The 2nd edition focuses on making the book more useful for students, self-learners, and instructors. This includes:

  • Exercises at the end of each chapter.
  • A new chapter on behavior sequences (such as web logs), with analysis using Markov chains.
  • Classroom slides here (that work for both editions).
  • Discussion of how & where one might acquire typical data sets in each chapter.
  • A new appendix introducing reproducible research and the advantages of R Notebooks.
  • Generally updated the code and text as needed to be clearer, correct errors, update packages, etc.
  • March 20, 2019 The Second Edition is now electronically available (early!). We are updating the content here and will be in sync with the 2nd edition in time for the official release date in May 2019. Please check back for updates!
    November 3, 2016 A Chinese translation is now available: China Pub and Amazon China
    . Chinese cover

    Availability

    The book is available in English:

  • Springer
  • Amazon
  • Powell's Books
  • Google Play Store (ebook)
  • And in Chinese:

  • China Pub
  • Amazon China
  • Coming soon: in Japanese (ETA Fall 2019)

    Events

    To be announced

    Selected past events

  • Chris and Elea taught a 2-day workshop at the Foster School of Business, University of Washington, January 2017

  • Chris offered beginning and advanced tutorials at: 2016 SKIM/Sawtooth Software Conference.

  • Chris discussed the book in an invited talk at: 2015 Joint Statistical Meetings.

  • Elea presented "Designing New Products Using Choice Models in R" at: PhillyR Meeting, April 2015 [Slides].