I used R to implement the Fixed Effects regression model on panel data. Basically there are three major packages for FE model, lm, plm, and lfe. I want to evaluate the R-squared of these Fixed Effects model outputs as well as the F-statistics for significance. I found that lm produces one R-sq, plm produces one R-sq, and lfe produces two R-sqs. However, if you really look into them, they are all different! What the heck is going on?
According to the definitions from STATA, there are three types of R-squared of Fixed Effects model, within, between, and overall. Within R-sq means how much of the variation in the dependent variable within each entity group is captured by the model. Between R-sq represents how much of the variation in the dependent variable between each entity group is captured by the model. You can see the same structure in plm package, where you will define the model ("within" or "between") before fitting. This shows us, we should not just look at one R-squared to determine the model performance!