Thank you for prompt responses! So, I followed your advice and got matched data by using
the following command: matchit(formula, data, distance = ps.tp) where ps.tp is a vector
subtracted from a data-frame object - I guess the same form as in your case. However, I
got the following warning message:
Warning message:
In if (distance %in% c("GAMlogit", "GAMprobit",
"GAMcloglog", "GAMlog", :
the condition has length > 1 and only the first element will be used
Not quite sure what the message exactly means in this context - any ideas?
Many thanks!
Ana
>>________________________________
From:"Stuart, Elizabeth A." <estuart(a)jhsph.edu>
To: Ana Kolar <annakolar(a)yahoo.com>om>; Kosuke Imai <kimai(a)Princeton.Edu>
Cc: MatchIt <matchit(a)lists.gking.harvard.edu>
Sent: Tuesday, 18 September 2012, 16:32
Subject: Re: [matchit] Matching with true propensity score
Re: [matchit] Matching with true propensity score
Hi Ana,
I have sent MatchIt my own propensity score using code like:
m.out.gbm.att <- matchit(treat ~ age + educ + black + hispan + married + re74 + re75,
data=lalonde, distance=lalonde$pscore)
(Where in this case “pscore” in the lalonde dataset is the propensity score values I had
estimated myself). Note that it is the distance option, not the distance.options
option...
And yes, you have to specify the formula still, so matchit know what variables on which to
calculate balance, but it doesn’t actually estimate the propensity score using that
formula; it uses the propensity scores you send it in the distance option.
One minor note is that in your email below you mention a “distance matrix” but really
matchit will just take a distance vector (one propensity score for each person). If you
have a distance matrix you may want to look at using some of Ben Hansen’s optmatch
functions, which take a distance matrix.
Liz
On 9/18/12 10:11 AM, "Ana Kolar" <annakolar(a)yahoo.com> wrote:
Hi Kosuke,
>
>If I understand this correctly, by using my own distance matrix (ps.true) the function
should look something like that:
>m.out.base <- matchit(formula, data, method, distance.options = list(ps.true))
>
>So, I have to specify the formula for estimating PS although I'm using then the
true PS for matching which I specify in the distance.options=list(ps.true)? Does this mean
that when I specify distance.option argument, the program doesn't estimate PS
although the formula for it has to be provided?
>
>The thing is that I've tried two ways:
>(i) distance.options=ps.true (where ps.true object is already a list
>(ii) distance.options=list(ps.true) (where ps.true object is a vector)
>
>In none of these trials things worked out so I'm wondering where I might get it
wrong. Your help will be greatly appreciated!
>
>Best wishes,
>
>Ana
>
>
>
>
>>
>>
>>
>>>>
>>________________________________
>> From:Kosuke Imai
<kimai(a)princeton.edu>
>> To: Ana Kolar <annakolar(a)yahoo.com>
>>Cc: "matchit(a)lists.gking.harvard.edu"
<matchit(a)lists.gking.harvard.edu>
>> Sent: Monday, 17 September 2012, 2:19
>> Subject: Re: [matchit] Matching with true propensity score
>>
>>
>>Hi Ana,
>>
>> You can use your own distance matrix (including the true propensity score in a
simulation study) in MatchIt:
http://gking.harvard.edu/node/4355/rbuild_documentation/How_Do_I3.html
>>
>>Best,
>>Kosuke
>>
>>Department of Politics
>>Princeton University
>>http://imai.princeton.edu <http://imai.princeton.edu/>
<http://imai.princeton.edu/>
>>
>>On Sep 16, 2012, at 3:51 PM, Ana Kolar wrote:
>>
>>> Hi there,
>>>
>>> I'm wondering if Matchit package allows to match on the true propensity
score - meaning that instead of estimating PS (what matchit function does) I would be able
to provide a vector of true propensity scores which would be then used in the process of
matching. The second thing that I'm interested in is, whether it is possible to do
Mahalanobis distance matching and not only propensity score matching. I did check your
documentation (perhaps not carefully enough) but couldn't find my answers there.
>>>
>>> I'm looking forward to hearing from you soon!
>>>
>>> Ana
>>> -
>>> ---
>>> MatchIt mailing list served by HUIT
>>> List Address: matchit(a)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(a)lists.gking.harvard.edu
>>>
https://lists.gking.harvard.edu/mailman/listinfo/matchit
>>
>>
>>
>>
>>
>>
>>
>
>