# Articles by Economics and R - R posts

### Riddle: Estimate effect of x on y if you only have two noisy measures of x.

January 26, 2022 |

Consider the following data generating process: set.seed(1) n = 100000 x = rnorm(n) eta1 = rnorm(n) # measurement error1 noisy1 = x + eta1 eta2 = rnorm(n) # measurement error2 noisy2 = x + eta2 u = rnorm(n) beta0=0; beta1 = 1 y = beta0+beta1*x + u ... [Read more...]

### RTutor: Gasoline Taxes and Consumer Behavior

January 14, 2022 |

How do consumers react to an increase in gasoline taxes? How much will they drive less? Will they buy more fuel efficient cars? Do tax increases have a stronger impact than gasoline price increases from other sources, like higher oil prices? In their ...

### RTutor: What explains the employment drop in the great recession 2007-2009?

November 23, 2021 |

During the financial crisis and great recession from 2007 to 2009 the US lost 8.6 million jobs. We know that a lot of things happened in the crisis, like a crisis of trust in the financial system including the collapse of Lehman Brothers. Another relat... [Read more...]

### Visually assessing the parallel trends assumption for DID estimation with control variables

October 20, 2021 |

Difference-in-Difference (DID) estimation is a very intuitive and popular approach to estimate causal effects (see here for my take on teaching it). If you know about DID and want to directly know how to create a plot to assess the parallel trends assu... [Read more...]

### RTutor: Does Bank Lending Increase Before Elections?

October 12, 2021 |

Assume you are an incumbent local politician that can exert certain control on your local public savings bank. Would you try to increase lending before local elections to polish economic performance? In their great article Electoral Cycles in Savings ... [Read more...]

### Post election update: Will the German parliament have a gigantic size?

September 27, 2021 |

This is just a short update to my previous post. Bundestag elections are over and according to the preliminary official results the new Bundestag will have 735 members. That’s 32 more than the previous 703 members, but at least far from 841 members pre... [Read more...]

### Will the next German parliament have a gigantic size? A law and coding challenge…

September 24, 2021 |

On Sunday (26th of September), we will have the main parliamentary elections in Germany. The deepl translation of the election law states: §1 (1) Subject to the deviations resulting from this Act, the German Bundestag shall consist of 598 Members o... [Read more...]

### RTutor: Insurance and the Church

September 16, 2021 |

Finally an RTutor problem set about insurance! It is about time given that Ulm University is ranked worldwide as the 2nd best non-business school for research in Risk, Management and Insurance and Actuarial Sciences: Source: The UNL Global Resear... [Read more...]

### RTutor: Exploring Economic Impacts of COVID-19

August 18, 2021 |

An earlier post described the impressive collection of US data that Chetty et al. made available to illuminate the economic impacts of Covid and accompanying policy measures. As part of her Master thesis at Ulm university Alexandra Aehle has created a... [Read more...]

### xglue: Extended string interpolation for customized Latex tables and more.

May 19, 2021 |

I wrote my new R package xglue because for a recent working paper, we needed to generate several customized Latex tables, like the following excerpt: While all the data can be easily merged into a data frame in R, creating this fairly customized L... [Read more...]

### Waiving Covid-19 Vaccine Patents? I don’t think its a good idea…

May 7, 2021 |

Obviously, it seems absolutely essential to put a lot of resources into ramping up world-wide vaccine production with the goal to ensure that quickly almost everybody in the world has the chance to become vaccinated. But is a waiver of patents for Covi...

### Detailed Current Data on the Economic Impact of Covid-19

March 22, 2021 |

I was very impressed when watching Raj Chetty’s video presentation in the AEA panel “The Economic Impact and Policy Response to the Pandemic: What Happened in 2020 and What is Ahead?”. He is part of a group (Chetty, Friedman, Hendren, Stepner, and the ... [Read more...]

### SQLite is great for R and Shiny. The dbmisc package may help a bit.

March 16, 2021 |

Over the years I have written several Shiny apps that rely on SQLite databases. One example is my shiny app to find reproducible economic articles with data supplement: https://ejd.econ.mathematik.uni-ulm.de. The underlying data is stored in a SQLite d... [Read more...]

### Empirical Economics with R (Part D): Instrumental Variable Estimation and Potential Outcomes

February 23, 2021 |

Chapter 5 of my course Empirical Economics with R covers instrumental variable (IV) estimation. While being one of the most popular methods in academic economic papers for estimating causal effects (see e.g. the statistics here), I was not sure whethe... [Read more...]

### EU Vaccine Procurement and a Public Goods Dilemma

February 15, 2021 |

Many EU citizens (including me) are frustrated that due to lower supply, vaccinations in EU countries currently proceed substantially slower than in the US or the UK. In this post I make some simple economic arguments (illustrated with R) for how the common approach of the EU members might have ... [Read more...]

### Shiny without Shiny: RTutor in RStudio’s new Visual Markdown Mode

February 2, 2021 |

RStudio version 1.4 brought many great enhancements. My favorite feature is the new visual markdown editing mode. This allows to solve interactive RTutor problem sets with a shiny look directly in the RStudio editor. Here is a screenshot: The exam... [Read more...]

### Empirical Economics with R (Part C): Difference-in-Differences and Search Engine Marketing

January 27, 2021 |

Chapter 4 of my course Empirical Economics with R covers a popular strategy to estimate causal effects: difference-in-differences estimation. Inspired by Matt Taddy’s textbook example, the main application is to estimate the causal effects of search en... [Read more...]

### Estimating the probability that a vaccinated person still infects others with Covid-19

January 19, 2021 |

The estimated vaccine efficacies from the phase III clinical trials provide good information of how strongly a Covid-19 vaccine reduces the probability of a symptomatic Covid-19 infection in the vaccinated individual, e. g. 95% for the Biontech/Pfizer vaccine. However, the probability that a vaccinated person still becomes infected without symptoms ... [Read more...]

### Empirical Economics with R (Part B): Confounders, Proxies and Sources of Exogenous Variations

January 18, 2021 |

[This is a duplicate of the previous post, which was not detected by all blog aggregators.] Chapter 3 of my course Empirical Economics with R mainly dives into the difficulties of estimating causal effects. (See the previous post for an overview of th... [Read more...]

### Empirical Economics with R (Part A): The wine formula and machine learning

January 9, 2021 |

This semester I teach a new course: Empirical Economics with R. All material is online available, including video lectures with quizzes and interactive RTutor problem sets, which are perhaps the most important part of the course. One goal when designing the course was to motivate most concepts with one or ... [Read more...]
1 2 3 4