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

Tidy-friendly wrapper for synthdid_estimate #90

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bberger94
Copy link

Added synthdid() function, a wrapper for synthdid_estimate() that allows direct use of tidy syntax including formulas and data.frames/tibbles, eschewing the need to use panel.matrices(). See documentation for examples. Also allows for estimating models of multiple outcomes with one command.

Ben Berger added 2 commits May 2, 2022 16:54
…ows direct use of formulas and data frames.
…t to results from directly calling synthdid_estimate().
@bberger94
Copy link
Author

Failing check is a warning that synthdid function has same name as synthdid package. Trivial to fix.

@MatthieuStigler
Copy link

this looks great @bberger94, would love to see this function, the matrix approach was a bit less intuitive, and this wrapper is a bit more in line with R's formula-based practice :-)

@davidahirshberg did you get a chance to review it and accept/reject?

@bberger94
Copy link
Author

Thanks Matthieu. I have used this in my own work and it seems to work nicely, but I would definitely double-check how my code works with covariates as I was noticing some issues with that when I last played with that. Until then I wouldn't use the formula syntax with covariates.

@davidahirshberg
Copy link
Collaborator

davidahirshberg commented Sep 13, 2022 via email

@bberger94
Copy link
Author

Sure I'll check it out @davidahirshberg

@bberger94
Copy link
Author

Looks like controls are working just fine. I was surprised how little they affect the results, but the estimates appear to be the same using the new synthdid function or synthdid_estimate with an NxTxC array of controls.

I also added a method argument that allows you to choose which estimator is implemented by synthdid (argument should be a function name, default is synthdid_estimate).

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

Successfully merging this pull request may close these issues.

3 participants