Michael Grogan shows us how to use the plm
package to perform linear regression against panel data:
Types of data
- Cross-Sectional: Data collected at one particular point in time
- Time Series: Data collected across several time periods
- Panel Data: A mixture of both cross-sectional and time series data, i.e. collected at a particular point in time and across several time periods
- Fixed Effects: Effects that are independent of random disturbances, e.g. observations independent of time.
- Random Effects: Effects that include random disturbances.
Let us see how we can use the
plm
library in R to account for fixed and random effects. There is a video tutorial link at the end of the post.
Read on for an example.