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.


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


  • 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?

2 Answers 2


If the fixed effects you mentioned are some variables that must be included in the lasso model, then you can specify the argument penalty.factor in glmnet, such as penalty.factor = c(1,0,1), where 0 means this variable will always be in the model and 1 means this variables will be penalized.


The only advice I can give you deals not exactly with fixed effects, as you seem to already have some idea how to approach it.

But what I believe is, I can give you an advice on how to approach the 100+ features. Because some of these features may have some very high collinearity between each other.

I once answered a question regarding tht topic in the context of lasso. The post also includes sources to deal with multicollinearity while modeling, if you dont want to exclude variables upfront because of a deductive confirmatory way:


Maybe it helps you!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.