Learn R Programming

matchingMarkets (version 0.3-1)

stabsim2: Simulate data for two-sided matching markets

Description

Simulate data for two-sided matching markets. In the simulation for the Sorensen (2007) with one selection equation (selection), an equal sharing rule of $\lambda = 0.5$ is used.

Usage

stabsim2(m, nStudents, nColleges = length(nSlots), nSlots, colleges, students, outcome, selection, binary = FALSE, seed = 123)

Arguments

m
integer indicating the number of markets to be simulated.
nStudents
integer indicating the number of students per market.
nColleges
integer indicating the number of colleges per market.
nSlots
vector of length nColleges indicating the number of places at each college, i.e. the college's quota.
colleges
character vector of variable names for college characteristics. These variables carry the same value for any college.
students
character vector of variable names for student characteristics. These variables carry the same value for any student.
outcome
formula for match outcomes.
selection
formula for match valuations.
binary
logical: if TRUE outcome variable is binary; if FALSE outcome variable is continuous.
seed
integer setting the state for random number generation. Defaults to set.seed(123).

Value

stabsim2 returns a list with the following items. returns a list with the following items.

Examples

Run this code
## Not run: 
# ## Simulate two-sided matching data for 2 markets (m=2) with 10 students
# ## (nStudents=10) per market and 3 colleges (nColleges=3) with quotas of
# ## 2, 3, and 5 students, respectively.
# 
# xdata <- stabsim2(m=2, nStudents=10, nSlots=c(2,3,5), 
#   colleges = "c1",
#   students = "s1",
#   outcome = ~ c1:s1 + eta + nu,
#   selection = ~ -1 + c1:s1 + eta
# )
# head(xdata$OUT)
# head(xdata$SEL)
# ## End(Not run)

Run the code above in your browser using DataLab