Market Analysis Course (Interactive, Free, and with a lot of R)

[This article was first published on Economics and R - R posts, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

In this Corona semester, I have created at Ulm University a new online course Market Analysis with Econometrics and Machine Learning. I put the course material on this Github repository but you can work through most of the course directly online.

Shiny apps with videos and quizzes

For an illustration of the course take a look at the shiny app with videos and quizzes for chapter 2b (Random Forests and Causal Forests):

Interactive RTutor problem sets

Each section also has an interactive RTutor problem set where you work yourself through the material in R. You can automatically check your solutions and get hints. Here is a demo for Section 2b on

(Note that the density of xkcd comics in the awards strongly increases from Section 2a onwards.) Given my limited budget I only have a free account which has quite limited monthly usage hours. To solve the RTutor problem sets, you should install them on your own computer (explained further below) or solve them on the rstudio cloud here:

Take a look at the README in the rstudio cloud project. Also this youtube video helps to get started with the first RTutor problem set, which is designed to be solved inside RStudio.

Course content

The course consists of the following 3 chapters.

Chapter 1 almost directly start with the following plot of (fictitious) historical sales data

to illustrate why it is usually a very bad idea to just run a regression or a more fancy machine learning prediction model on such historical data to estimate a demand function. We then work through the econometric background focusing on endogeniety problems and approaches for estimating causal effects. Here are the links to the video quiz shiny apps:

Chapter 2 contrasts econometric modelling with the typical machine learning approach and covers some prediction algorithms like random forests. We discuss which questions can be well treated as classical prediction problems and in which situations good prediction accuracy on a test data set may not be a relevant criterion for the actual question we are interested in. We also illustrate causal forests, which is a novel method to identify heterogeneous causal effects in experiments.

Chapter 3 covers discrete choice models.

Local Installation for RTutor Problem Sets

To locally install the RTutor problem sets download and extract the ZIP of the MarketAnalysis Github repository.

Then run setup/install_packages.R to install all packages and look the file setup/setup.html to get started (here is a weblink). The instructions were created for the course at Ulm university where the problem sets were hosted on Moodle. If you have downloaded the Github version of the course, you find all problem sets in the directory RTutor (Of course, you won’t be able to submit your solved problem sets anywhere if you are not a student at Ulm University who takes the course.)

To run the web-based problem sets starting from Section 2a, open the file RTutor/run_ps.R and then follow the steps described there.

Other Courses Using RTutor

You can take a look at this previous blog post for a short description of three other courses that use RTutor problem sets.

To leave a comment for the author, please follow the link and comment on their blog: Economics and R - R posts. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)