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

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

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).

verbose

.

Value

stabsim2 returns a list with the following items.

OUT

SEL

SELc

SELs

Examples

## 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), verbose=FALSE, colleges = "c1", students = "s1", outcome = ~ c1:s1 + eta + nu, selection = ~ -1 + c1:s1 + eta )
#> Generating data for 2 matching markets...
head(xdata$OUT)
#> m.id y (Intercept) eta nu c1:s1 c1 #> 1 1 2.6738032 1 0.7013559 0.77996512 0.19248215 -0.3963161 #> 2 1 0.6526449 1 -0.2179749 -0.02854676 -0.10083344 -0.3963161 #> 3 1 1.8835812 1 0.1533731 0.58461375 0.14559431 -0.1627601 #> 4 1 2.5210472 1 1.2538149 0.21594157 0.05129068 -0.1627601 #> 5 1 1.5157940 1 0.8951257 -0.33320738 -0.04612428 -0.1627601 #> 6 1 0.9145091 1 0.8781335 -1.01857538 0.05495101 1.1021732 #> s1 c.id s.id #> 1 -0.48567831 1 6 #> 2 0.25442680 1 9 #> 3 -0.89453338 2 5 #> 4 -0.31513060 2 7 #> 5 0.28338821 2 10 #> 6 0.04985696 3 1
head(xdata$SEL)
#> m.id V eta c1:s1 c1 s1 c.id s.id D #> 1 1 0.8938380 0.7013559 0.19248215 -0.3963161 -0.48567831 1 6 1 #> 2 1 -0.3188084 -0.2179749 -0.10083344 -0.3963161 0.25442680 1 9 1 #> 3 1 0.2989674 0.1533731 0.14559431 -0.1627601 -0.89453338 2 5 1 #> 4 1 1.3051056 1.2538149 0.05129068 -0.1627601 -0.31513060 2 7 1 #> 5 1 0.8490014 0.8951257 -0.04612428 -0.1627601 0.28338821 2 10 1 #> 6 1 0.9330845 0.8781335 0.05495101 1.1021732 0.04985696 3 1 1