Publications by Economics and R - R posts

A shiny quiz app about the Russian influence campaign before the 2016 US elections

05.03.2020

Based on Robert S. Mueller’s investigations about foreign involvement in the 2016 US presidential elections US Congress created this website with the title “Exposing Russia’s Effort to Sow Discord Online: The Internet Research Agency and Advertisements”. It refers to the Internet Research Agency (IRA) as ‘the notorious Russian “troll�...

2544 sym 2 img

Data Science Courses for Economists and Epidemiologists using RTutor

25.03.2020

Were there no Corona virus pandemic, German Universities would regularly start the summer semester in around a month (soon after Eastern). Now, it seems likely that courses will be offered digitally and students must learn from home. If you have a course that uses R, you may take a look at RTutor. It allows students to solve interactive problem s...

3615 sym 2 img

RTutor: How would Carbon Pricing Affect US Electricity Production?

25.05.2020

One way by which carbon pricing can reduce CO2 emmissions is by shifting electricity production from coal power plants to natural gas plants. A combined cycle gas turbine emits roughly only half as much CO2 per MWh produced electricity than a coal power plant. (Unfortunately, a substantial part of those benefits may be negated unless methane leak...

2502 sym 4 img

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

10.06.2020

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 wit...

4539 sym 4 img

Finding Economic Articles with Data (2nd Update)

25.06.2020

Almost a year is now gone since I posted my last update about my shiny-powered search app. It allows to search among currently more than 5000 economic articles that have an accessible data and code supplement: https://ejd.econ.mathematik.uni-ulm.de The main data for my app can be downloaded as a zipped SQLite database from my server. Let us do s...

1836 sym R (3458 sym/5 pcs) 6 img 2 tbl

Puzzling Regression Anatomy

01.07.2020

Consider a regression model with the following causal structure: The variable x1 affects y directly and also indirectly via x2. The following R code implements the model and simulates a corresponding data set. set.seed(1) n = 10000 beta1 = 1; beta2=1 x1 = rnorm(n,0,1) x2 = x1+rnorm(n,0,1) y = beta1*x1 + beta2*x2 + rnorm(n,0,1) Assume we want to...

6206 sym R (1679 sym/11 pcs) 6 img

RTutor: How much less effective are publicly assigned lawyers?

06.07.2020

So far, my main source of information about the US justice system have been tv shows like Suits, or The Good Wife. They suggest that hiring yourself a good lawyer can be quite expensive but may have a big impact on the verdict. But that are tv shows. What can we infer from real world data? Amanda Agan, Matthew Freedman and Emily Owens study this ...

3129 sym 4 img

RTutor: Quantifying Social Spillovers in Movie Ticket Sales

14.07.2020

Probably many of us would be more inclined to watch a particular movie in cinema if some friends or colleagues have already seen it and talk about it (at least if it is a decent movie). Duncan Sheppard Gilchrist and Emily Glassberg Sands quantify such social spillover effects in their great article Something to Talk About: Social Spillovers in Mo...

3146 sym 4 img

An Interesting Aspect of the Omitted Variable Bias

31.08.2020

Econometrics does not cease to surprise me. I just now realized an interesting feature of the omitted variable bias. Consider the following model: Assume we want to estimate the causal effect beta of x on y. However, we have an unobserved confounder z that affects both x and y. If we don’t add the confounder z as control variable in the regres...

4839 sym R (480 sym/3 pcs) 6 img

Solving Interactive R Exercises: RStudio Editor vs Shiny Web Interface

08.09.2020

My course Market Analysis with Econometrics and Machine Learning uses a lot of RTutor problem sets where students can solve interactive exercises with automatic hints and checks of their solutions. One can design RTutor problem sets to be solved in a shiny web interface (for an example see https://skranz.shinyapps.io/MarketAnalysis_2b), which is ...

2698 sym 2 img