Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201894

Coarsened Exact Matching with MatchIt returns error

$
0
0

When I try to implement Coarsened Exact Matching with the MatchIt package I get the following error:

Error in `[[<-.data.frame`(`*tmp*`, gn[g], value = integer(0)) : replacement has 0 rows, data has 6

Here is a reproducible example:

require(MatchIt)
require(cem)

d <- data.frame(
  id = 1:6 , 
  treat = rep(c(1,0),each = 3),
  group = c("A","B","C" , "B" , "B" , "B"))

matchit(formula = treat ~ class , 
        data = d , 
        grouping = list(group = list(c("A" , "B"))),
        method = "cem")

I am running version 1.1.19 of cem and 3.0.2 of MatchIt.

Thank you for your help.


Viewing all articles
Browse latest Browse all 201894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>