Skip to main content
11 events
when toggle format what by license comment
May 17, 2024 at 3:02 comment added stat_is_quo "TypeError: 'Series' object is not callable" will occur if you get the syntax wrong and fail to add the "Treatment" piece. If your variable is "Location" to set the reference group to "China" you need "y ~ C(Location, Treatment('China'))". If you type "y ~ C(Location('China'))", you will get this error because you are trying to call on the pd.Series directly.
Sep 27, 2023 at 14:02 comment added Jacob Anderson I am having this problem as well. "TypeError: 'Series' object is not callable"
Nov 17, 2022 at 8:08 comment added Nayana Madhu @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 ?
S Oct 19, 2020 at 19:50 history suggested ChristopherTull CC BY-SA 4.0
Incorporated Piotr Migdal's comment into the answer.
Oct 18, 2020 at 20:50 review Suggested edits
S Oct 19, 2020 at 19:50
May 7, 2019 at 8:04 review Suggested edits
May 7, 2019 at 10:41
Apr 1, 2019 at 22:17 comment added steven "y ~ C(Location, Treatment('China'))" works as well.
Aug 6, 2018 at 8:28 comment added istewart @PiotrMigdal thanks for clarifying. I wish the original answer actually included code.
Jul 26, 2015 at 10:26 comment added Piotr Migdal To be explicit, the syntax is "y ~ C(Location, Treatment(reference='China'))" .
Mar 16, 2014 at 16:54 vote accept orome
Mar 16, 2014 at 16:53 history answered jseabold CC BY-SA 3.0