Specifying which category to treat as the base with 'statsmodels'

后端 未结 2 2326
鱼传尺愫
鱼传尺愫 2021-02-20 04:05

In understand that when I have a category variable in a model passed to a statsmodels fit that dummy variables will automatically be generated for the

2条回答
  •  既然无缘
    2021-02-20 04:51

    You can pass a reference arg to the Treatment contrast, using syntax like

    "y ~ C(Location, Treatment(reference='China'))"

    http://patsy.readthedocs.org/en/latest/API-reference.html#patsy.Treatment

    If you have a better suggestion for naming conventions please file an issue with patsy.

提交回复
热议问题