rpm {rpm} | R Documentation |
Fit a Revealed Preference Matchings Model
Description
rpm
estimates the parameters of a revealed preference model
for men and women of certain
characteristics (or shared characteristics) of people of the opposite sex.
The model assumes a one-to-one stable matching using an observed set of
matchings and a set of (possibly dyadic) covariates to
estimate the parameters for
linear equations of utilities.
It does this using an large-population likelihood based on ideas from Dagsvik (2000), Menzel (2015) and Goyal et al (2023).
Usage
rpm(
formula,
Xdata,
Zdata,
Xid = NULL,
Zid = NULL,
pair_id = NULL,
X_w = NULL,
Z_w = NULL,
pair_w = NULL,
sampled = NULL,
sampling_design = "stock-flow",
fixed.margins = NULL,
control = control.rpm(),
verbose = FALSE
)
Arguments
formula |
formula; an |
Xdata |
data.frame for women. Each row is a woman, each column is a variable on that women
or her partnerships. It must contain the women's ID variable (see |
Zdata |
data.frame for men. Each row is a man, each column is a variable on that men
It must contain the men's ID variable (see |
Xid |
string The name of the variable in |
Zid |
string The name of the variable in |
pair_id |
string The name of the variable in |
X_w |
string The name of the variable in |
Z_w |
string The name of the variable in |
pair_w |
string The name of the variable in |
sampled |
string The name of the logical variable in |
sampling_design |
string; The name of the sampling protocol used to select the survey data. Valid values are
|
fixed.margins |
list If not NULL the numbers of men and women (i.e, in |
control |
A list of control parameters for algorithm tuning. Constructed using
|
verbose |
logical; if this is |
Details
The pairings are determined by the pair_id
variable in Xdata
.
If that variable is NA then the women is
assumed to be single. If men are listed in Zdata
and are not partnered then they are assumed single.
Weights are specified by three optional variables in Xdata
.
- X_w
: This is character string of the name of the weight variable for women. The sum of the weights should be the number of women in the population.
- Z_w
: This is character string of the name of the weight variable for men. The sum of the weights should be the number of men in the population.
- pair_w
: This is character string of the name of the weight variable for pairs.
Value
rpm
returns an object of class rpm.object
that is a list consisting of the following elements:
coef |
The maximum psuedo-likelihood estimate of |
coefficients |
The bias-corrected bootstrap estimate of |
loglik |
The value of the maximized log-likelihood. |
exitflag |
integer value with the status of the optimization (4 is success as
|
call |
the call that was made to |
x0 |
vector with starting values for the optimization. |
message |
more informative message with the status of the optimization. |
iterations |
number of iterations that were executed. |
objective |
value if the objective function in the solution. |
solution |
optimal value of the controls. |
version |
version of NLopt that was used. |
covar |
Approximate covariance matrix of the estimates. |
eq |
Values from the equality constraints. Larger values indicate non-convergence. |
sample |
A matrix with the number of rows the MCMC sample size and the number of rows the number of parameters. |
References
Goyal, Shuchi; Handcock, Mark S.; Jackson, Heide M.; Rendall, Michael S. and Yeung, Fiona C. (2023). A Practical Revealed Preference Model for Separating Preferences and Availability Effects in Marriage Formation, Journal of the Royal Statistical Society, A. doi:10.1093/jrsssa/qnad031
Dagsvik, John K. (2000) Aggregation in Matching Markets International Economic Review,, Vol. 41, 27-57. JSTOR: https://www.jstor.org/stable/2648822, doi:10.1111/1468-2354.00054
Menzel, Konrad (2015). Large Matching Markets as Two-Sided Demand Systems Econometrica, Vol. 83, No. 3 (May, 2015), 897-941. doi:10.3982/ECTA12299
See Also
control.rpm, summary.rpm, print.rpm
Examples
library(rpm)
data(fauxmatching)
fit <- rpm(~match("edu") + WtoM_diff("edu",3),
Xdata=fauxmatching$Xdata, Zdata=fauxmatching$Zdata,
X_w="X_w", Z_w="Z_w",
pair_w="pair_w", pair_id="pair_id", Xid="pid", Zid="pid",
sampled="sampled",sampling_design="stock-flow")
summary(fit)