It's possible that the way you did below works. I would check the pscore
and compare it with the one you obtain by manually typing those commands.
You can use match.data() to extract the pscore from the matchit output.
Kosuke
P.S. Please note that we made a number of changes and improvements to the
software in the past couple of months.
-----------------------------------------------------
Kosuke Imai Office: Corwin Hall 041
Assistant Professor Phone: 609-258-6601
Department of Politics eFax: 973-556-1929
Princeton University Email: kimai(a)Princeton.Edu
Princeton, NJ 08544-1012 http://imai.princeton.edu
-----------------------------------------------------
On Wed, 19 Oct 2005, Setoguchi, Soko,M.D. wrote:
> Kosuke,
>
> Thank you for your prompt response.
> >because the propensity score
> >model should be specified based on the resulting balance of covariates
> >rather than its predictive performance.
> That is exactly the point that I am testing using stepwise regression.
> I actually tried to use the function 'step' within MatchIt.
> It ran but I was not sure if I am getting exacly what I wanted.
>
> For example, I did
> > psmatch<- matchit(step(glm(a~w1+w2+w3+w4+w5,family=binomial,data=W),
> >direction='backward'),data=W)
>
> It looks that it is running stepwise regression then matching on the propensity
> score.
> Do you have any idea?
>
> Soko
>
>
>
> ________________________________
>
> From: Kosuke Imai [mailto:kimai@Princeton.Edu]
> Sent: Tue 10/18/2005 10:04 PM
> To: Setoguchi, Soko,M.D.
> Cc: matchit(a)latte.harvard.edu
> Subject: Re: question on propensity score matching using MatchIt
>
>
>
> Dear Soko,
> The stepwise regression can be done in R using stepwise() function.
> However, we did not include this in MatchIt because the propensity score
> model should be specified based on the resulting balance of covariates
> rather than its predictive performance.
> Hope this helps,
> Kosuke
>
> -----------------------------------------------------
> Kosuke Imai Office: Corwin Hall 041
> Assistant Professor Phone: 609-258-6601
> Department of Politics eFax: 973-556-1929
> Princeton University Email: kimai(a)Princeton.Edu
> Princeton, NJ 08544-1012 http://imai.princeton.edu
> -----------------------------------------------------
>
> On Tue, 18 Oct 2005, Setoguchi, Soko,M.D. wrote:
>
> > Hi Kosuke,
> >
> > I am on MatchIt maling list but cannot send an email to the list, so sending
> an
> > email to you to ask a question.
> >
> > Does MatchIt offer an option to use stepwise logistic regression for
> propensity
> > score matching?
> >
> > Soko
> >
> > Soko Setoguchi, MD DrPH
> > Division of Pharmacoepidemiology, Dept of Medicine
> > Brigham and Women's Hospital and Harvard Medical School
> >
> >
> >
> > -----Original Message-----
> > From: owner-matchit(a)latte.harvard.edu [mailto:owner-matchit@latte.harvard.edu]
> > On Behalf Of Kosuke Imai
> > Sent: Wednesday, August 10, 2005 3:23 PM
> > To: Bart Bonikowski
> > Cc: matchit(a)latte.harvard.edu
> > Subject: RE: [matchit] MatchIt error message
> >
> > Hi Bart,
> > The error you pointed out occurred when R's new version was released.
> > Anyways, we have fixed this bug and released a new version, 1.0-2. It
> > should be available from CRAN within a few days, but if you want to try it
> > out sooner, you can install it by
> >
> > install.packages("MatchIt", CRAN="http://gking.harvard.edu")
> >
> > Note that you need the most recent version of R 2.1.1 to use this version.
> > Thanks again for pointing out this bug.
> >
> > Kosuke
> >
> > -----------------------------------------------------
> > Kosuke Imai Office: Corwin Hall 041
> > Assistant Professor Phone: 609-258-6601
> > Department of Politics eFax: 973-556-1929
> > Princeton University Email: kimai(a)Princeton.Edu
> > Princeton, NJ 08544-1012 http://imai.princeton.edu
> > -----------------------------------------------------
> >
> > On Tue, 9 Aug 2005, Bart Bonikowski wrote:
> >
> > > Dear Kosuke,
> > >
> > > Sure. I've tried both my own analysis (1) and the one outlined in the
> > > MatchIt tutorial (2).
> > >
> > > 1) match.out <- matchit(int01x ~ int00 + loginc00 + male + black + amind +
> > > asian + hispa + age01 + age01p2 + educ.hs + educ.col + educ.ass + educ.adv +
> > > reg.mw + reg.s + reg.w + metro.y + metro.ni + occ.fff + occ.svc + occ.mpts,
> > > data=test, subclass=c(0,.5,1))
> > > 2) match.out1 <- matchit(treat ~ age + married + black + hispan + nodegree +
> > > educ + re74 + re75, data=lalonde, subclass=c(0, .5, 1))
> > >
> > > I'm running R 2.1.1 on Windows XP.
> > >
> > > Thank you for your help!
> > >
> > > Bart
> > >
> > > --
> > > Bart Bonikowski
> > > Graduate Student
> > > Department of Sociology
> > > Princeton University
> > > Princeton, NJ 08544
> > > T: (215) 325-1816
> > > F: (609) 258-2180
> > >
> > > -----Original Message-----
> > > From: Kosuke Imai [mailto:kimai@Princeton.EDU]
> > > Sent: Tuesday, August 09, 2005 2:13 PM
> > > To: Bart Bonikowski
> > > Cc: matchit(a)latte.harvard.edu
> > > Subject: Re: [matchit] MatchIt error message
> > >
> > > Dear Bart,
> > > Could you give us a sample code that produces this error?
> > > Thanks,
> > > Kosuke
> > >
> > > -----------------------------------------------------
> > > Kosuke Imai Office: Corwin Hall 041
> > > Assistant Professor Phone: 609-258-6601
> > > Department of Politics eFax: 973-556-1929
> > > Princeton University Email: kimai(a)Princeton.Edu
> > > Princeton, NJ 08544-1012 http://imai.princeton.edu
> > > -----------------------------------------------------
> > >
> > > On Tue, 9 Aug 2005, Bart Bonikowski wrote:
> > >
> > > > Hello,
> > > >
> > > > I have a quick question about an error message generated by MatchIt
> > > > (this question was already asked by a user in Feb 2005, but I couldn't
> > > > find an answer in the archives). I'm trying to run a propensity score
> > > > model with two subclasses. I tried this with my own data, as well as
> > > > with the Lalonde dataset used in the MatchIt tutorial. For some
> > > > reason, the software returns the following error:
> > > >
> > > > Calculating propensity score...Done
> > > > Matching Treated:
> > > > 10%...20%...30%...40%...50%...60%...70%...80%...90%...100%...Done
> > > > Calculating summary statistics...Done
> > > > Warning message:
> > > > the condition has length > 1 and only the first element will be used
> > > > in: if
> > > > (subclass) {
> > > >
> > > > When I try to run a summary report on the results, I receive this message:
> > > >
> > > > Error in rep.default(data, length.out = vl) :
> > > > invalid number of copies in rep() In addition: Warning
> > > > messages:
> > > > 1: no finite arguments to max; returning -Inf
> > > > 2: NAs introduced by coercion
> > > >
> > > > Your help would be much appreciated.
> > > >
> > > > My best regards,
> > > >
> > > > Bart Bonikowski
> > > >
> > > >
> > > > --
> > > > Bart Bonikowski
> > > > Graduate Student
> > > > Department of Sociology
> > > > Princeton University
> > > > Princeton, NJ 08544
> > > > T: (215) 325-1816
> > > > F: (609) 258-2180
> > > >
> > > >
> > > > -
> > > > MatchIt mailing list served by Harvard-MIT Data Center List Address:
> > > > matchit(a)latte.harvard.edu
> > > > Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
> > > > MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
> > > >
> > >
> > >
> > >
> > > -
> > > MatchIt mailing list served by Harvard-MIT Data Center
> > > List Address: matchit(a)latte.harvard.edu
> > > Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
> > > MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
> > >
> >
> >
> > -
> > MatchIt mailing list served by Harvard-MIT Data Center
> > List Address: matchit(a)latte.harvard.edu
> > Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
> > MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
> >
>
>
>
>
>
-
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)latte.harvard.edu
Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
Dear Soko,
The stepwise regression can be done in R using stepwise() function.
However, we did not include this in MatchIt because the propensity score
model should be specified based on the resulting balance of covariates
rather than its predictive performance.
Hope this helps,
Kosuke
-----------------------------------------------------
Kosuke Imai Office: Corwin Hall 041
Assistant Professor Phone: 609-258-6601
Department of Politics eFax: 973-556-1929
Princeton University Email: kimai(a)Princeton.Edu
Princeton, NJ 08544-1012 http://imai.princeton.edu
-----------------------------------------------------
On Tue, 18 Oct 2005, Setoguchi, Soko,M.D. wrote:
> Hi Kosuke,
>
> I am on MatchIt maling list but cannot send an email to the list, so sending an
> email to you to ask a question.
>
> Does MatchIt offer an option to use stepwise logistic regression for propensity
> score matching?
>
> Soko
>
> Soko Setoguchi, MD DrPH
> Division of Pharmacoepidemiology, Dept of Medicine
> Brigham and Women's Hospital and Harvard Medical School
>
>
>
> -----Original Message-----
> From: owner-matchit(a)latte.harvard.edu [mailto:owner-matchit@latte.harvard.edu]
> On Behalf Of Kosuke Imai
> Sent: Wednesday, August 10, 2005 3:23 PM
> To: Bart Bonikowski
> Cc: matchit(a)latte.harvard.edu
> Subject: RE: [matchit] MatchIt error message
>
> Hi Bart,
> The error you pointed out occurred when R's new version was released.
> Anyways, we have fixed this bug and released a new version, 1.0-2. It
> should be available from CRAN within a few days, but if you want to try it
> out sooner, you can install it by
>
> install.packages("MatchIt", CRAN="http://gking.harvard.edu")
>
> Note that you need the most recent version of R 2.1.1 to use this version.
> Thanks again for pointing out this bug.
>
> Kosuke
>
> -----------------------------------------------------
> Kosuke Imai Office: Corwin Hall 041
> Assistant Professor Phone: 609-258-6601
> Department of Politics eFax: 973-556-1929
> Princeton University Email: kimai(a)Princeton.Edu
> Princeton, NJ 08544-1012 http://imai.princeton.edu
> -----------------------------------------------------
>
> On Tue, 9 Aug 2005, Bart Bonikowski wrote:
>
> > Dear Kosuke,
> >
> > Sure. I've tried both my own analysis (1) and the one outlined in the
> > MatchIt tutorial (2).
> >
> > 1) match.out <- matchit(int01x ~ int00 + loginc00 + male + black + amind +
> > asian + hispa + age01 + age01p2 + educ.hs + educ.col + educ.ass + educ.adv +
> > reg.mw + reg.s + reg.w + metro.y + metro.ni + occ.fff + occ.svc + occ.mpts,
> > data=test, subclass=c(0,.5,1))
> > 2) match.out1 <- matchit(treat ~ age + married + black + hispan + nodegree +
> > educ + re74 + re75, data=lalonde, subclass=c(0, .5, 1))
> >
> > I'm running R 2.1.1 on Windows XP.
> >
> > Thank you for your help!
> >
> > Bart
> >
> > --
> > Bart Bonikowski
> > Graduate Student
> > Department of Sociology
> > Princeton University
> > Princeton, NJ 08544
> > T: (215) 325-1816
> > F: (609) 258-2180
> >
> > -----Original Message-----
> > From: Kosuke Imai [mailto:kimai@Princeton.EDU]
> > Sent: Tuesday, August 09, 2005 2:13 PM
> > To: Bart Bonikowski
> > Cc: matchit(a)latte.harvard.edu
> > Subject: Re: [matchit] MatchIt error message
> >
> > Dear Bart,
> > Could you give us a sample code that produces this error?
> > Thanks,
> > Kosuke
> >
> > -----------------------------------------------------
> > Kosuke Imai Office: Corwin Hall 041
> > Assistant Professor Phone: 609-258-6601
> > Department of Politics eFax: 973-556-1929
> > Princeton University Email: kimai(a)Princeton.Edu
> > Princeton, NJ 08544-1012 http://imai.princeton.edu
> > -----------------------------------------------------
> >
> > On Tue, 9 Aug 2005, Bart Bonikowski wrote:
> >
> > > Hello,
> > >
> > > I have a quick question about an error message generated by MatchIt
> > > (this question was already asked by a user in Feb 2005, but I couldn't
> > > find an answer in the archives). I'm trying to run a propensity score
> > > model with two subclasses. I tried this with my own data, as well as
> > > with the Lalonde dataset used in the MatchIt tutorial. For some
> > > reason, the software returns the following error:
> > >
> > > Calculating propensity score...Done
> > > Matching Treated:
> > > 10%...20%...30%...40%...50%...60%...70%...80%...90%...100%...Done
> > > Calculating summary statistics...Done
> > > Warning message:
> > > the condition has length > 1 and only the first element will be used
> > > in: if
> > > (subclass) {
> > >
> > > When I try to run a summary report on the results, I receive this message:
> > >
> > > Error in rep.default(data, length.out = vl) :
> > > invalid number of copies in rep() In addition: Warning
> > > messages:
> > > 1: no finite arguments to max; returning -Inf
> > > 2: NAs introduced by coercion
> > >
> > > Your help would be much appreciated.
> > >
> > > My best regards,
> > >
> > > Bart Bonikowski
> > >
> > >
> > > --
> > > Bart Bonikowski
> > > Graduate Student
> > > Department of Sociology
> > > Princeton University
> > > Princeton, NJ 08544
> > > T: (215) 325-1816
> > > F: (609) 258-2180
> > >
> > >
> > > -
> > > MatchIt mailing list served by Harvard-MIT Data Center List Address:
> > > matchit(a)latte.harvard.edu
> > > Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
> > > MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
> > >
> >
> >
> >
> > -
> > MatchIt mailing list served by Harvard-MIT Data Center
> > List Address: matchit(a)latte.harvard.edu
> > Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
> > MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
> >
>
>
> -
> MatchIt mailing list served by Harvard-MIT Data Center
> List Address: matchit(a)latte.harvard.edu
> Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
> MatchIt Software and Documentation: http://gking.harvard.edu/matchit/
>
-
MatchIt mailing list served by Harvard-MIT Data Center
List Address: matchit(a)latte.harvard.edu
Subscribe/Unsubscribe: http://lists.hmdc.harvard.edu/?info=matchit
MatchIt Software and Documentation: http://gking.harvard.edu/matchit/