You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -39,45 +37,37 @@ regife(df, @model(Sales ~ Price, ife = (pState + pYear, 2), fe = pState), save =
39
37
df = dataset("plm", "Cigar")
40
38
```
41
39
42
-
When the only regressor is `0`, `fit` fits a factor model
40
+
When the only regressor is `0`, `regife` fits a factor model
43
41
```julia
44
42
Sales ~ 0
45
43
```
46
44
47
-
Otherwise, `fit` fits a linear model with interactive fixed effects (Bai (2009))
45
+
Otherwise, `regife` fits a linear model with interactive fixed effects (Bai (2009))
48
46
```julia
49
47
Sales ~ Price + Year
50
48
```
51
-
- Interactive fixed effects are indicated with the keyword argument `ife`. Variables must be of type `PooledDataVector`. The rank is the number of components to use. facFor instance, for a factor model with id variable `State`, time variable `Year`, and rank `r` equal to 2:
49
+
50
+
Interactive fixed effects are indicated with the function `ife`. For instance, to specify a factor model with id variable `State`, time variable `Year`, and rank 2, use `ife(State, Year, 2)`.
52
51
53
-
```julia
54
-
df.pState = categorical(df.State)
55
-
df.pYear = categorical(df.Year)
56
-
ife = (pState + pYear, 2)
57
-
```
52
+
High-dimensional Fixed effects can be used, as in `fe(State)` but only for the variables specified in the factor model. See [FixedEffectModels.jl](https://github.com/matthieugomez/FixedEffectModels.jl) for more information
58
53
59
-
- Fixed effects are indicated with the keyword argument `fe`. Use only the variables specified in the factor model. See [FixedEffectModels.jl](https://github.com/matthieugomez/FixedEffectModels.jl) for more information
60
-
61
-
```julia
62
-
fe = pState
63
-
fe = pYear
64
-
fe = pState + pYear
65
-
```
66
54
67
55
- Standard errors are indicated with the keyword argument `vcov`
68
56
```julia
69
57
vcov = robust()
70
-
vcov = cluster(StatePooled)
71
-
vcov = cluster(StatePooled, YearPooled)
58
+
vcov = cluster(State)
59
+
vcov = cluster(State, Year)
72
60
```
73
61
74
-
- weights are indicated with the keyword argument `weights`
75
-
```julia
76
-
weights = Pop
77
-
```
62
+
- The option `weights` can add weights
63
+
64
+
```julia
65
+
weights = :Pop
66
+
```
67
+
78
68
- The option `method` can be used to choose between two algorithms:
79
-
- `levenberg_marquardt`
80
-
- `dogleg`
69
+
- `:levenberg_marquardt`
70
+
- `:dogleg`
81
71
- The option `save = true` saves a new dataframe storing residuals, factors, loadings and the eventual fixed effects. Importantly, the returned dataframe is aligned with the initial dataframe (rows not used in the estimation are simply filled with NA).
82
72
83
73
@@ -95,9 +85,7 @@ Yes. Factor models are a particular case of interactive fixed effect models. Sim
95
85
```julia
96
86
using DataFrames, RDatasets, InteractiveFixedEffectModels
97
87
df = dataset("plm", "Cigar")
98
-
df.pState = categorical(df.State)
99
-
df.pYear = categorical(df.Year)
100
-
regife(df, @model(Sales ~ 0, ife = (pState + pYear, 2), fe = pState), save = true)
0 commit comments