My question is similar to Rose's. I have a 5 group treatment
(educational level). To start, I wanted to try matching with CEM on
just one factor where there is definitely overlap (age). I pasted the
age-education level cross-tabulation below. I read in the MatchIt
documentation that CEM can handle multi-category treatment (pasted
below). I updated both R and MatchIt just to be sure that I had the
most current versions: 2.14.2 in R and 2.4-20 in MatchIt.
I have tried educational level as both integers 0 to 4 and scaled to
the unit interval. The former makes R complain that it needs y scaled
to unit interval, and the latter crashes R. I've pasted the output
below.
Can CEM --- in either R or Stata --- to handle a multi-category
treatment variable? Alternatively, is there another method in MatchIt
that allows multiple categories?
Thanks,
Janet
Coarsened Exact Matching
Coarsened Exact Matching (CEM) is a Monotonoic Imbalance Bounding
(MIB) matching method -- which means that the balance between the
treated and control groups is chosen by the user ex ante rather than
discovered through the usual laborious process of checking after the
fact and repeatedly reestimating, and so that adjusting the imbalance
on one variable has no effect on the maximum imbalance of any other.
CEM also strictly bounds through ex ante user choice both the degree
of model dependence and the average treatment effect estimation error,
eliminates the need for a separate procedure to restrict data to
common empirical support, meets the congruence principle, is robust to
measurement error, works well with multiple imputation methods for
missing data, and is extremely fast computationally even with very
large data sets. CEM also works well for multicategory treatments,
determining blocks in experimental designs, and evaluating extreme
counterfactuals (, ).
table(educ_coll3, age3)
age3
educ_coll3 17 18 19 20 21 22 23 24 25 26 27 28
0 1 61 579 894 1063 1226 1200 974 345 50 11 1
0.25 0 32 276 282 229 207 167 105 24 4 1 0
0.5 0 40 514 576 632 426 230 118 35 3 1 0
0.75 0 0 9 72 165 191 205 166 33 5 3 0
1 0 0 1 9 49 346 517 466 91 0 0 0
m.out <- matchit(educ_coll3 ~ age3 , data = S2,
method = "cem")
Loading required package: cem
Loading required package: nlme
Loading required package: randomForest
randomForest 4.6-6
Type rfNews() to see new features/changes/bug fixes.
Loading required package: tcltk
Loading Tcl/Tk interface ...
*** caught segfault ***
address 0x6, cause 'memory not mapped'
Traceback:
1: sys.parent()
2: sys.function(sys.parent())
3: formals(sys.function(sys.parent()))
4: match.arg(encoding)
5: match(match.arg(encoding), c("", "bytes", "UTF-8"))
6: textConnection("rval", "w", local = TRUE)
7: capture.output(print(args(summary)))
8: paste(capture.output(print(args(summary))), collapse = "")
9: gsub("\\s+", " ", paste(capture.output(print(args(summary))),
collapse = ""))
10: doTryCatch(return(expr), name, parentenv, handler)
11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
12: tryCatchList(expr, classes, parentenv, handlers)
13: tryCatch(expr, error = function(e) { call <- conditionCall(e)
if (!is.null(call)) { if (identical(call[[1L]],
quote(doTryCatch))) call <- sys.call(-4L) dcall <-
deparse(call)[1L] prefix <- paste("Error in", dcall, ": ")
LONG <- 75L msg <- conditionMessage(e) sm <-
strsplit(msg, "\n")[[1L]] w <- 14L + nchar(dcall, type =
"w") +
nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L +
nchar(dcall, type = "b") + nchar(sm[1L], type = "b")
if (w > LONG) prefix <- paste(prefix, "\n ", sep =
"") } else prefix <- "Error : " msg <- paste(prefix,
conditionMessage(e), "\n", sep = "")
.Internal(seterrmessage(msg[1L])) if (!silent &&
identical(getOption("show.error.messages"), TRUE)) {
cat(msg, file = stderr()) .Internal(printDeferredWarnings())
} invisible(structure(msg, class = "try-error", condition = e))})
14: try(gsub("\\s+", " ", paste(capture.output(print(args(summary))),
collapse = "")), silent = TRUE)
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Janet Rosenbaum, Ph.D.
Assistant Research Professor, Maryland Population Research Center
University of Maryland, College Park
janet(a)post.harvard.edu
On Fri, Mar 9, 2012 at 12:24 PM, Rose Anne Medeiros <ram12(a)rice.edu> wrote:
Hello all,
I am attempting to implement the coarsened exact matching technique
described in Iacus, King, and Porro (2011). The "treatment" in this
case has three categories. It is clear from section 5.1 of the paper
that this is not a problem for the technique generally. The question I
have is how to calculate the weights, or whether the weights are
strictly necessary. If anyone can you point me in the direction of
resources that might illuminate this issue I would be grateful.
Best,
Rose
--
Rose Anne Medeiros, Ph.D.
Quantitative Methodologist
Department of Sociology
Rice University
(713)348-4397
-
--
cem Mailing List, served by HUIT
Send messages: cem(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/?info=cem
More information on cem:
http://gking.harvard.edu/cem
Cem mailing list
Cem(a)lists.gking.harvard.edu
https://lists.gking.harvard.edu/mailman/listinfo/cem