I have a categorical variable, let's say cat_var
which can assume the following values: cat_var = ["A", "B", "C", "D"]
I run a series of regressions and patsy
makes it easy to describe a regression: regr= " y ~ x + C(cat_var)
I was wondering what the easiest way to tune the use of categorical variable is .
For example, let's say I would like to have patsy
create dummies only for "A"
, "B"
, ie "C"
and "D"
are treated as one single group. I could remap cat_var
to another set of value, but is there some sugar in patsy
to do this task already?