Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 12
    To be explicit, the syntax is "y ~ C(Location, Treatment(reference='China'))" . Commented Jul 26, 2015 at 10:26
  • 2
    @PiotrMigdal thanks for clarifying. I wish the original answer actually included code. Commented Aug 6, 2018 at 8:28
  • 4
    "y ~ C(Location, Treatment('China'))" works as well. Commented Apr 1, 2019 at 22:17
  • 3
    @jseabold , I'm getting error as follows PatsyError: Error evaluating factor: TypeError: 'Series' object is not callable. while doing the above two methods. Do you have any idea ? Commented Nov 17, 2022 at 8:08
  • I am having this problem as well. "TypeError: 'Series' object is not callable" Commented Sep 27, 2023 at 14:02