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

Error: 'exact' must be supplied as a character vector of names or a one-sided formula #20

Open
solis9753 opened this issue Oct 8, 2021 · 4 comments

Comments

@solis9753
Copy link
Collaborator

Hi,

I am trying to run the package in 'Validation' mode. Find here the whole debug file.

021-10-08 12:40:28 Matching control group 1/49 for event pairs starting with 201826 (total progress 2%, ETA: Inf h NaN m NaN s)...
2021-10-08 12:59:32 Caught an error in matchit() but catched it in try-catch: Error in if ((nc * nr > getMaxProblemSize()) && warning.requested) {: missing value where TRUE/FALSE needed

2021-10-08 12:59:32 Therefore, trying nearest neighbor matching instead of optimal...
2021-10-08 12:59:32 Error: 'exact' must be supplied as a character vector of names or a one-sided formula.

@SulevR
Copy link
Collaborator

SulevR commented Oct 8, 2021

Hi,

there are actually two problems:

  1. First, the error comes from optmatch package. I'm not sure why this happens (I cannot replicate it by myself) but it may be linked to Integer overflow in checking problem size markmfredrickson/optmatch#209 which was fixed in recent version 09-16. However, I am using version 09-15 without these errors - probably they have introduced a new problem instead? What version of the optmatch package you are using?

  2. The "exact" problem is now fixed.

The code works so that it first tries an optmatch method but if this leads to an error, it is catched and "nearest neighbor" matching is used which is less memory extensive. The try-catch was buggy, but is now fixed. However, the first error, which is catched, needs further examination - please let me know which version of the optmatch package you are using.

@solis9753
Copy link
Collaborator Author

Optmatch's version is also 0.9.15.

@SulevR
Copy link
Collaborator

SulevR commented Oct 8, 2021

@solis9753 Please update optmatch to the latest GitHub version:

devtools::install_github('markmfredrickson/optmatch')

Then pull the updates of the Trajectories package from GitHub, build it, and try out whether the problem disappears.

I've made the Trajectories package more robust when handling errors from MatchIt package. However, MatchIt depends on optmatch package which is the source of this error. I hope that their late fix (not yet released in the official release >09-15) solves the root cause (see related issue: markmfredrickson/optmatch#213).

@smusali
Copy link
Contributor

smusali commented Feb 17, 2023

@SulevR @raivokolde @solis9753 has this issue been resolved? If so, can we close this?

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

3 participants