class_docstr: Tests the plot_comparisons function for different combinations of
  contrast and conditional variables, and user inputs.
class_docstr_tok: ["Tests","the","plot_comparisons","function","for","different","combinations","of","contrast","and","conditional","variables",",","and","user","inputs","."]
code: def test_group_effects(self, sleep_study):
      model, idata = sleep_study
  
      # contains new unseen data
      plot_comparisons(
          model, idata, "Days", "Subject", sample_new_groups=True
      )
      # user passed values seen in observed data
      plot_comparisons(
          model,
          idata,
          contrast={"Days": [2, 4]},
          conditional={"Subject": [308, 335, 352, 372]},
      )
  
      with pytest.raises(
          ValueError,
          match="There are new groups for the factors \('Subject',\) and 'sample_new_groups' is False.",
      ):
          # default: sample_new_groups=False
          plot_comparisons(model, idata, "Days", "Subject")
  
imports: from os.path import dirname, join
  import numpy
  import pandas
  import matplotlib.pyplot
  import pytest
  import bambi
  from bambi.interpret import plot_comparisons, plot_predictions, plot_slopes
label_desc: Use image node_id 7 for calling the TestComparison obj's underlying member method code with example usage: obj.test_group_effects(sleep_study) without return types