You can use your own distance measure by creating a variable in the dataset with that
distance measure (e.g. a propensity score estimated in some other way) and then sending
that to matchit using the distance option, like this:
http://r.iq.harvard.edu/docs/matchit/2.4-20/How_Do_I3.html
It will look something like
m.out <- matchit(treat ~ x1 + x2, data=dataset, distance=dataset$myownmeasure)
The treat ~ x1 + x2 formula is then used just to tell matchit what the treatment variable
is and what the covariates to check balance on are.
Thanks,
Liz
On Feb 10, 2017, at 2:42 AM, 周宛誼
<mayritaspring@gmail.com<mailto:mayritaspring@gmail.com>> wrote:
Dear all,
If I want to use different distance option which is not in the package, how do I combine
with the package?
Because I want to use linear regression, or lm(), to calculate propensity scores and do
matching.
Should I need to create a similar function like the following and use matchit function and
that function together, or maybe other solutions?
distance2logit <- function(formula, data, ...) {
res <- glm(formula, data, family=binomial(logit), ...)
return(list(model = res, distance = fitted(res)))
}
Thank you so much
[
http://www.debutworkshop.org/wp-content/uploads/2015/08/nctu_logo.png]
Wan-Yi Chou (May Chou), Master
Management Science, National Chiao Tung University
國立交通大學管理科學研究所
周宛誼|Email mayritaspring@gmail.com<mailto:mayritaspring@gmail.com>
-
---
MatchIt mailing list served by HUIT
List Address:
matchit@lists.gking.harvard.edu<mailto:matchit@lists.gking.harvard.edu>
Subscribe/Unsubscribe:
http://lists.gking.harvard.edu/mailman/listinfo/ei
MatchIt Software and Documentation:
http://gking.harvard.edu/matchit/
Browse/Search List Archive:
http://lists.gking.harvard.edu/mailman/private/matchit/
Matchit mailing list
Matchit@lists.gking.harvard.edu<mailto:Matchit@lists.gking.harvard.edu>
To unsubscribe from this list or get other information:
https://lists.gking.harvard.edu/mailman/listinfo/matchit