In SAS there is CONTRAST statement that allows the comparison of only particular groups/means based on the model constructed with all data. In SAS L vector is used for such operations. https://documentation.sas.com/doc/en/statug/15.2/statug_glm_syntax06.htm Is there the same/similar functionality in python's statsmodels/patsy?
my patsy formula looks like that:
model = ols("value ~ C(variety, Sum)", data=df).fit()
the data I have looks like that:
--value--variety
1 var 1
32. var 2
...