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

informative error on impossible matches #226

Open
josherrickson opened this issue Jan 6, 2023 · 0 comments
Open

informative error on impossible matches #226

josherrickson opened this issue Jan 6, 2023 · 0 comments

Comments

@josherrickson
Copy link
Collaborator

In the past, if a user tried to pass something impossible (e.g. pairmatch(pr ~ cost, controls = 100, data = nuclearplants)), they'd get the following:

## Error in pairmatch.matrix(m, controls = controls, data = mfd,
##   remove.unmatchables = remove.unmatchables, : not enough
##   controls in some subclasses

(Taken from some old slides that I'm in the process of updating.)

Now, the same code produces:

## Error in fullmatch.matrix(x = x, min.controls = controls, 
##    max.controls = controls, : negative 'omit.fraction' with
##    'min.controls' >= 2 not permitted

The former was much more clear to end-users. I get they say the same thing, but a user using e.g. pairmatch may not have any idea what omit.fraction or min.controls are.

I haven't looked into whether we've change the actual error, or (more likely) the order of operations has changed such that this second error gets hit earlier. Either way, I think we should try and catch this issue and error more informatively. Something like "The restrictions on the matched set sizes through controls/min.control/max.controls/omit.fraction are impossible to meet."

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

No branches or pull requests

1 participant