diff --git a/DESCRIPTION b/DESCRIPTION index a7d11a1..850c113 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: Matching -Version: 4.10-8 -Date: 2022-11-03 +Version: 4.10-14 +Date: 2023-09-13 Title: Multivariate and Propensity Score Matching with Balance Optimization Authors@R: c( diff --git a/R/GenMatching.R b/R/GenMatching.R index 536f8dd..b0cd3d3 100644 --- a/R/GenMatching.R +++ b/R/GenMatching.R @@ -364,7 +364,7 @@ GenMatch <- function(Tr, X, BalanceMatrix=X, estimand="ATT", M=1, #print warning if pop.size, max.generations and wait.generations are all set to their original values if(pop.size==100 & max.generations==100 & wait.generations==4) { - warning("The key tuning parameters for optimization were are all left at their default values. The 'pop.size' option in particular should probably be increased for optimal results. For details please see the help page and http://sekhon.berkeley.edu/papers/MatchingJSS.pdf") + warning("The key tuning parameters for optimization were are all left at their default values. The 'pop.size' option in particular should probably be increased for optimal results. For details please see the help page and https://www.jsekhon.com") } #loss function diff --git a/R/Matching.R b/R/Matching.R index 051738e..676b304 100644 --- a/R/Matching.R +++ b/R/Matching.R @@ -1,5 +1,5 @@ # Jasjeet S. Sekhon -# HTTP://sekhon.berkeley.edu/ +# https://www.jsekhon.com # UC Berkeley # Match(): function to estimate treatments using a matching estimator. @@ -3039,7 +3039,7 @@ VarCalcMatchC <- function(N, xvars, Var.calc, cdd, caliperflag, ww, Tr, Xmod, Ca BuildDate <- packageDescription("Matching", lib.loc = MatchLib)$Date foo <- paste("## \n## Matching (Version ", version, ", Build Date: ", BuildDate, ")\n", - "## See http://sekhon.berkeley.edu/matching for additional documentation.\n", + "## See https://www.jsekhon.com for additional documentation.\n", "## Please cite software as:\n", "## Jasjeet S. Sekhon. 2011. ``Multivariate and Propensity Score Matching\n", "## Software with Automated Balance Optimization: The Matching package for R.''\n", diff --git a/inst/CITATION b/inst/CITATION index 451a867..985d54f 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,9 +1,9 @@ citHeader("To cite 'Matching' in publications use:") -citEntry( +bibentry( entry = "Article", title = "Multivariate and Propensity Score Matching Software with Automated Balance Optimization: The {Matching} Package for {R}", - author = personList(as.person("Jasjeet S. Sekhon")), + author = c(as.person("Jasjeet S. Sekhon")), journal = "Journal of Statistical Software", year = "2011", volume = "42", @@ -15,30 +15,32 @@ citEntry( paste("Jasjeet S. Sekhon (2011).", "Multivariate and Propensity Score Matching Software with Automated Balance Optimization: The Matching Package for R.", "Journal of Statistical Software, 42(7), 1-52.", - "") + ""), + bibtype = "Article" ) -citEntry(header="To refer to the theory on which this package is based:", +bibentry(header="To refer to the theory on which this package is based:", entry="Article", title = "Genetic Matching for Estimating Causal Effects: A General Multivariate Matching Method for Achieving Balance in Observational Studies", - author = personList(as.person("Alexis Diamond"),as.person("Jasjeet S. Sekhon")), + author = c(as.person("Alexis Diamond"),as.person("Jasjeet S. Sekhon")), journal = "Review of Economics and Statistics", volume = "95", number = "3", pages = "932--945", year = "2013", - url = "http://sekhon.berkeley.edu/papers/GenMatch.pdf", + url = "https://www.jsekhon.com", textVersion = paste("Alexis Diamond and Jasjeet S. Sekhon", "Genetic Matching for Estimating Causal Effects: A General Multivariate Matching Method for Achieving Balance in Observational Studies.", - "Review of Economics and Statistics. 95 (3): 932--945. 2013.") + "Review of Economics and Statistics. 95 (3): 932--945. 2013."), + bibtype = "Article" ) -citEntry(header="Further developing the theory and practice:", +bibentry(header="Further developing the theory and practice:", entry="Article", title = "A Matching Method For Improving Covariate Balance in Cost-Effectiveness Analyses", - author = personList(as.person("Jasjeet Singh Sekhon"),as.person("Richard D. Grieve")), + author = c(as.person("Jasjeet Singh Sekhon"),as.person("Richard D. Grieve")), journal = "Health Economics", volume = "21", number = "6", @@ -49,7 +51,8 @@ citEntry(header="Further developing the theory and practice:", paste("Jasjeet Singh Sekhon and Richard D. Grieve (2012).", "A Matching Method For Improving Covariate Balance in Cost-Effectiveness Analyses.", "Health Economics, 21(6), 695-714." - ) + ), + bibtype = "Article" ) citFooter("BibTeX entries for LaTeX users: use\n", sQuote('toBibtex(citation("Matching"))')) diff --git a/inst/extras/cblas_dasum.c b/inst/extras/cblas_dasum.c index 707e4fc..1128441 100644 --- a/inst/extras/cblas_dasum.c +++ b/inst/extras/cblas_dasum.c @@ -9,7 +9,8 @@ */ #include -#include /* R blas declarations */ +#include /* No longer contains R blas declarations */ +#include /* New R blas declarations */ #include "cblas.h" double cblas_dasum( const int N, const double *X, const int incX) diff --git a/inst/extras/cblas_dgemm.c b/inst/extras/cblas_dgemm.c index 4a5d0c0..1705664 100644 --- a/inst/extras/cblas_dgemm.c +++ b/inst/extras/cblas_dgemm.c @@ -8,7 +8,8 @@ */ #include -#include /* R blas declarations */ +#include /* No longer contains R blas declarations */ +#include /* New R blas declarations */ #include "cblas.h" void cblas_dgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, diff --git a/inst/extras/cblas_dscal.c b/inst/extras/cblas_dscal.c index 4bf9c02..3d91097 100644 --- a/inst/extras/cblas_dscal.c +++ b/inst/extras/cblas_dscal.c @@ -8,7 +8,8 @@ */ #include -#include /* R blas declarations */ +#include /* No longer contains R blas declarations */ +#include /* New R blas declarations */ #include "cblas.h" void cblas_dscal( const int N, const double alpha, double *X, diff --git a/inst/extras/cblas_dsymm.c b/inst/extras/cblas_dsymm.c index 33246c3..f2c7b8a 100644 --- a/inst/extras/cblas_dsymm.c +++ b/inst/extras/cblas_dsymm.c @@ -8,7 +8,8 @@ */ #include -#include /* R blas declarations */ +#include /* No longer contains R blas declarations */ +#include /* New R blas declarations */ #include "cblas.h" void cblas_dsymm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, diff --git a/inst/extras/cblas_dtrmm.c b/inst/extras/cblas_dtrmm.c index 551bca6..5c97c95 100644 --- a/inst/extras/cblas_dtrmm.c +++ b/inst/extras/cblas_dtrmm.c @@ -8,7 +8,8 @@ */ #include -#include /* R blas declarations */ +#include /* No longer contains R blas declarations */ +#include /* New R blas declarations */ #include "cblas.h" void cblas_dtrmm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, diff --git a/man/GenMatch.Rd b/man/GenMatch.Rd index c755d1b..035005d 100644 --- a/man/GenMatch.Rd +++ b/man/GenMatch.Rd @@ -123,7 +123,7 @@ GenMatch(Tr, X, BalanceMatrix=X, estimand="ATT", M=1, weights=NULL, below. And the second being a matrix which contains the variables to be balanced---i.e., the \code{BalanceMatrix} the user provided to \code{GenMatch}. For an example see - \url{http://sekhon.berkeley.edu/matching/R/my_fitfunc.R}.} + \url{https://www.jsekhon.com}.} \item{MemoryMatrix}{ This variable controls if \code{\link[rgenoud]{genoud}} sets up a memory matrix. Such a matrix ensures that \code{\link[rgenoud]{genoud}} will request the fitness evaluation @@ -321,9 +321,9 @@ GenMatch(Tr, X, BalanceMatrix=X, estimand="ATT", M=1, weights=NULL, cluster object to \code{GenMatch}. For an example of how to manually setup up a cluster with a direct call to \code{\link[parallel]{makeCluster}} see - \url{http://sekhon.berkeley.edu/matching/R/cluster_manual.R}. For + \url{https://www.jsekhon.com}. For an example of how to get around a firewall by ssh tunneling see: - \url{http://sekhon.berkeley.edu/matching/R/cluster_manual_tunnel.R}.} + \url{https://www.jsekhon.com}.} \item{balance}{This logical flag controls if load balancing is done across the cluster. Load balancing can result in better cluster utilization; however, increased communication can reduce @@ -369,16 +369,16 @@ GenMatch(Tr, X, BalanceMatrix=X, estimand="ATT", M=1, weights=NULL, Matching for Estimating Causal Effects: A General Multivariate Matching Method for Achieving Balance in Observational Studies.'' \emph{Review of Economics and Statistics}. 95 (3): 932--945. - \url{http://sekhon.berkeley.edu/papers/GenMatch.pdf} + \url{https://www.jsekhon.com} Sekhon, Jasjeet Singh and Walter R. Mebane, Jr. 1998. "Genetic Optimization Using Derivatives: Theory and Application to Nonlinear Models.'' \emph{Political Analysis}, 7: 187-210. - \url{http://sekhon.berkeley.edu/genoud/genoud.pdf} + \url{https://www.jsekhon.com} } \author{ Jasjeet S. Sekhon, UC Berkeley, \email{sekhon@berkeley.edu}, - \url{http://sekhon.berkeley.edu/}. + \url{https://www.jsekhon.com}. } \seealso{ Also see \code{\link{Match}}, \code{\link{summary.Match}}, \code{\link{MatchBalance}}, \code{\link[rgenoud]{genoud}}, @@ -402,7 +402,7 @@ BalanceMat <- cbind(age, educ, black, hisp, married, nodegr, u74, u75, re75, re7 #'BalanceMat'. This is only an example so we want GenMatch to be quick #so the population size has been set to be only 16 via the 'pop.size' #option. This is *WAY* too small for actual problems. -#For details see http://sekhon.berkeley.edu/papers/MatchingJSS.pdf. +#For details see https://www.jsekhon.com. # genout <- GenMatch(Tr=treat, X=X, BalanceMatrix=BalanceMat, estimand="ATE", M=1, pop.size=16, max.generations=10, wait.generations=1) @@ -424,7 +424,7 @@ mb <- MatchBalance(treat~age +educ+black+ hisp+ married+ nodegr+ u74+ u75+ re75+ re74+ I(re74*re75), match.out=mout, nboots=500) -# For more examples see: http://sekhon.berkeley.edu/matching/R. +# For more examples see: https://www.jsekhon.com. } \keyword{nonparametric} diff --git a/man/Match.Rd b/man/Match.Rd index f9fa7b3..9556d5b 100644 --- a/man/Match.Rd +++ b/man/Match.Rd @@ -305,7 +305,7 @@ Match(Y=NULL, Tr, X, Z = X, V = rep(1, length(Y)), estimand = "ATT", M = 1, Matching for Estimating Causal Effects: A General Multivariate Matching Method for Achieving Balance in Observational Studies.'' \emph{Review of Economics and Statistics}. 95 (3): 932--945. - \url{http://sekhon.berkeley.edu/papers/GenMatch.pdf} + \url{https://www.jsekhon.com} Abadie, Alberto and Guido Imbens. 2006. ``Large Sample Properties of Matching Estimators for Average @@ -316,7 +316,7 @@ Match(Y=NULL, Tr, X, Z = X, V = rep(1, length(Y)), estimand = "ATT", M = 1, } \author{Jasjeet S. Sekhon, UC Berkeley, \email{sekhon@berkeley.edu}, - \url{http://sekhon.berkeley.edu/}. + \url{https://www.jsekhon.com}. } \seealso{ Also see \code{\link{summary.Match}}, \code{\link{GenMatch}}, diff --git a/man/MatchBalance.Rd b/man/MatchBalance.Rd index 07b0067..ec79af4 100644 --- a/man/MatchBalance.Rd +++ b/man/MatchBalance.Rd @@ -126,7 +126,7 @@ MatchBalance(formul, data = NULL, match.out = NULL, ks = TRUE, Matching for Estimating Causal Effects: A General Multivariate Matching Method for Achieving Balance in Observational Studies.'' \emph{Review of Economics and Statistics}. 95 (3): 932--945. - \url{http://sekhon.berkeley.edu/papers/GenMatch.pdf} + \url{https://www.jsekhon.com} Abadie, Alberto. 2002. ``Bootstrap Tests for Distributional Treatment Effects in Instrumental Variable Models.'' \emph{Journal of the @@ -147,7 +147,7 @@ MatchBalance(formul, data = NULL, match.out = NULL, ks = TRUE, } \author{ Jasjeet S. Sekhon, UC Berkeley, \email{sekhon@berkeley.edu}, - \url{http://sekhon.berkeley.edu/}. + \url{https://www.jsekhon.com}. } \seealso{ Also see \code{\link{Match}}, \code{\link{GenMatch}}, diff --git a/man/Matchby.Rd b/man/Matchby.Rd index bcc9cad..f1e1bd4 100644 --- a/man/Matchby.Rd +++ b/man/Matchby.Rd @@ -209,7 +209,7 @@ Matchby(Y, Tr, X, by, estimand = "ATT", M = 1, ties=FALSE, replace=TRUE, Matching for Estimating Causal Effects: A General Multivariate Matching Method for Achieving Balance in Observational Studies.'' \emph{Review of Economics and Statistics}. 95 (3): 932--945. - \url{http://sekhon.berkeley.edu/papers/GenMatch.pdf} + \url{https://www.jsekhon.com} Abadie, Alberto and Guido Imbens. 2006. ``Large Sample Properties of Matching Estimators for Average @@ -220,7 +220,7 @@ Matchby(Y, Tr, X, by, estimand = "ATT", M = 1, ties=FALSE, replace=TRUE, } \author{Jasjeet S. Sekhon, UC Berkeley, \email{sekhon@berkeley.edu}, - \url{http://sekhon.berkeley.edu/}. + \url{https://www.jsekhon.com}. } \seealso{ Also see \code{\link{Match}}, \code{\link{summary.Matchby}}, diff --git a/man/balanceUV.Rd b/man/balanceUV.Rd index b08a1df..fee015c 100644 --- a/man/balanceUV.Rd +++ b/man/balanceUV.Rd @@ -76,7 +76,7 @@ balanceUV(Tr, Co, weights = rep(1, length(Co)), exact = FALSE, ks=FALSE, } \author{ Jasjeet S. Sekhon, UC Berkeley, \email{sekhon@berkeley.edu}, - \url{http://sekhon.berkeley.edu/}. + \url{https://www.jsekhon.com}. } \references{ Sekhon, Jasjeet S. 2011. "Multivariate and Propensity Score @@ -88,7 +88,7 @@ balanceUV(Tr, Co, weights = rep(1, length(Co)), exact = FALSE, ks=FALSE, Matching for Estimating Causal Effects: A General Multivariate Matching Method for Achieving Balance in Observational Studies.'' \emph{Review of Economics and Statistics}. 95 (3): 932--945. - \url{http://sekhon.berkeley.edu/papers/GenMatch.pdf} + \url{https://www.jsekhon.com} Rosenbaum, Paul R. and Donald B. Rubin. 1985. ``Constructing a Control Group Using Multivariate Matched Sampling Methods That Incorporate the diff --git a/man/ks.boot.Rd b/man/ks.boot.Rd index a1d06dc..ecf0dd9 100644 --- a/man/ks.boot.Rd +++ b/man/ks.boot.Rd @@ -33,7 +33,7 @@ ks.boot(Tr, Co, nboots=1000, alternative = c("two.sided","less","greater"), } \author{ Jasjeet S. Sekhon, UC Berkeley, \email{sekhon@berkeley.edu}, - \url{http://sekhon.berkeley.edu/}. + \url{https://www.jsekhon.com}. } \references{ Sekhon, Jasjeet S. 2011. "Multivariate and Propensity Score @@ -45,7 +45,7 @@ ks.boot(Tr, Co, nboots=1000, alternative = c("two.sided","less","greater"), Estimating Causal Effects: A General Multivariate Matching Method for Achieving Balance in Observational Studies.'' \emph{Review of Economics and Statistics}. 95 (3): 932--945. - \url{http://sekhon.berkeley.edu/papers/GenMatch.pdf} + \url{https://www.jsekhon.com} Abadie, Alberto. 2002. ``Bootstrap Tests for Distributional Treatment Effects in Instrumental Variable Models.'' \emph{Journal of the diff --git a/man/qqstats.Rd b/man/qqstats.Rd index 7f9ae24..de386ea 100644 --- a/man/qqstats.Rd +++ b/man/qqstats.Rd @@ -37,7 +37,7 @@ qqstats(x, y, standardize=TRUE, summary.func) } \author{ Jasjeet S. Sekhon, UC Berkeley, \email{sekhon@berkeley.edu}, - \url{http://sekhon.berkeley.edu/}. + \url{https://www.jsekhon.com}. } \references{ Sekhon, Jasjeet S. 2011. "Multivariate and Propensity Score @@ -48,7 +48,7 @@ qqstats(x, y, standardize=TRUE, summary.func) Diamond, Alexis and Jasjeet S. Sekhon. Forthcoming. "Genetic Matching for Estimating Causal Effects: A General Multivariate Matching Method for Achieving Balance in Observational Studies.'' \emph{Review of Economics and Statistics}. - \url{http://sekhon.berkeley.edu/papers/GenMatch.pdf} + \url{https://www.jsekhon.com} } \seealso{ Also see \code{\link{ks.boot}}, \code{\link{balanceUV}}, \code{\link{Match}}, diff --git a/man/summary.Match.Rd b/man/summary.Match.Rd index a9e3145..fc61e9d 100644 --- a/man/summary.Match.Rd +++ b/man/summary.Match.Rd @@ -19,7 +19,7 @@ } \author{ Jasjeet S. Sekhon, UC Berkeley, \email{sekhon@berkeley.edu}, - \url{http://sekhon.berkeley.edu/}. + \url{https://www.jsekhon.com}. } \seealso{ Also see \code{\link{Match}}, \code{\link{GenMatch}}, \code{\link{MatchBalance}}, diff --git a/man/summary.Matchby.Rd b/man/summary.Matchby.Rd index 3aac546..56fae30 100644 --- a/man/summary.Matchby.Rd +++ b/man/summary.Matchby.Rd @@ -17,7 +17,7 @@ } \author{ Jasjeet S. Sekhon, UC Berkeley, \email{sekhon@berkeley.edu}, - \url{http://sekhon.berkeley.edu/}. + \url{https://www.jsekhon.com}. } \seealso{ Also see \code{\link{Matchby}}, \code{\link{Match}}, \code{\link{GenMatch}}, \code{\link{MatchBalance}}, diff --git a/man/summary.balanceUV.Rd b/man/summary.balanceUV.Rd index 1b3730f..0508aef 100644 --- a/man/summary.balanceUV.Rd +++ b/man/summary.balanceUV.Rd @@ -16,7 +16,7 @@ } \author{ Jasjeet S. Sekhon, UC Berkeley, \email{sekhon@berkeley.edu}, - \url{http://sekhon.berkeley.edu/}. + \url{https://www.jsekhon.com}. } \seealso{ Also see \code{\link{balanceUV}}, diff --git a/man/summary.ks.boot.Rd b/man/summary.ks.boot.Rd index da23c7d..9e3f106 100644 --- a/man/summary.ks.boot.Rd +++ b/man/summary.ks.boot.Rd @@ -17,7 +17,7 @@ } \author{ Jasjeet S. Sekhon, UC Berkeley, \email{sekhon@berkeley.edu}, - \url{http://sekhon.berkeley.edu/}. + \url{https://www.jsekhon.com}. } \seealso{ Also see \code{\link{ks.boot}}, \code{\link{balanceUV}}, \code{\link{qqstats}}, diff --git a/src/cblas_dasum.c b/src/cblas_dasum.c index ce6ff37..00a9e1c 100644 --- a/src/cblas_dasum.c +++ b/src/cblas_dasum.c @@ -25,13 +25,14 @@ Jas Sekhon - http://sekhon.berkeley.edu + https://www.jsekhon.com August 1, 2007 */ #include -#include /* R blas declarations */ +#include /* No longer contains R blas declarations */ +#include /* New R blas declarations */ //#include "cblas.h" double cblas_dasum( const int N, const double *X, const int incX) diff --git a/src/matching.cc b/src/matching.cc index f0c5f38..ad65f73 100644 --- a/src/matching.cc +++ b/src/matching.cc @@ -2283,8 +2283,7 @@ extern "C" { SEXP ret; - long N, xvars, M, caliper, restrict_trigger, restrict_nrow, DiagWeightMatrixFlag, - sum_caliper_drops=0; + long N, xvars, M, caliper, restrict_trigger, restrict_nrow, DiagWeightMatrixFlag; double cdd, diff, Distmax, dfoo; long i, j, k; @@ -2605,7 +2604,6 @@ extern "C" { if ( (Distmax+cdd) > DBL_MAX_CHECK) { - sum_caliper_drops++; continue; } } @@ -2673,7 +2671,6 @@ extern "C" { if ( (Distmax+cdd) > DBL_MAX_CHECK) { - sum_caliper_drops++; continue; } } diff --git a/src/scythematrix.cc b/src/scythematrix.cc index fa38930..789e844 100644 --- a/src/scythematrix.cc +++ b/src/scythematrix.cc @@ -1,5 +1,5 @@ /* Edited by Jasjeet S. Sekhon */ -/* HTTP://sekhon.berkeley.edu */ +/* https://www.jsekhon.com */ /* */ /* April 26, 2013 */ /* get rid of friend-injection for ones, zero, seqa */ diff --git a/src/scythematrix.h b/src/scythematrix.h index 04ab019..675ac48 100644 --- a/src/scythematrix.h +++ b/src/scythematrix.h @@ -1,5 +1,5 @@ /* Edited by Jasjeet S. Sekhon */ -/* HTTP://sekhon.berkeley.edu */ +/* https://www.jsekhon.com */ /* */ /* April 26, 2013 */ /* get rid of friend-injection for ones, zero, seqa */ diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index ec18f07..e6b19ae 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -1,6 +1,5 @@ is_mac <- function() { - return(grepl('darwin', R.Version()$platform, ignore.case = TRUE) && - (grepl('x86', R.Version()$platform, ignore.case = TRUE) || grepl('aarch', R.Version()$platform, ignore.case = TRUE))) + return(grepl('darwin', R.Version()$platform, ignore.case = TRUE) && grepl('x86', R.Version()$platform, ignore.case = TRUE)) } skip_if_not_mac <- function() { diff --git a/tests/testthat/test-GenMatch.R b/tests/testthat/test-GenMatch.R index 3af836c..5eb080a 100644 --- a/tests/testthat/test-GenMatch.R +++ b/tests/testthat/test-GenMatch.R @@ -20,7 +20,7 @@ BalanceMat <- cbind(age, educ, black, hisp, married, nodegr, u74, u75, re75, re7 #'BalanceMat'. This is only an example so we want GenMatch to be quick #so the population size has been set to be only 16 via the 'pop.size' #option. This is *WAY* too small for actual problems. -#For details see http://sekhon.berkeley.edu/papers/MatchingJSS.pdf. +#For details see https://www.jsekhon.com. # genout <- GenMatch(Tr=treat, X=X, BalanceMatrix=BalanceMat, estimand="ATE", M=1, pop.size=16, max.generations=10, wait.generations=1, @@ -47,7 +47,7 @@ mb <- MatchBalance(treat~age +educ+black+ hisp+ married+ nodegr+ u74+ u75+ expect_equal(nrow(genout$Weight.matrix), 10) expect_equal(ncol(genout$Weight.matrix), 10) -# For more examples see: http://sekhon.berkeley.edu/matching/R. +# For more examples see: https://www.jsekhon.com before_sdiff <- unlist(lapply(mb$BeforeMatching, function(x){return(x$sdiff)})) after_sdfiff <- unlist(lapply(mb$AfterMatching, function(x){return(x$sdiff)}))