-
Notifications
You must be signed in to change notification settings - Fork 13
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
Interactions in control variables (Z) #9
Comments
What about create a new variable?
…On Thu, Jun 10, 2021, 03:43 MartinHaus1 ***@***.***> wrote:
Hi there,
first of all, thank you very much for this amazing package!!
I was wondering whether there is a way to use interactions as control
variables Z, i.e., something like A*B.
example:
interflex(estimator="kernel", Y="outcome", D="treatment", X="moderator",
Z=c("A*B", "other_control"), FE=c("year", "state"),data=dataset)
This currently leads to
A*B is not in the data
Is there any way to do this at the moment?
Thank you!
Best,
Martin
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2PKGGZ4MSQXNJNEH257L3TSCJMXANCNFSM46OFTO4Q>
.
|
Thank you for your response! Yes, this is a feasible work-around. I was just wondering whether I just missed how to feed interaction terms into interflex, in case there is a direct way. Thanks! |
Just a quick follow-up: I tried to create a new variable (as a factor) and included it in the Z-vector to control for it. It throws the following error:
If I remove the new categorical variable from the control vector, it works. Using the same variable for creating a model with plm does not lead to any issues. Am I doing something wrong? For context, I use the following command options:
Thank you! |
Yes, interflex does not work well with factorial controls.
Ziyi, do you have any ideas?
Best,
Yiqing
…On Thu, Jun 10, 2021 at 9:48 AM MartinHaus1 ***@***.***> wrote:
Just a quick follow-up:
I tried to create a new variable (as a factor) and included it in the
Z-vector to control for it.
It throws the following error:
Cross-validating bandwidth ...
Parallel computing with 8 cores...
Optimal bw=0.0609.
Error in names(result) <- c("x0", "(Intercept)", use.variable[2:length(use.variable)]) :
'names' attribute [119] must be the same length as the vector [118]
If I remove the new categorical variable from the control vector, it
works. Using the same variable for creating a model with *plm* does not
lead to any issues.
Am I doing something wrong? For context, I use the following command
options:
interflex(estimator="kernel", Y="y", D="d", X="x", Z=c("new_control_factor","other_controls"),
IV="iv", FE=c("year", "state"),data=dataset, cores=8, na.rm = T, vcov.type="cluster", cl="state")
Thank you!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2PKGEI5ZX4MO35BMXY23DTSDUFFANCNFSM46OFTO4Q>
.
--
Yiqing Xu
Assistant Professor
Department of Political Science
University of California, San Diego
http://yiqingxu.org/
|
Can you send a sample dataset to [email protected] for debugging as this code works well on my sample dataset? Thanks a lot! |
Hi, thanks both for your responses. I mailed a sample dataset that should reproduce the error. Best, |
Hi there,
first of all, thank you very much for this amazing package!!
I was wondering whether there is a way to use interactions as control variables Z, i.e., something like A*B.
example:
interflex(estimator="kernel", Y="outcome", D="treatment", X="moderator", Z=c("A*B", "other_control"), FE=c("year", "state"),data=dataset)
This currently leads to
A*B is not in the data
Is there any way to do this at the moment?
Thank you!
Best,
Martin
The text was updated successfully, but these errors were encountered: