MatchIt

R package MatchIt

https://github.com/kosukeimai/matchit

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 11 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    13 of 22 committers (59.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.0%) to scientific vocabulary

Keywords from Contributors

latex
Last synced: 6 months ago · JSON representation

Repository

R package MatchIt

Basic Info
  • Host: GitHub
  • Owner: kosukeimai
  • Language: R
  • Default Branch: master
  • Size: 66.6 MB
Statistics
  • Stars: 229
  • Watchers: 6
  • Forks: 46
  • Open Issues: 6
  • Releases: 3
Created about 9 years ago · Last pushed 9 months ago
Metadata Files
Readme Changelog

README.Rmd

---
output: github_document
---



```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = FALSE,
  warning = FALSE,
  message = FALSE,
  tidy = FALSE,
  fig.align='center',
  comment = "#>",
  fig.path = "man/figures/README-",
  R.options = list(width = 200)
)
```
# MatchIt: Nonparametric Preprocessing for Parametric Causal Inference 

[![CRAN_Status_Badge](https://img.shields.io/cran/v/MatchIt?color=952100)](https://cran.r-project.org/package=MatchIt) [![CRAN_Downloads_Badge](https://cranlogs.r-pkg.org/badges/MatchIt?color=952100)](https://cran.r-project.org/package=MatchIt)
------
### Overview

`MatchIt` provides a simple and straightforward interface to various methods of matching for covariate balance in observational studies. Matching is one way to reduce confounding and model dependence when estimating treatment effects. Several matching methods are available, including nearest neighbor matching, optimal pair matching, optimal full matching, generalized full matching, genetic matching, exact matching, coarsened exact matching, cardinality matching, and subclassification, some of which rely on functions from other R packages. A variety of methods to estimate propensity scores for propensity score matching are included. Below is an example of the use of `MatchIt` to perform Mahalanobis distance matching with replacement and assess balance:

```{r}
library("MatchIt")
data("lalonde", package = "MatchIt")

# 1:1 nearest neighbor matching with replacement on 
# the Mahalanobis distance
m.out <- matchit(treat ~ age + educ + race + married + 
                   nodegree + re74 + re75, 
                 data = lalonde, distance = "mahalanobis",
                 replace = TRUE)
```

Printing the `MatchIt` object provides details of the kind of matching performed. 

```{r}
m.out
```

We can check covariate balance for the original and matched samples using `summary()`:

```{r}
#Checking balance before and after matching:
summary(m.out)
```

At the top is balance for the original sample. Below that is balance in the matched sample. Smaller values for the balance statistics indicate better balance. (In this case, fairly good balance was achieved, but other matching methods should be tried). We can plot the standardized mean differences in a Love plot for a clean, visual display of balance across the sample:

```{r, fig.alt ="Love plot of balance before and after matching."}
#Plot balance
plot(summary(m.out))
```

Although much has been written about matching theory, most of the theory relied upon in `MatchIt` is described well in [Ho, Imai, King, and Stuart (2007)](https//:doi.org/10.1093/pan/mpl013), [Stuart (2010)](https://doi.org/10.1214/09-STS313), and [Greifer and Stuart (2021)](https://doi.org/10.1093/epirev/mxab003). The *Journal of Statistical Software* article for `MatchIt` can be accessed [here](https://doi.org/10.18637/jss.v042.i08), though note that some options have changed, so the `MatchIt` reference pages and included vignettes should be used for understanding the functions and methods available. Further references for individual methods are present in their respective help pages. The `MatchIt` [website](https://kosukeimai.github.io/MatchIt/) provides access to vignettes and documentation files.

### Citing `MatchIt`

Please cite `MatchIt` when using it for analysis presented in publications, which you can do by citing the *Journal of Statistical Software* article below:

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("pak") #If not yet installed

pak::pkg_install("ngreifer/MatchIt")
```

This will require R to compile C++ code, which might require additional software to 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.

### Questions and Bug Reports

If you have questions about `MatchIt` or want to submit a bug report, please do so using the GitHub [issues page](https://github.com/kosukeimai/MatchIt/issues) for the package. Suggestions for new features and kind words of support are encouraged as well. Remember this software is free and developed by volunteers.

Owner

  • Name: Kosuke Imai
  • Login: kosukeimai
  • Kind: user
  • Location: Cambridge MA
  • Company: Harvard University

GitHub Events

Total
  • Issues event: 42
  • Watch event: 21
  • Issue comment event: 34
  • Push event: 12
  • Pull request event: 14
  • Fork event: 5
Last Year
  • Issues event: 42
  • Watch event: 21
  • Issue comment event: 34
  • Push event: 12
  • Pull request event: 14
  • Fork event: 5

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 1,864
  • Total Committers: 22
  • Avg Commits per committer: 84.727
  • Development Distribution Score (DDS): 0.66
Past Year
  • Commits: 78
  • Committers: 2
  • Avg Commits per committer: 39.0
  • Development Distribution Score (DDS): 0.09
Top Committers
Name Email Commits
Noah Greifer n****r@g****m 633
Kosuke Imai k****i@P****u 474
Gary King k****g@h****u 254
Elizabeth Stuart e****t@j****u 215
Daniel En-Wenn Ho d****o@g****m 197
Kosuke Imai k****i@p****u 25
Alex Whitworth w****x@g****m 14
Matt Owen m****n@i****u 9
iagogv3 4****3 7
Stolz s****z@w****u 6
dirgau d****u@c****u 6
Erik Ray e****y@h****u 5
Richard Brandon r****n@i****u 5
cfhammill c****l@g****m 3
Kosuke Imai I****i@H****u 3
HJ08003 h****j@p****u 2
Justin Bedo cu@c****g 1
Olivia Lau o****u@p****u 1
Kosuke Imai k****i@p****u 1
Michael Chirico c****m@g****m 1
jjchern j****n@g****m 1
olivroy 5****y 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 122
  • Total pull requests: 46
  • Average time to close issues: 5 months
  • Average time to close pull requests: 5 days
  • Total issue authors: 96
  • Total pull request authors: 7
  • Average comments per issue: 3.09
  • Average comments per pull request: 0.17
  • Merged pull requests: 41
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 19
  • Pull requests: 14
  • Average time to close issues: 22 days
  • Average time to close pull requests: 1 day
  • Issue authors: 15
  • Pull request authors: 2
  • Average comments per issue: 2.11
  • Average comments per pull request: 0.07
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • buhtz (6)
  • raffaem (6)
  • yceny (3)
  • peisenha (3)
  • Maxi54321 (3)
  • giuliogcantone (3)
  • ilovemane (2)
  • omerdar (2)
  • AlinaVod (2)
  • 49470952 (2)
  • jiweihe1223 (2)
  • ginnydang (2)
  • Shicheng-Guo (2)
  • akiki2601 (1)
  • jimmycloud (1)
Pull Request Authors
  • ngreifer (39)
  • MichaelChirico (2)
  • jbedo (1)
  • gui-salome (1)
  • iagogv3 (1)
  • NikNakk (1)
Top Labels
Issue Labels
enhancement (3) bug (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 17,675 last-month
  • Total docker downloads: 43,531
  • Total dependent packages: 20
    (may contain duplicates)
  • Total dependent repositories: 42
    (may contain duplicates)
  • Total versions: 58
  • Total maintainers: 1
cran.r-project.org: MatchIt

Nonparametric Preprocessing for Parametric Causal Inference

  • Versions: 54
  • Dependent Packages: 20
  • Dependent Repositories: 42
  • Downloads: 17,675 Last month
  • Docker Downloads: 43,531
Rankings
Forks count: 1.8%
Stargazers count: 2.3%
Downloads: 3.0%
Dependent packages count: 3.8%
Dependent repos count: 4.0%
Average: 6.6%
Docker downloads count: 24.8%
Maintainers (1)
Last synced: 7 months ago
conda-forge.org: r-matchit
  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Forks count: 26.1%
Stargazers count: 28.0%
Dependent repos count: 34.0%
Average: 34.8%
Dependent packages count: 51.2%
Last synced: 7 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.1.0 depends
  • Rcpp >= 1.0.7 imports
  • backports >= 1.1.9 imports
  • CBPS >= 0.17 suggests
  • Matching * suggests
  • RcppProgress >= 0.4.2 suggests
  • Rglpk * suggests
  • Rsymphony * suggests
  • boot * suggests
  • cobalt >= 4.2.3 suggests
  • dbarts * suggests
  • gbm >= 2.1.7 suggests
  • glmnet >= 4.0 suggests
  • gurobi * suggests
  • knitr * suggests
  • lmtest * suggests
  • mgcv * suggests
  • nnet * suggests
  • optmatch >= 0.10.0 suggests
  • randomForest >= 4.7 suggests
  • rgenoud * suggests
  • rmarkdown * suggests
  • rpart * suggests
  • sandwich >= 2.5 suggests
  • survival * suggests
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite