Skip to content

Commit

Permalink
Merge pull request #186 from ngreifer/master
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
ngreifer authored Jan 19, 2024
2 parents c0adaf0 + 49acf69 commit 651c669
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: MatchIt
Version: 4.5.5
Version: 4.5.5.9000
Title: Nonparametric Preprocessing for Parametric Causal Inference
Description: Selects matched samples of the original treated and
control groups with similar covariate distributions -- can be
Expand Down
1 change: 1 addition & 0 deletions MatchIt.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageCheckArgs: --as-cran
PackageRoxygenize: rd,collate,namespace
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ output:
`MatchIt` News and Updates
======

# MatchIt (development version)

* Fixed a bug when using `method = "optimal"` or `method = "full"` with `discard` specified and `data` given as a tibble (`tbl_df` object). (#185)

# MatchIt 4.5.5

* When using `method = "cardinality"`, a new solver, HiGHS, can be requested by setting `solver = "highs"`, which relies on the `highs` package. This is much faster and more reliable than GLPK and is free and easy to install as a regular R package with no additional requirements.
Expand Down
2 changes: 1 addition & 1 deletion R/matchit2full.R
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ matchit2full <- function(treat, formula, data, distance, discarded,
mo <- mo[!discarded[treat == focal], !discarded[treat != focal], drop = FALSE]
dimnames(mo) <- list(names(treat_)[treat_ == 1], names(treat_)[treat_ == 0])

mo <- optmatch::match_on(mo, data = data[!discarded,, drop = FALSE])
mo <- optmatch::match_on(mo, data = as.data.frame(data)[!discarded,, drop = FALSE])
mo <- optmatch::as.InfinitySparseMatrix(mo)

#Process antiexact
Expand Down
4 changes: 2 additions & 2 deletions R/matchit2optimal.R
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ matchit2optimal <- function(treat, formula, data, distance, discarded,
ratio = 1, s.weights = NULL, caliper = NULL,
mahvars = NULL, exact = NULL,
estimand = "ATT", verbose = FALSE,
is.full.mahalanobis, antiexact = NULL, ...) {
is.full.mahalanobis, antiexact = NULL, ...) {

rlang::check_installed("optmatch")

Expand Down Expand Up @@ -360,7 +360,7 @@ matchit2optimal <- function(treat, formula, data, distance, discarded,
mo <- mo[!discarded[treat == focal], !discarded[treat != focal], drop = FALSE]
dimnames(mo) <- list(names(treat_)[treat_ == 1], names(treat_)[treat_ == 0])

mo <- optmatch::match_on(mo, data = data[!discarded,, drop = FALSE])
mo <- optmatch::match_on(mo, data = as.data.frame(data)[!discarded,, drop = FALSE])
mo <- optmatch::as.InfinitySparseMatrix(mo)

#Process antiexact
Expand Down
4 changes: 2 additions & 2 deletions R/plot.matchit.R
Original file line number Diff line number Diff line change
Expand Up @@ -900,10 +900,10 @@ jitter.pscore <- function(x, interactive, pch = 1, ...){
pch = pch, cex = cwt[treat==0 & matched], ...)
#Unmatched treated
points(pscore[treat==1 & !matched], jitp[treat==1 & !matched],
pch = pch, cex = cswt[treat==1 & matched],...)
pch = pch, cex = cswt[treat==1 & !matched],...)
#Unmatched control
points(pscore[treat==0 & !matched], jitp[treat==0 & !matched],
pch = pch, cex = cswt[treat==0 & matched], ...)
pch = pch, cex = cswt[treat==0 & !matched], ...)

axis(1)

Expand Down
18 changes: 18 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,21 @@ Please cite `MatchIt` when using it for analysis presented in publications, whic
Ho, D. E., Imai, K., King, G., & Stuart, E. A. (2011). MatchIt: Nonparametric Preprocessing for Parametric Causal Inference. *Journal of Statistical Software*, 42(8). [doi:10.18637/jss.v042.i08](https://doi.org/10.18637/jss.v042.i08)

This citation can also be accessed using `citation("MatchIt")` in R. For reproducibility purposes, it is also important to include the version number for the version used.

### Installation

To download and install the latest stable version of `MatchIt` from CRAN, run the following:

```{r, eval=F}
install.packages("MatchIt")
```

To install a development version, which may have a bug fixed or a new feature, run the following:

```{r, eval=F}
install.packages("remotes") #If not yet installed
remotes::install_github("ngreifer/MatchIt")
```

This will require R to compile C++ code, which might require additional software be installed on your computer. If you need the development version but can't compile the package, ask the maintainer for a binary version of the package.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,26 @@ Statistical Software*, 42(8).
This citation can also be accessed using `citation("MatchIt")` in R. For
reproducibility purposes, it is also important to include the version
number for the version used.

### Installation

To download and install the latest stable version of `MatchIt` from
CRAN, run the following:

``` r
install.packages("MatchIt")
```

To install a development version, which may have a bug fixed or a new
feature, run the following:

``` r
install.packages("remotes") #If not yet installed

remotes::install_github("ngreifer/MatchIt")
```

This will require R to compile C++ code, which might require additional
software be installed on your computer. If you need the development
version but can’t compile the package, ask the maintainer for a binary
version of the package.

0 comments on commit 651c669

Please sign in to comment.