I have fit a linearmodels.PanelOLS
model and stored it in m
. I now want to test if certain coefficients are simultaneously equal to zero.
Does a fitted linearmodels.PanelOLS
object have an F-test function where I can pass my own restriction matrix?
I am looking for something like statsmodels' f_test
method.
Here's a minimum reproducible example.
# Libraries
from linearmodels.panel import PanelOLS
from linearmodels.datasets import wage_panel
# Load data and set index
df = wage_panel.load()
df = df.set_index(['nr','year'])
# Add constant term
df['const'] = 1
# Fit model
m = PanelOLS(dependent=df['lwage'], exog=df[['const','expersq','married']])
m = m.fit(cov_type='clustered', cluster_entity=True)
# Is there an f_test method for m???
m.f_test(r_mat=some_matrix_here) # Something along these lines?