StatsModels.jl icon indicating copy to clipboard operation
StatsModels.jl copied to clipboard

Let DummyCoding() specify a subset (or superset!) of levels

Open droodman opened this issue 1 year ago • 0 comments

Stata lets you economically state models with a subset of possible dummies for a given categorical variable:

regress y i(1 3).x

That regresses y on two dummies, one for x==1, one for x==3. It would be nice for the levels option of DummyCoding() to allow the same.

One can also do

regress y ibn.x, nocons

Which specifies a complete dummy set and no constant term. ("bn" means "base, none") DummyCoding() could accept base=:none to do the same.

droodman avatar Mar 25 '24 15:03 droodman