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

This caliper-related error occurs sometimes, not always #5

Open
BorgeJorge opened this issue Oct 24, 2023 · 0 comments
Open

This caliper-related error occurs sometimes, not always #5

BorgeJorge opened this issue Oct 24, 2023 · 0 comments

Comments

@BorgeJorge
Copy link

BorgeJorge commented Oct 24, 2023

The error below occurs about 30% of the time I submit the following code using my current dataset. ("distance" obviously is calculated by matchit.) Perhaps it's related to the random component in lasso? Or am I combining options I shouldn't? Thanks.

m.maha <- matchit(
f.build('enrolled',all_vars),
data = chw,
method = "nearest",
exact = "medicare",
ratio = 4,
reuse.max = 2,
min.controls=2,
max.controls=7,
replace = TRUE,
distance = "lasso",
estimand = "ATT",
discard = "both",
mahvars = all_vars,
reestimate = TRUE,
caliper = .2,
std.caliper = TRUE)

Error in matchit():
! Calipers cannot be used with binary, factor, or character variables. Offending variables:
<distance>

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

1 participant