R package matchingMarkets
Structural Estimators and Algorithms for the Analysis of Stable Matchings.
Functions
The matchingMarkets
R package comes with two estimators:

stabit
: Implements a Bayes estimator that corrects for sample selection in matching markets when the selection process is a onesided matching game (i.e. group formation). 
stabit2
: Implements the Bayes estimator for a twosided matching game (i.e. the college admissions and stable marriage problems).
and five algorithms that can be used to simulate matching data:

hri
: Constraint model for the hospital/residents problem. Finds all stable matchings in twosided matching markets. Implemented for both the stable marriage problem (onetoone matching) and the hospital/residents problem, also known as college admissions problem (manytoone matching). 
iaa
: Immediate Acceptance Algorithm (a.k.a. Boston mechanism): Firstpreferencefirst algorithm used for school choice in many countries. And GaleShapley Deferred Acceptance Algorithm. 
sri
: Constraint model for the stable roommates problem. Finds all stable matchings in the roommates problem (onesided matching market). 
plp
: Partitioning Linear Programme. Finds stable matchings in the roommates problem (onesided matching market) with transferable utility. 
ttc
: TopTradingCycles Algorithm. Finds stable matchings in the housing market problem.
Functions hri
and sri
are based on Patrick Prosserâ€™s nary constraint encoding model. They allow for incomplete preference lists (some agents find certain agents unacceptable) and unbalanced instances (unequal number of agents on both sides).
Installation
Get started by installing the R software for statistical computing.
To get the latest stable version of the package from CRAN:
install.packages("matchingMarkets")
library(matchingMarkets)
Under Linux, the dependency package gmp
requires that you have GNU MP (> 4.1.4) installed, see https://gmplib.org.
To get the most recent development version from GitHub:
install.packages("devtools")
devtools::install_github("thiloklein/matchingMarkets")
library(matchingMarkets)
or from RForge:
install.packages("matchingMarkets", repos="https://RForge.Rproject.org")
library(matchingMarkets)
Documentation
Package documentation is available at matchingMarkets.org and the vignette is available from the CRAN page. An application of the estimator in function stabit
is in Klein (2015).