<jupyter_start><jupyter_text>mod = PanelOLS(dfp.value, dfh.value, entity_effects=True)res = mod.fit(cov_type='clustered', cluster_entity=True)print(res)<jupyter_code>from linearmodels.panel import PanelOLS
exog_vars1 = ['households','income']
exog1 = sm.add_constant(dfm[exog_vars1])

mod = PanelOLS(dfm.gini, exog1, entity_effects=True, time_effects=True)
fe_te_res = mod.fit()
print(fe_te_res)
from linearmodels.panel import compare
print(compare({'RE':re_res,'Pooled':fe_te_res}))<jupyter_output>Model Comparison                      
=============================================================
                                     Pooled                RE
-------------------------------------------------------------
Dep. Variable                          gini              gini
Estimator                          PanelOLS     RandomEffects
No. Observations                      13056             13056
Cov. Est.                        Unadjusted        Unadjusted
R-squared                            0.2406            0.2762
R-Squared (Within)                   0.2570            0.2757
R-Squared (Between)                 -1.8887           -1.4826
R-Squared (Overall)                 -1.0431           -0.7958
F-statistic                          2043.5            995.87
P-value (F-stat)                     0.0000            0.0000
==========================     ============   ===============
const                                0.1384            0.1790
        [...]
StarcoderdataJupyterStructuredCleanDedup