I am trying to use random effects model for my regression analysis
model_re_subset = RandomEffects.from_formula('excess_return ~ 1 + ADJ_MV + BP + CP + change_in_esg_3yr + VAR', data=df_subset)
result_re_subset = model_re_subset.fit(cov_type="clustered", cluster_entity=True, cluster_time=True)
can someone tell me what is wrong with my code. I get an error: float object not divisible by zero
time period: 2013-2021 for 600 companies. observations: 4086
bear in mind that data for 3 years change in the time period of 2013-2015 is not in my df since I downloaded the data from 2013-2021.
when I run this code using ESG scores, 1 Year change or lag in the scores, it works fine.
if i drop those years, i get an error : No objects to concatenate
model_fe = PanelOLS.from_formula('excess_return ~ 1 + ADJ_MV + BP + CP + VAR + change_in_esg_3yr + EntityEffects + TimeEffects', data=df)
result_fe = model_fe.fit(cov_type="clustered", cluster_entity=True, cluster_time=True)
while this is my code for fixed effects, and this works perfectly when I use use the same variable
is this code for fixed effects correct as well
I am expecting see the beta coefficients for my esg variables
also, should i drop the first year for lag in esg and 1 year change in esg as well