Why R (and not Python)?

First things first, there is nothing that R can do that Pyhton can’t and vice verca. From our perspective, the main difference between the two is their purpose - Python is a general purpose programming language, whereas R was designed by statisticians (and a like) for statisticians. This means that R comes with thousands of built-in and user contributed libraries that help with statistical and econometric analysis. Python can do all that, but in many cases that are important to us, you’ll need to code R procedures in Python from scratch.

For instance, during this course we will make use of the causalTree and grf R packages (created by Susan Athey et al.). These packages use trees and forests in order to estimate heterogeneous treatment effects. causalTree and grf extend the popular rpart R package, to deal with the task of of estimating causal effects. If you want to perform a causal tree analysis with Python, you’ll have to program the whole thing by yourself. Though this could serve as a valuable exercise (and it even appears as an open issue in the grf project repository), it is way beyond the scope of this course.


A website created by Itamar Caspi using RMarkdown.

Disclaimers: (1) The official syllabus and the content on the official Moodle website shall always prevail in case of any discrepancy or inconsistency between this website and its official HUJI versions; (2) This website and its content do not necessarily reflect the views of the Bank of Israel or any of its staff.