*! version 3.0 3 May 2021

help for ky_simStephen P. Jenkins and Fernando Rios-Avila (May 2021)

Simulate data consistent with mixture models of the Kapteyn & Ypma type

Syntax

ky_sim is a utility command for simulating data where the data
generating process is defined by one of 8 variants of a finite mixture
model of earnings and measurement errors of various types. The first four models
were proposed by Kapteyn and Ypma (2007); the second four models are
generalisations of the Kapteyn-Ypma models proposed by Jenkins and
Rios-Avila (2021a, 2021b). We refer here to the general class of models as "KY" models.
The simulated data comprise a set of observations ('workers', i = 1,...,N),
for each of which there are 2 measures of (log) earnings: (a) from a
survey (s_i) and (b) from an administrative record dataset (r_i).

ky_sim simulates the joint distribution of administrative and
survey log earnings using two options.

Option 1. You select the model and supply the parameters

This option allows you to simulate data, based on a fit of a specific
model. You have to specify the desired number of observations (Nobs), and
values for the model parameters. The number of parameters required depends on
which model is selected: see ky_fit for more details.
All parameters are assumed to be constant (i.e. not functions of covariates).

ky_sim,
model(#) nobs(#) [ options]

model(#) The KY model used to simulate the data.

nobs(#) The number of observations in the dataset created
created.

clear Clears the dataset in memory, even if unsaved changes
exist.

seed(#) Set random-number seed to #

parameter_values Parameter values (required)

Depending on the model selected, you have to specify values for the
following parameters:

Means: mean_e(#) mean_n(#) mean_t(#) mean_w(#) mean_v(#)

SDs: sig_e(#) sig_n(#) sig_t(#) sig_w(#) sig_v(#)

Correlations: rho_r(#) rho_s(#) rho_w(#)

Probabilities: pi_s(#) pi_w(#) pi_r(#) pi_v(#)

A real number, local, or global can be used to initialize values for each
parameter.

If you specify a parameter that is not relevant to the model you
selected, it will be ignored. For example, if you choose Model 1 or Model 2,
and specify a value for pi_r(#), it is ignored.

Depending on the simulated model(#), the post-simulation dataset contains
the following variables:

r_var, s_var, l_var: simulated administrative and survey
log(earnings), and a variable identifying observations that are members of
the 'completely labeled' class (class 1).

e_var, n_var, w_var, v_var, t_var: Latent true log(earnings)
and model errors.

pi_si, pi_ri, pi_wi, pi_vi: Binary variable indicating
type of error.

Option 2. The parameters come from a fitted model

ky_sim can also be used as a post-estimation command. In this mode,
ky_sim uses all of the data currently in memory and results
from a previously-fitted model to generate the simulated data.

ky_sim
[,
options]

est_sto(store_name) Uses a previously-fitted model store in
memory under the name "store_name".

est_sav(file_name) Uses a previously-fitted model saved
as a "ster" file named "file_name".

prefix(str) Indicates the prefix to be used to name
the new variables.

seed(#) Set random-number seed to #

replace Overwrites variables if they already exist in the
dataset

When neither est_sto() nor est_sav() is specified, ky_sim
will attempt to simulate data using the last estimates obtained with
ky_fit that resides in memory.

In all cases, the command assumes that all variables used as covariates in
the model exist in the data currently in memory.

Depending on the simulated model(#), the post-simulation dataset
includes following variables:

r_var, s_var, l_var: simulated administrative and survey
log(earnings), and a variable identifying class 1 data.

e_var, n_var, w_var, v_var, t_var: latent true log(earnings)
and model errors.

pi_si, pi_ri, pi_wi, pi_vi: binary variable indicating
type of error.

If the prefix option is used, all the names of variables
created start with "prefix".

Examples

For detailed examples, please see do-file "ky_example.do".

References

Jenkins, S.P. and Rios-Avila, F. (2021a).
Finite mixture models for linked survey and administrative data: estimation and
post-estimation. IZA Discussion Paper, forthcoming.
https://www.iza.org/publications/dp
For submission to The Stata Journal.

Jenkins, S. P. and Rios-Avila, F. (2021b).
Reconciling reports: modelling employment earnings and measurement errors
using linked survey and administrative data.
IZA Discussion Paper, forthcoming. https://www.iza.org/publications/dp

Kapteyn, A. and Ypma, Y.A. (2007) Measurement error and misclassification:
a comparison of survey and administrative data.
Journal of Labor Economics 25 (3): 513-51.
https://www.journals.uchicago.edu/doi/abs/10.1086/513298

Stored results

When using ky_sim to simulate data given exogenous parameters (option 1),
the following results are stored in e().

scalars

e(method_c) Code for fitted model. See model specification.

macros

e(predict) ky_p: program used to implement predict

e(depvar) List of dependent variables

e(estat_cmd) ky_estat: program used to implement
post-estimation statistics estat

e(cmd) ky_fit

matrices

e(b) Vector containing the parameters

e(V) Empty matrix

Authors

Stephen P. Jenkins

Department of Social Policy

London School of Economics and Political Science

Houghton Street, London WC2A 2AE, UK

Email: s.jenkins@lse.ac.uk

Fernando Rios-Avila

Levy Economics Institute of Bard College

Annandale-on-Hudson, NY 12504-5000, USA

Email: friosavi@levy.org