This book is in Open Review. We want your feedback to make the book better for you and other students. You may annotate some text by selecting it with the cursor and then click the on the pop-up menu. You can also see the annotations of others: click the in the upper right hand corner of the page

# 10 Regression with Panel Data

Regression using panel data may mitigate omitted variable bias when there is no information on variables that correlate with both the regressors of interest and the independent variable and if these variables are constant in the time dimension or across entities. Provided that panel data is available panel regression methods may improve upon multiple regression models which, as discussed in Chapter 9, produce results that are not internally valid in such a setting.

This chapter covers the following topics:

• notation for panel data
• fixed effects regression using time and/or entity fixed effects
• computation of standard errors in fixed effects regression models

Following the book, for applications we make use of the dataset Fatalities from the AER package which is a panel dataset reporting annual state level observations on U.S. traffic fatalities for the period 1982 through 1988. The applications analyze if there are effects of alcohol taxes and drunk driving laws on road fatalities and, if present, how strong these effects are.

We introduce plm(), a convenient R function that enables us to estimate linear panel regression models which comes with the package plm . Usage of plm() is very similar as for the function lm() which we have used throughout the previous chapters for estimation of simple and multiple regression models.

The following packages and their dependencies are needed for reproduction of the code chunks presented throughout this chapter on your computer:

• AER
• plm
• stargazer

Check whether the following code chunk runs without any errors.

library(AER)
library(plm)
library(stargazer)

### References

Croissant, Yves, Giovanni Millo, and Kevin Tappe. 2021. plm: Linear Models for Panel Data (version 2.4-3). https://CRAN.R-project.org/package=plm.
Kleiber, Christian, and Achim Zeileis. 2020. AER: Applied Econometrics with R (version 1.2-9). https://CRAN.R-project.org/package=AER.