1

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
    ...
  • Results methods `wald_test` (or `f_test` in linear models) can be used for joint testing of user specified linear hypotheses. I guess that's closest. – Josef Oct 04 '22 at 16:34
  • for example https://stackoverflow.com/questions/48097949/statsmodels-patsy-hypothesis-testing-categorical-variable-in-constraint-c – Josef Oct 04 '22 at 16:42
  • @Josef Thank you a lot for your response. Could please tell me what would comparing of three groups would look like, let's say var 1, var 2, var 4, let's imaging that we have 7 varieties: var 1, 2, 3,4 ... ? – Oleh Zakharchuk Oct 09 '22 at 17:48

0 Answers0