-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
70 lines (49 loc) · 3.74 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# feisr
<!-- badges: start -->
[![R-CMD-check](https://github.com/ruettenauer/feisr/workflows/R-CMD-check/badge.svg)](https://github.com/ruettenauer/feisr/actions/)
[![License](https://img.shields.io/badge/license-GPL%20%28%3E=%202%29-brightgreen.svg?style=flat)](https://www.gnu.org/licenses/gpl-2.0.html)
[![CRAN status](https://www.r-pkg.org/badges/version/feisr)](https://CRAN.R-project.org/package=feisr/)
[![cran checks](https://cranchecks.info/badges/worst/feisr)](https://cran.r-project.org/web/checks/check_results_feisr.html)
<!-- badges: end -->
The packages feisr provides a function to estimate fixed effects individual slope (FEIS) models in R. FEIS models constitute a more general version of the often used conventional fixed effects (FE) panel models. In contrast to conventional fixed effects models, data are not person 'demeaned', but 'detrended' by the predicted individual slope of each person, which relaxes the assumptions of parallel trends between treated and untreated groups. For more information see Brüderl and Ludwig (2015); Frees (2001); Polachek and Kim (1994); Rüttenauer and Ludwig (2020); Wooldridge (2010).
## Installation
You can install feisr from cran with:
```{r cran-installation, eval = FALSE}
install.packages("feisr")
```
You can install the latest development version from github with:
```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("ruettenauer/feisr")
```
## Example
The following example investigates the 'marriage wage premium': we test whether marriage leads to an increase in the hourly wage for men. The packages provides the function feis to estimate fixed effects individual slope models, which control for the hypothesis that those men who marry earlier also have a steeper wage growth over time. Similar to the plm function, feis requires to indicate a unique person / group identifier. To include individual-specific slopes, feis uses two-part formulas (expr | slope_expr), where slope_expr gives the expression for modelling the individual slopes. In our example, we use work experience (exp) and squared work experience as the slope variables:
```{r example1}
library(feisr)
data("mwp", package = "feisr")
feis.mod <- feis(lnw ~ marry + enrol + yeduc + as.factor(yeargr)
| exp + I(exp^2), data = mwp, id = "id")
summary(feis.mod)
```
The package also comes with an artificial regression test, which performs a Hausman-like test comparing FEIS against FE, FEIS against random effects (RE), and FE against RE models. The function feistest can be used with cluster-robust standard errors:
```{r example2}
ht <- feistest(feis.mod, robust = TRUE, type = "all")
summary(ht)
```
## References
Brüderl J, Ludwig V (2015). "Fixed-Effects Panel Regression." In H Best, C Wolf (eds.), The Sage Handbook of Regression Analysis and Causal Inference, pp. 327-357. Sage, Los Angeles. ISBN 1446252442.
Frees EW (2001). "Omitted Variables in Longitudinal Data Models." Canadian Journal of Statistics, 29(4), 573-595. https://doi.org/10.2307/3316008.
Polachek SW, Kim MK (1994). "Panel Estimates of the Gender Earnings Gap." Journal of Econometrics, 61(1), 23-42. https://doi.org/10.1016/0304-4076(94)90075-2.
Rüttenauer T, Ludwig V (2020). "Fixed Effects Individual Slopes: Accounting and Testing for Heterogeneous Effects in Panel Data or Other Multilevel Models." Sociological Methods and Research, OnlineFirst. https://doi.org/10.1177/0049124120926211.
Wooldridge JM (2010). "Econometric Analysis of Cross Section and Panel Data." MIT Press, Cambridge, Mass. ISBN 0262294354.