Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to include interaction term with categorical variables in X? #48

Open
ShunyuanZ opened this issue Oct 14, 2020 · 2 comments

Comments

@ShunyuanZ
Copy link

I have two categorial variables M1, M2, I wanted to add M1 * M2 as a control variable. Yet, it does not seem to work with categorical variable interactions. Creating many dummy variables might be my last option...
Any thoughts? Thanks!

@xuyiqing
Copy link
Owner

xuyiqing commented Oct 14, 2020 via email

@ShunyuanZ
Copy link
Author

Yes, you probably need to create those dummies. Note that including lots of controls will inevitably make the algorithm run more slowly.

On Wed, Oct 14, 2020 at 8:28 AM ShunyuanZ @.***> wrote: I have two categorial variables M1, M2, I wanted to add M1 * M2 as a control variable. Yet, it does not seem to work with categorical variable interactions. Creating many dummy variables might be my last option... Any thoughts? Thanks! — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#48>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2PKGCMD24QQJFVBO3C25DSKW7SLANCNFSM4SQYN2DQ .
-- Yiqing Xu Assistant Professor Department of Political Science Stanford University http://yiqingxu.org/

Thanks! Will try. I tested it with M1*M2 but then got a error
"In chol.default(mat, pivot = TRUE, tol = tol) :
the matrix is either rank-deficient or indefinite"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants