Skip to content

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

@BorgeJorge

Description

@BorgeJorge

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions