Comments (4)
Hi, thanks for the question: it's always good to explicit implicit choices!
In all honesty, no, I don't happen to know a reference. I did define the adj-R2 as I thought had more sense, but it hasn't strong theoretical roots.
In the reference you mention, I don't see however a strong justification for not adjusting for the number of FEs.
With the adjustment, we're closer to the adjusted-R2 of the projected model than without adjustment. Following on your example, here's the adj-R2 of the projected model:
library(data.table)
base = as.data.table(Grunfeld)
base[, c("inv_m", "value_m", "capital_m") := .(mean(inv), mean(value), mean(capital)), by = firm]
base[, c("inv_dm", "value_dm", "capital_dm") := .(inv - inv_m, value - value_m, capital - capital_m)]
# Estimation on the demeaned variables
res_dm = feols(inv_dm ~ -1 + value_dm + capital_dm, base)
r2(res_dm, "ar2")
# 0.7655796
And the previous adj-R2 seems natural, no?
Apart from similarity across software (which is already an important point), do you have strong objections in using it? Or any suggestion?
from fixest.
I am not aware of any literature either. Stata does not make it explicit, neither does lfe
. I just thought there is some kind of convension around this but maybe it is just a coincident both implementations just apply the normal formula for adj. R^2 to within models. The manual for gretl mentions there is no clear definition for an adj. R^2 for within models which is why the authors abstain from an attempt to calculate it.
Currently, I do not have a feeling about that is "more correct" for calculation of adj. R^2 for FE. Maybe something like the ratio of R^2/adj. R^2 should be similar for the OLS and FE cases for a range of parameters could serve as a reference (~= making adj. R^2 for FE imposing a similar panelty for additional model parameters as in the OLS case). Or the reference you suggested to the projected model. Maybe both approaches coincide or lead to similar suggestions.
An observation about the projected model's adj. R^2: summary.lm
gives a different result than feols
+ r2
for your example. Without investigating, I would assume this is due to summary.lm
taking special care of the non-intercept case:
print(summary(lm(inv_dm ~ 0 + value_dm + capital_dm, data = base)), 16)
Multiple R-squared: 0.7667575837481406, Adjusted R-squared: 0.7644015997455966
from fixest.
It makes me think that I don't detail it in the help pages, and I'll update that so it will remove confusion.
By the way, you were right on the cause of the difference with the lm
ar2! It's indeed the adjustment for the absence of intercept.
It's so corner-case.. but I may fix it so the two are aligned.
Anyway, thanks for raising the topic!
from fixest.
Hi, I finally corrected the small differences in adj. R2 when there is no intercept. I also added in the details section how the adjustment is done.
The new release should come soon. Thanks for the comments, I'm closing then.
from fixest.
Related Issues (20)
- Update method does not work when estimation is wrapped in function
- LHS formula macros are expanded into sums with instrumental variables
- How to compute Average Partial Effects(APE)/Average Marginal Effects(AME) HOT 3
- `group` argument from `setFixest_etable` is not passed to `etable`
- `etable()`: `extralines` errors with only one model
- Replicate plm::pmg
- Conflicting benchmark results HOT 1
- Calculating ATT for a given range of post-periods HOT 1
- feols() no longer dependent variables in a list within list of samples
- Error when multiple estimation with offset HOT 1
- notes section misplaced if used with style.tex argument adjustbox = TRUE
- Negative R squared in IV regression HOT 1
- Weighted Dependent Variable Mean In etable HOT 2
- Variance Inflation Factors HOT 3
- Compatibility issue with ```fixest_multi``` from older version
- Collinearity diagnostics with fixed effects and more than two predictor variables HOT 1
- Any plan to include Hodrick (1992) standard errors?
- HC2, HC3, and Heteroskedasticity-Unbiased Standard Errors HOT 3
- Ordering of automatic headers from etable
- local variable XYZ assigned but may not be used
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fixest.