Skip to content

Effects option does not take effects for predict method? #260

@FeiYao-Edinburgh

Description

@FeiYao-Edinburgh

Hi there,

I am using linearmodels to modelling panel data. I just found that the predict method returned me exactly identical results whether I set effects option True or False. They are identical to fitted_values, too, if predictions were made on model data. I believe they are all predictions made by slope and common constant only? Below I provide my codes and relevant outputs for you to check. If no difference, then I do not comprehend the significance of effects option. Or does this option has some other meanings that I do not know?

  • Codes
from linearmodels.datasets import wage_panel
import pandas as pd
data = wage_panel.load()
data = data.set_index(["nr", "year"])

from linearmodels.panel import PanelOLS
exog_vars = ["expersq", "union", "married"]
exog = sm.add_constant(data[exog_vars])
mod = PanelOLS(data.lwage, exog, entity_effects=True)
fe_res = mod.fit()

fe_res.predict(exog.head(), effects = False)
fe_res.predict(exog.head(), effects = True)
fe_res.fitted_values.head()
  • Outputs
    image

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions