I want to perform an OLS Panel Regression
import pandas as pd
import numpy as np
import statsmodels.api as sm
from linearmodels.datasets import wage_panel
from linearmodels.panel import PanelOLS
data = wage_panel.load()
But I get this error:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-fe79e40655e1> in <module>
3 import statsmodels.api as sm
4
----> 5 from linearmodels.datasets import wage_panel
6 from linearmodels.panel import PanelOLS
7
ModuleNotFoundError: No module named 'linearmodels'
I have no idea why this happens. Any ideas?
"linearmodels" is a separate package, see https://github.com/bashtage/linearmodels. Therefore, it must be installed separately:
pip install linearmodels
works for me.