I found the bug.
Why in the world would .onAttach set the global digits option? This is
really bad coding practice.
.onAttach <- function(...) {
mylib <- dirname(system.file(package = "MatchIt"))
ver <- packageDescription("MatchIt", lib = mylib)$Version
builddate <- packageDescription("MatchIt", lib = mylib)$Date
cat(paste("## \n## MatchIt (Version ", ver, ", built: ", builddate, ")\n",
sep = ""))
cat("## Please refer to http://gking.harvard.edu/matchit for full
documentation \n",
"## or help.matchit() for help with commands supported by MatchIt.\n##\n",
sep="")
options(digits = 4)
}
Hello,
I have come across something that I think is a bug in the new R release of
MatchIt.
The summary object seems to be intercepting summary() on base classes, not
just matchit objects.
R version 2.11.0 (2010-04-22)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- c(2009, 2009, 2000, 2003)
> max(x)
[1] 2009
> summary(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
2000 2002 2006 2005 2009 2009
> require(MatchIt)
Loading required package: MatchIt
Loading required package: MASS
##
## MatchIt (Version 2.4-11, built: 2009-06-25)
## Please refer to http://gking.harvard.edu/matchit for full documentation
## or help.matchit() for help with commands supported by MatchIt.
##
> summary(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
2000 2000 2010 2010 2010 2010
Thanks for your help.
Hi,
I am looking to analyze data where my treatment of interest is 'years of
education', using CEM. I have summarized this indep var down to three levels
(no education, only primary, primary plus), but from what I read in the
documentation I can only calculate CEM analysis weights if I have a binary
treatment.
Does this advice still stand, or is there now a soln to this issue?
Thanks for your help - Nick
--
Nick Menzies
nick.menzies(a)gmail.com
404 217 1076