Add support for interaction i transform (ala fixest::i())#265
Add support for interaction i transform (ala fixest::i())#265matthewwardrop wants to merge 3 commits intomainfrom
i transform (ala fixest::i())#265Conversation
|
Hi @matthewwardrop ! Thanks very much for this. I've played around with the PR a bit and it looks overall pretty close to what we're hoping for. Two comments:
Specifying Second, is my understanding correct that the binning functionality doesn't cover dropping of reference levels yet? For example, is it possible to replicate syntax of the form PS: I think the current branch was missing a |
This patch implements initial support for the
i()operator, motivated bypyfixestuse-cases. There are still some rough edges (and encoder state is not actually preserved), but this implementation should work in most cases. See attached Jupyter notebook for usage demos.Note that this is not a 1:1 drop in for the fixest estimator, in particular:
i(a,b,c,d,...))i(A, B)might output columns with names like:A[a]:B[g].i(...)operator can result in linear dependence.iitself. For example:i(bin(A, ab=['a', 'b']))andi(C(A, levels=['a', 'b'])).reffunctionality is, for the time being, implemented by areduce_rankargument passed toC(), as above for levels. I'm not sure I like that.i_operator.ipynb
closes: #244
closes: #263