The following page gives an example of f-test in statsmodels: f_test
>>> import numpy as np
>>> import statsmodels.api as sm
>>> data = sm.datasets.longley.load()
>>> data.exog = sm.add_constant(data.exog)
>>> results = sm.OLS(data.endog, data.exog).fit()
>>> A = np.identity(len(results.params))
>>> A = A[1:,:]
Say that I modify the second example from the link, so that it becomes:
>>> from statsmodels.datasets import longley
>>> from statsmodels.formula.api import ols
>>> dta = longley.load_pandas().data
>>> formula = 'TOTEMP ~ UNEMP.shift(1) + UNEMP.shift(2) + UNEMP.shift(3) '
>>> results = ols(formula, dta).fit()
How do I write the code to test whether the UNEMP lags are jointly significant?