# Including Fixed Effects in a LASSO/Elastic Net regression model (in R)

So this is a question has vaguely been asked before (see 1 and 2) but I have not been able to find a conclusive answer for anywhere.

Essentially I have panel data for 300 US firms between 2012-2020 with 100+ variables related to their performance in environmental, social and governance (ESG) areas. Now, my analysis is focused on understanding how performance in these ESG areas impacts firm value. The literature generally uses a combined ESG score in a fixed effects model to answer this question.

ie.

Firm value = Fixed effects + Control Variables + ESG score

Given that I have over 100 variables related to ESG scores I want to run an adaptive LASSO/Elastic Net in order to penalize coefficients and get a few ESG scores which impact firm value the most.

I dont know how to estimate a penalizing model with fixed effects so I thought I would simply do a LASSO/Elastic net regression (using glmnet) of the 100 ESG variables against firm value and not include fixed effects or control variables. Then whichever variables were significant, I would run a seperate regression, with fixed effects, control variables and the relevant ESG variables using the plm package.

However from what I have seen online, this approach is generally frowned upon. I have seen the glmmLasso package may allow me to include fixed effects into a model but I want to get some further advice.

Thank you in advance for any help you can give

EDIT:

• I have come across this paper talking about OLS post-LASSO (here) which I believe justifies doing the LASSO then re-estimating with fixed effects.
• Alternatively, could I de-mean all my observations by group manually (ie. manually implement the within estimator) and this be a better approach?