Welcome to the companion web site to the book
Using R for Introductory Econometrics, 2nd edition
by Florian Heiss
It can be
- purchased as a hardcopy at or other retailers for a list price of USD 26.90 or
- read online here as a HTML online book.
Comments on the first edition:
"A very nice resource for those wanting to use R in their introductory econometrics courses."
(Jeffrey M. Wooldridge)
"Using R for Introductory Econometrics is a fabulous modern resource. I know I'm going to be using it with my students, and I recommend it to anyone who wants to learn about econometrics and R at the same time."
(David E. Giles)
Content and Approach
This book introduces the popular, powerful and free programming language and software package R with a focus on the implementation of standard tools and methods used in econometrics. Unlike other books on similar topics, it does not attempt to provide a self-contained discussion of econometric models and methods. Instead, it builds on the excellent and popular textbook "Introductory Econometrics" by Jeffrey M. Wooldridge. Some other editions and versions work as well, see below. It is compatible in terms of topics, organization, terminology and notation, and is designed for a seamless transition from theory to practice. Topics include:
- A gentle introduction to R
- Data wrangling and graphics with the tidyverse
- Simple and multiple regression in matrix form and using black box routines
- Inference in small samples and asymptotics
- Monte Carlo simulations
- Time series regression
- Pooled cross-sections and panel data
- Instrumental variables and two-stage least squares
- Simultaneous equation models
- Limited dependent variables: binary, count data, censoring, truncation, and sample selection
- Formatted reports and research papers combining R with R Markdown or LaTeX
The chapters have the same names and cover the same material as the respective chapters in Wooldridge’s textbook. Assuming the reader is familiar with the concepts discussed there, this book explains and demonstrates how to implement everything in R and replicates many textbook examples. We also open some black boxes of the built-in functions for estimation and inference by directly applying the formulas known from the textbook to reproduce the results. Some supplementary analyses such as Monte Carlo simulations provide additional intuition and insights.
The book is designed mainly for students of introductory econometrics who ideally use Wooldridge’s “Introductory Econometrics” as their main textbook. It can also be useful for readers who are familiar with econometrics and possibly other software packages, such as Stata. For them, it offers an introduction to R and can be used to look up the implementation of standard econometric methods.
All computer code used in this book can be downloaded to make it easier to replicate the results and tinker with the specifications.
What's new in the second edition?
- The new Section 1.5 introduces the concepts of the "tidyverse". This set of packages offers a convenient, powerful, and recently very popular approach to data manipulation and visualization. Knowledge of the tidyverse is not required for the remainder of the book but very useful for working with real world data.
- Section 1.3.6 on data import and export has been updated. It now stresses the use of the packages haven and rio which are newer and for most applications both more powerful and more convenient than the approaches presented in the first edition.
- There is a new R package "wooldridge" by Justin M. Shea and Kennth H. Brown. It very conveniently provides all example data sets. All example R scripts have been updated to use this package instead of loading the data from a data file.
- When discussing financial time series data in Section 10.2, the second edition now uses the "quantmod" instead of the "pdfetch" package.
- An introduction of ANOVA tables has been added in Sections 6.1.5, 7.3, and 7.4.
- Various smaller additions and updates are added and numerous errors, typos, and unclear explanations have been fixed.
Many readers have contributed by pointing out errors and other problems, asking questions that helped to identify unclear explanations and making suggestions for improvements. I am especially grateful to Gawon Yoon, Liviu Andronic, Daniel Gerigk, Daniel Brunner and Lars Grönberg.
Also Interested in Python?
There is also a new sister book “Using Python for Introductory Econometrics”, coauthored by Daniel Brunner and published at the same time as this second edition of the R book. We are using the same structure, the same examples, and even much of the same text where it makes sense. This decision was not only made for laziness. It also helps readers to easily switch back and forth between the books. And if somebody worked through this R book, she can easily look up the pythonian way to achieve exactly the same results and vice versa, making it especially easy to learn both languages.
Which one should you start with (given your professor hasn’t made the decision for you)? Both share many of the advantages like having a huge and active user community, being widely used inside and outside of academia and being freely available. R is traditionally used in statistics, while Python is dominant in machine learning and artiﬁcial intelligence. These origins are still somewhat reﬂected in the availability of specialized extension packages. But most of all data analysis and econometrics tasks can be equally well performed in both packages. At the end, it’s most important point is to get used to the workﬂow of some dedicated data analysis software package instead of not using any software or a spreadsheet program for data analysis.
Note about other "Introductory Econometrics" versions
- The 7th edition of Wooldridge's "Introductory Econometrics" was published in 2019.
- The 6th edition of Wooldridge's "Introductory Econometrics" was published in 2016. Some examples got different numbers, but you will find everything.
- The 5th edition of Wooldridge's "Introductory Econometrics" was published in 2013. While it misses some parts, it works as well.
- The 5th international edition of Wooldridge's "Introductory Econometrics" published in 2013 and lacks even more material, but for our purposes it works without any problems.
- Older editions are not perfectly compatible with regard to references to sections and examples.
- The book Introduction to Econometrics by Jeff Wooldridge published in 2014 is officially available in Europe, the Middle East, and Africa only. It is mostly consistent in terms of the main chapters, but does not include exercises, the appendices on fundamental math, probability, and statistics, and other material.
About the book
The book started as a collection of notes to myself on how to do stuff in R. I expanded and annotated it and to make it available to my students. After it looked more and more like a book, I decided to put more effort into it and actually make it available to the public. The book is self-published and not professionally edited. Once you get over the hideous layout and appalling grammar, you can start enjoying the benefits: