I've created a matched mulitply imputed dataset (created in Amelia) via cem, using the option "datalist." Now that I've done so, I'm trying to figure out how to apply the match.data() command in MatchIt, so that I may analyze the data in Zelig. MatchIt does not seem to want to process the output object from cem, and yet I can't find a command in cem similar to match.data(). What's the best way to proceed?
> matt4 <- cem(treatment="t4", drop=c("numcode", "group", "ccode", "country", "region", "rcode", "year"), datalist=datprep, data=data)
> class(matt4)
[1] "cem.match.list" "list"
> t4data <- match.data(matt4)
> class(t4data)
[1] "NULL"
> t4data
NULL
> modt4.1 <- zelig(prot ~ lgpop + gpro + poldis + gorg + repact + polity2 + secfil + toolfil + lgdp + lgdppc, model=ls, data=t4data)
Error in paste("zelig2", model, sep = "") :
cannot coerce type 'closure' to vector of type 'character'
====================================
Evann Smith
Ph.D. Candidate
Harvard University, Department of Government
egsmith(a)fas.harvard.edu
====================================
--
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)lists.gking.harvard.edu
Subscribe/Unsubscribe: http://lists.gking.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
Browse/Search List Archive: http://lists.hmdc.harvard.edu/lists/matchit/
Hello,
I am using nearest matching with ratio of 20 or 50 and a caliper. When I do
this I get the message that not every treated observation has the requested
number of matches. This is OK for my application, but the weights of the
controls are all 1.
I would like the weights to reflect the number of controls for each treated
observation, That is, control weight=1/K where K is the number of non-NAs in
the match.matrix in the row where the control obsID occurs. Otherwise the
weights do not properly reflect the balance achieved by matching.
Is there a simple way to compute this weight vector from the match matrix?
Thanks,
Chris
Hello,
I'm very new to R and to MatchIt, so I'm not really sure what I should be seeing...but when I run it using a Mahalanobis distance, all the distance values in the resulting output are "NA". This happens both with my "real" data and with the LALONDE data. Is this correct? (Note: I'm running the latest versions of R and MatchIt).
Thanks.
--Karen
--
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)lists.gking.harvard.edu
Subscribe/Unsubscribe: http://lists.gking.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
Browse/Search List Archive: http://lists.hmdc.harvard.edu/lists/matchit/
Hi,
I posted the following on the R discussion group, but this might be
relevant
here as well.
I am trying to estimate the average treatmen effect on the
treated (ATT) using first the MatchIt software to weight the data set and,
after this, the Zelig software as shown in Ho et al. (2007). This is my
source:
http://imai.princeton.edu/research/files/matchit.pdf
I encounter a slight problem when I apply the weights that are produced in
the stage of preprocessing the data. The idea of this is to use the MatchIt
software to preprocess the data and then use the Zelig software to generate
the distribution of ATT. I believe that the main reason for preprocessing
the data is to create weights (depending on the matching technique you use)
so that balance would be achieved for the matching variables between the
treatment and the control group. Then you use these weights in the
regressions that follow in the Zelig library. Copied from the matchit
article, whose link I provide above, the authors say:
"If one chooses options that allow matching with
replacement, or any solution that has different numbers of controls (or
treateds) within each
subclass or strata (such as full matching), then the parametric analysis
following matching
must accomodate these procedures, such as by using fixed effects or weights,
as appropriate.
(Similar procedures can also be used to estimate various other quantities of
interest such
as the average treatment effect by computing it for all observations, but
then one must
be aware that the quantity of interest may change during the matching
procedure as some
control units may be dropped.)"
The following code is for the "lalonde" data set, where I get an error
message in the end. I use the more recent R version (2.12.1) and have
updated
the Zelig and MatchIt libraries.
> update.packages("MatchIt")
> update.packages("Zelig")
> library(Zelig)
> library(MatchIt)
> data(lalonde)
> m.out1 = matchit(treat ~ age + educ + black + hispan + nodegree + married
+
re74 + re75, method = "subclass", subclass=6, data = lalonde)
> z.out1 = zelig(re78 ~ age + educ + black + hispan + nodegree + married +
re74
+ re75, data = match.data(m.out1, "control"), model = "ls",
weights="weights")
> x.out1 = setx(z.out1, data = match.data(m.out1, "treat"), cond = TRUE)
> s.out1 = sim(z.out1, x = x.out1)
Error in model.frame.default(formula = re78 ~ age + educ + black + hispan +
:
variable lengths differ (found for '(weights)')
I was wondering if somebody could tell me how to get around with this
problem?
Also, I have seen people adding the propensity scores in the regression
analysis applied in the Zelig package, i.e.
> z.out1 = zelig(re78 ~ age + educ + black + hispan + nodegree + married +
re74 + re75 + distance, data = match.data(m.out1, "control"), model =
"ls", weights="weights")
Does anyone have a clue of why this can happen?
Kind regards,
Sotiris