Hello,
I've been trying to print out (or export) a data set containing the IDs for
my matched pairs to read them into SAS/Mplus. I just realized that what
I've been doing is not working correctly.
I've been using the syntax example in the manual given for seeing the
outcomes for matched pairs to try to print out the IDs for my matched
pairs.
cbind (dataset [row.names (m.matchset$match.matrix), "I_ID"], dataset
[m.matchset$match.matrix, "I_ID])
This doesn't seem to be giving me what I want. How can I get IDs and a
unique pair number for my matched pairs so that I can do conditional
logistic regression?
Thank you,
Sharon Simonton
Hi
Thanks a lot for the MatchIt package, very useful! I encountered two small
issues while using it (code to reproduce at the end of e-mail), maybe these
could be made more clear in the code?
1 handling NAs
As already reported (long time ago, see:
https://lists.gking.harvard.edu/pipermail/matchit/2006-April/000364.html )
matchit requires all the columns in the data to have no NAs, even if these
columns are not used in the match/estimation. Is this really necessary?
Maybe could be made more tolerant by checking for NAs only in the variable
used?
Maybe the line:
if (sum(is.na(data)) > 0)
could be changed into something like:
if(any(is.na(model.matrix(formula, data=data))))
2 Formula
General functions in R accept "character formula", such as:
lm("y~price.index", data=freeny)
However, matchit doesn't:
matchit("y~price.index", data=freeny)
maybe this could be checked, and either corrected, or warned (the error
message "$ operator is invalid for atomic vectors" is not very helpful to
find out the problem..)?
Like:
if(!is.formula(formula)) formula <- as.formula(formula)
or:
if(!is.formula(formula)) stop("Argument formula should be of class
'formula' ")
Illustrative code:
library(MatchIt)
data(lalonde)
m.out_exact <- matchit(treat ~ educ + black + hispan, data = lalonde,method
= "exact")
lalonde2 <- lalonde
lalonde2[1,"married"] <- NA
m.out_exact <- matchit(formula=treat ~ educ + black + hispan, data =
lalonde2, method = "exact")
## Formula issue?
form <- "treat ~ educ + black + hispan"
glm(form, data=lalonde)
m.out_exact <- matchit(form, data = lalonde,method = "exact")
Hi All,
I've matched using a pattern mixture model approach to address missing data
for several of the covariates used in my propensity score model. I now have
four separate MatchIt output files of matched pairs for separate patterns
for missing data. I'd like to concatenate them so that I can look at the
balance statistics/diagnostics for the full pooled set of matched pairs
that I've been using for analyses (have balance statistics for each
individual data set). Is there a straightforward way to do this?
Alternatively, I actually already have a pooled data set with all of the
pairs and associated measures. Is there a way to import this into MatchIt
to get the balance statistics? Thank you for your help. MatchIt is terrific!
Best wishes,
Sharon Simonton
University of Michigan
Hello:
I am running a model with propensity score matching. My data had a great
deal of missingness - including missingness on the matching variable - so I
used multiple imputation prior to matching. To avoid having duplicate
cases matched (as result of having 10 imputations per observation), I ran a
logistic regression (external to matchIt) predicting membership, and
averaged the resultant fitted values for a final propensity score. I would
now like to use this score as the propensity score in MatchIt. The problem
is that I don't really have a formula. Is there a way to read this
external propensity into MatchIt and match on that variable?
Thanks,
Andrea
--
Andrea Lamont, MA
Clinical-Community Psychology
University of South Carolina
Barnwell College
Columbia, SC 29208
Please consider the environment before printing this email.
CONFIDENTIAL: This transmission is intended for the use of the
individual(s) or entity to which it is addressed, and may contain
information that is privileged, confidential, and exempt from disclosure
under applicable law. Should the reader of this message not be the intended
recipient(s), you are hereby notified that any dissemination, distribution,
or copying of this communication is strictly prohibited. If you are not
the intended recipient, please contact the sender by reply email and
destroy/delete all copies of the original message.