Site icon R-bloggers

RTutor: How Soap Operas Reduced Fertility in Brazil

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

What is the real world impact of tv series? Did Brazilian women get fewer children because they watched soap operas that portray happy, rich families that have few children?

Clara Ulmer has written a very nice RTutor problem set that allows you interactively explore this question in R. It is based on the paper

Soap Operas and Fertility: Evidence from Brazil by Eliana La Ferrara, Alberto Chong and Suzanne Duryea, American Economic Journal: Applied Economics (2012)

While correlations between two time series can be quickly found, the challenge in many econometric studies is to convincingly establish causal effects. The main analysis is based on a micro data panel data set that contains births and background characteristics for Brazilian woman over several years. The analysis exploits the fact that the relevant TV broadcast company entered at different points of time in different regions.

The regression analysis starts with Exercise 4. Subsequently you can explore many robustness checks (e.g. placebo regressions), that make actually a quite convincing case for the presence of a causal effect of soap operas on fertility.

The panel data analysis in the problem set extensively uses the R package lfe. In my view lfe is quite a nice package, that allows to quickly run multiway fixed effect regressions on considerably large data sets. In addition, many functionality that empirical economists commonly use, like instrumental variables or clustered robust standard errors can be very conveniently accessed. For economists that currently use Stata but are thinking of moving to R, the lfe package may be removing some considerable obstacles. You can check it out in Clara's problem set.

Here is a screenshot:



To install and try out the problem set locally, follow the instructions here:

https://github.com/ClaraUlmer/RTutorSoapOperas

There is also an online version hosted by shinyapps.io that allows you explore the problem set without any local installation. (The online version is capped at 30 hours total usage time per month. So it may be greyed out when you click at it.)

https://claraulmer.shinyapps.io/RTutorSoapOperas

If you want to learn more about RTutor, to try out other problem sets, or to create a problem set yourself, take a look at the RTutor Github page

https://github.com/skranz/RTutor

To leave a comment for the author, please follow the link and comment on their blog: Economics and R - R posts.

R-bloggers.com 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.