I'm trying to do an F-test of equality of coefficient for the three experimental groups I have in my data.
I've run a regression to evaluate the results of a random control trial that included four groups, G1, G2, G3 and control.
Now I need to determine that the experimental groups (G1, G2, G3) are equal.
I know I can do this using Statsmodel's OLSResults.f_test. But I am unclear on how to configure it. The website gives examples, but I'm not sure how to translate it: https://www.statsmodels.org/stable/generated/statsmodels.regression.linear_model.OLSResults.f_test.html
The example given there is:
from statsmodels.datasets import longley
from statsmodels.formula.api import ols
dta = longley.load_pandas().data
formula = 'TOTEMP ~ GNPDEFL + GNP + UNEMP + ARMED + POP + YEAR'
results = ols(formula, dta).fit()
hypotheses = '(GNPDEFL = GNP), (UNEMP = 2), (YEAR/1829 = 1)'
f_test = results.f_test(hypotheses)
print(f_test)
How do I essentially write the below hypotheses so that I can check whether my 3 experimental groups are different?
hypotheses = '(G1=G2), (G1=G3), (G2=G3)'