the lack of convergence will happen if you have collinearity among your
covariates, which is probably the problem I'd guess.
Gary
On Tue, 20 Dec 2005, Jeanie (Jie) Na wrote:
> Dear Dr. King,
>
> Thank you for your reply regarding my questions of categorical
> covariates in the model. I've recoded those covariates in format of a
> set of J-1 dummies coding J categories for a nominal variable.
> My number of convariates increased a lot because a few covariates had
> more than a dozen of levels.
> But when I use matchit, there was a warning message at the end.
>
> m.out <- matchit(NASOTUBB ~CENTER.3 + CENTER.10 + CENTER.13 + CENTER.15
> + CENTER.17 + CENTER.19 + CENTER.21 + CENTER.22 + CENTER.23 + CENTER.34
> + CENTER.2 + CENTER.5 + CENTER.6 + CENTER.7 + CENTER.8 + CENTER.11 +
> CENTER.12 + CENTER.14 + CENTER.16 + CENTER.18 + CENTER.30 + CENTER.31 +
> CENTER.32 + CENTER.33 + CENTER.113 + CENTER.20 + ANAESTHC.0 + ANAESTHC.2
> + ANAESTHC.4 + ANAESTHC.6 + ANAESTHC.3 + ANAESTHC.1 + ANAESTHC.7 +
> ANAESTHC.5 + ASA_R...1 + ASA_R...2 + ASA_R...3 + PREDPATC...neither.nor
> + PREDPATC...PONV + PREDPATC...no.PONV + PREDPATC...not.assessed +
> OP_C...knee.arthroscopy + OP_C...cholecystectomy +
> OP_C...general.surgery + OP_C...bone.surgery +
> OP_C...upper.extremity.surgery + OP_C...thyroid.surgery +
> OP_C...ENT.Eye.surgery + OP_C...hysterectomy +
> OP_C...gynaecologic.surgery + OP_C...breast.surgery +
> OP_C...hip.replacement + OP_C...hernia.repair + surg2appc...other +
> surg2appc...abdominal.open + surg2appc...abdominal.laparoscopic +
> WEIGHTN + BMI_N + PONV_GAB + YEAREXPN + KPONVRN ,data = matchuse, method
> = "nearest", distance = "logit")
> Warning message:
> algorithm did not converge in: glm.fit(x = X, y = Y, weights = weights,
> start = start, etastart = etastart,
>
> My question is : Can I still use the result from the matching? if not,
> any suggestions that I can get the algorithm converges.
>
> Thank you very much.
>
> Jeanie
>
> On Mon, 2005-12-19 at 14:00 -0500, Gary King wrote:
>> On Fri, 16 Dec 2005, Jeanie (Jie) Na wrote:
>>
>>> Hi Dr. King,
>>>
>>> I am learning to use MatchIt package in R for a project I am working on.
>>> I have a couple of questions when I read about the manual.
>>>
>>> 1) I have a few categorical variables with multiple levels and a few
>>> continuous variables as covariates. The examples given in the manual of
>>> MatchIt seem to have all the covariates as dichotomous or continuous. Do
>>> I need to recode my data and give them values 1 to n (# of levels)?
>>> It doesnt seem to be ok as of now when I have character values for those
>>> categorical variables.
>>
>> you can exact match on fully category variables. otherwise, i think you'd
>> want to make them into 'continuous' variables as you would right side
>> variables in a regression (such as a set of J-1 dummies coding J
>> categories for a nominal variable)
>>
>>>
>>> 2) can you give me an example of the command if I want to use my own
>>> distance measure? What would be the input for distance? Will it be a
>>> distance matrix with rows for the treated,columns for the controlled,
>>> and values are the abs(logit(propensity score of control
>>> i)-logit(propensity score of treated j)). Or would it be a matrix with
>>> propensity scores as one column?
>>
>> the program allows you to estimate the distance based on Mahalanobis
>> distance or the propensity score computed in a variety of ways. if you
>> need different metrics you might need to explain some more about what
>> you're looking for.
>>
>> Best of luck,
>> Gary King
>>
>>>
>>> I hope I explained myself well. Thank you very much for your advice.
>>> --
>>> Jeanie (Jie) Na
>>>
>>> Programmer Analyst II _ _ ___ _ _ ____
>>> Department of Quantitative Health Sciences [_]-[_] / - \ | |_| | (_(_
>>> Cleveland Clinic Foundation | | ( |_| ) ) _ ( _| )
>>> Tel: (216)4451369 [_]-[_] \_\_\ |_| |_| (___/
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Confidentiality Note: This message is intended for use only by the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. Thank you.
>>> ------------
>>> Visit us online at our award-winning http://www.clevelandclinic.org for a complete listing of Cleveland Clinic services, staff and locations from one of the country's leading hospitals.
>>> ==============================================================================
>>>
>>>
>>
> --
> Jeanie (Jie) Na
>
> Programmer Analyst II _ _ ___ _ _ ____
> Department of Quantitative Health Sciences [_]-[_] / - \ | |_| | (_(_
> Cleveland Clinic Foundation | | ( |_| ) ) _ ( _| )
> Tel: (216)4451369 [_]-[_] \_\_\ |_| |_| (___/
>
>
>
>
> ------------------------------------------------------------------------------
> Confidentiality Note: This message is intended for use only by the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. Thank you.
> ------------
> Visit us online at our award-winning http://www.clevelandclinic.org for a complete listing of Cleveland Clinic services, staff and locations from one of the country's leading hospitals.
> ==============================================================================
>
>
-
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/
On Fri, 16 Dec 2005, Jeanie (Jie) Na wrote:
> Hi Dr. King,
>
> I am learning to use MatchIt package in R for a project I am working on.
> I have a couple of questions when I read about the manual.
>
> 1) I have a few categorical variables with multiple levels and a few
> continuous variables as covariates. The examples given in the manual of
> MatchIt seem to have all the covariates as dichotomous or continuous. Do
> I need to recode my data and give them values 1 to n (# of levels)?
> It doesnt seem to be ok as of now when I have character values for those
> categorical variables.
you can exact match on fully category variables. otherwise, i think you'd
want to make them into 'continuous' variables as you would right side
variables in a regression (such as a set of J-1 dummies coding J
categories for a nominal variable)
>
> 2) can you give me an example of the command if I want to use my own
> distance measure? What would be the input for distance? Will it be a
> distance matrix with rows for the treated,columns for the controlled,
> and values are the abs(logit(propensity score of control
> i)-logit(propensity score of treated j)). Or would it be a matrix with
> propensity scores as one column?
the program allows you to estimate the distance based on Mahalanobis
distance or the propensity score computed in a variety of ways. if you
need different metrics you might need to explain some more about what
you're looking for.
Best of luck,
Gary King
>
> I hope I explained myself well. Thank you very much for your advice.
> --
> Jeanie (Jie) Na
>
> Programmer Analyst II _ _ ___ _ _ ____
> Department of Quantitative Health Sciences [_]-[_] / - \ | |_| | (_(_
> Cleveland Clinic Foundation | | ( |_| ) ) _ ( _| )
> Tel: (216)4451369 [_]-[_] \_\_\ |_| |_| (___/
>
>
>
>
> ------------------------------------------------------------------------------
> Confidentiality Note: This message is intended for use only by the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. Thank you.
> ------------
> Visit us online at our award-winning http://www.clevelandclinic.org for a complete listing of Cleveland Clinic services, staff and locations from one of the country's leading hospitals.
> ==============================================================================
>
>
-
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/
I still think this is a windows problem, but let me CC the MatchIt list
and see if someone else has an idea.
Gary
On Wed, 7 Dec 2005, Robert Mendelson wrote:
> Rebooting makes no difference. Any other ideas? When I try to install, I
> get, in the 'wise uninstall window', the message "Could not open INSTALL.LOG
> file."
>
>
> Robert Mendelson
>
> -----Original Message-----
> From: Gary King [mailto:king@harvard.edu]
> Sent: December 6, 2005 11:29 PM
> To: Robert Mendelson
> Subject: problem uninstalling MAtchIt
>
>
> sorry, your message got marked as spam. The problem you're having is not
> with MatchIt, and I don't even think with R, but with Windows. I would try
> rebooting perhaps.
>
> Gary
>
> On Sun, 4 Dec 2005, Robert Mendelson wrote:
>
>> I'm trying to uninstall MatchIt through the normal way , but I
>> encounter this problem:
>>
>>
>>
>>
>>
>>
>> Any ideas?
>>
>> Thx.
>>
>> Robert Mendelson
>> * <mailto:*remdog99@hotmail.com> remdog99(a)hotmail.com
>>
>>
>>
>>
>
-
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/
Thank you very much. I didn't mean to create more work for you though.
-----Original Message-----
From: Kosuke Imai [mailto:kimai@Princeton.EDU]
Sent: Thursday, December 01, 2005 7:23 PM
To: Lim, Nelson
Cc: matchit(a)mail-1.hmdc.harvard.edu
Subject: Re: [matchit] How to use matchit with existing propensity
scores
Thanks for the suggestion. We will make this change in a few days...
Kosuke
---------------------------------------------------------
Kosuke Imai Office: Corwin Hall 041
Assistant Professor Phone: 609-258-6601
Department of Politics Fax: 973-556-1929
Princeton University Email: kimai(a)Princeton.Edu
Princeton, NJ 08544-1012 http://imai.princeton.edu
---------------------------------------------------------
On Dec 1, 2005, at 3:07 PM, Lim, Nelson wrote:
> I estimated propensity scores using generalized boosted regression
> model (gbm in R). I would like to use the scores with Matchit. Can I?
>
> --------------------
>
> This email message is for the sole use of the intended recipient(s)
> and may contain privileged information. Any unauthorized review, use,
> disclosure or distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply email and destroy all
> copies of the original message.
>
>
>
> -
> 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/
--------------------
This email message is for the sole use of the intended recipient(s) and
may contain privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message.
-
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/
I estimated propensity scores using generalized boosted regression model
(gbm in R). I would like to use the scores with Matchit. Can I?
--------------------
This email message is for the sole use of the intended recipient(s) and
may contain privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message.
-
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/
On the topic of when to use "suggests" and "depends" and on R version requirements.
I have cc'd this message to R-devel because I am curious about what
senior developpers think about these issues. The problem arises
because we are using some functions from the package "matchit" in a
new version of our package "portfolio". We are listing the matchit in
"suggests" rather than "depends" becuase much of the package works
without it. If a user wants the functionality which requires matchit
functions, we prompt them to install it.
Our problem is that when a user loads up matchit, it requires MASS and
Zelig via depends. Moreover, Zelig itself requires MASS and boot. So,
just to use our package portfolio, a user is now required to load up
three packages even though, I think, only a single function from one
of these packages it actually required.
Kosuke Imai writes:
> We have MASS and Zelig in there because some functions are borrowed from
> those packages.
The right way to handle this is only to make these packages as
"suggests" rather than "depends" and then install them if needed, as
you do correctly with optmatch. Note that Writing R Extensions says:
"Packages that need to be attached to successfully load the package
using library(pkgname) must be listed in the Depends field."
Although this is not directlty on point, my interpretation is that you
need a "good reason" to list a package in Depends rather than
Suggests.
> MASS is a standard package, and so i don't think it's a
> big problem to require it.
True. But is there some reason that this could not just be a suggest?
> And, some of us including myself hope that
> Zelig will become a standard package in the future! :)
But it isn't yet. Moreover, if you really want this to happen there is
a lot you should be doing with the code base, like test cases and S-4
classes and . . . .
> As for the requirement of R 2.2.0, we do it simply because we only
> test it against the most recent version of R.
I do not *think* that this is the way cool package authors do
things. (Nor do you yourself do it for Zelig.) It is easy to check (if
you have test cases!) that a package works with the current version of
R since checks are run on CRAN each day.
> Some functions are not backward compatible because R is not
> generally not backward compatible.
R is amazingly backward compatible, I would say. I do not *think* that
there is any reason why matchit requires anything prior to 2.0.0. By
having a 2.2.0 requiremnt, you make it impossible for people using
earlier versions of R to use the package. This is a problem for me
because, if I want to use matchit, the same constraint will apply to
*my* package.
I think that the cool people handle this by ensuring that the package
works with version X and then leaving that as constraint in
depends. Since R automates the testing of packages, one can easily
check that the package still works (if you have test cases!) as more
versions of R come out. Now, there is a dilemma in that, as you
fix/improve the package, you may not *know* for a fact that it *still*
works with version X but the vast majority of things will. Major
changes are highlighted in the release notes.
Why does any of this whining matter to you? Well, if all of the above
gets annoying enough, then other package authors like me will not
bother to include matchit. We will just copy and paste the subset of
the code that we want to use into our own package. This is not
desirable but is allowed. We would prefer not to do this with our
portfolio package, but we have users who are running R 2.1.0 that we
want our package to work for . . .
In any event, thanks for your time and for a useful piece of open
source software. I am a big fan of matchit (and Zelig). The point of
all the above is to make some suggestions that I *think* will result
in wider use of the program. But, again, I am curious about what more
senior/experienced R developpers think.
Dave Kane
-
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/
It seems bad form for MatchIt to depend on MASS and Zelig (and for
Zelig to depend MASS and boot). I shouldn't have to have all these
packages installed and loaded to use the subset of functionality that
I care about in MatchIt.
Better, I think, is the way that optmatch is handled as a "suggests."
This has arisen because I want to use some functionality from MatchIt
in my package. I don't want to require my users to install a bunch of
unneeded packages as a part of this exercise.
Or am I missing something?
Also, is there some reason that MatchIt requires R 2.2.0? It would be
easier for it also worked with early versions.
Dave Kane
-
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/