class_docstr: Tests the 'plot_slopes' function for different combinations, elasticity,
  and effect types (unit and average slopes) of 'wrt' and 'conditional'
  variables.
class_docstr_tok: ["Tests","the","'plot_slopes","'","function","for","different","combinations",",","elasticity",",","and","effect","types","(","unit","and","average","slopes",")","of","'wrt","'","and","'conditional'","variables","."]
code: def test_group_effects(self, sleep_study):
      model, idata = sleep_study
  
      # contains new unseen data
      plot_slopes(
          model, idata, "Days", "Subject", sample_new_groups=True
      )
      # user passed values seen in observed data
      plot_slopes(
          model, idata, wrt={"Days": 2}, conditional={"Subject": 308}
      )
  
      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_slopes(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 8 for calling the TestSlopes obj's underlying member method code with example usage: obj.test_group_effects(sleep_study) without return types