help lcmc

Title

Latent class missing covariate model for continous main response, ordinal covariate with missing values, and informative selection

Basic syntax

lcmc (svar = varlist1) (yvar = varlist2) (mcvvar = varlist3) [if
exp] [in range]

Full syntax

lcmc (svar = varlist1) (yvar = varlist2) (mcvvar = varlist3) [if
exp] [in range] [, rep(#) scale(#) hvector(# # #) method(#)
from(matrixname) cluster(clustvar)
constraints(clist) thresctr hbased trace
evaluate robust iterate(#) mloptions]

The first equation defines the model for the selection dummy, the second equation defines the model for the main continous response, and the third equation definies the model for the missing ordinal covariate (see description).

options

rep(#) Sets the number of random draws that will be used for calculating the simulated likelihood. The default value is 1600.

scale(#) Sets the standard deviation of the error terms uy, ux, and us in equation 4 of Miranda & Rabe-Hesketh (2014). The default
value is 0.2.

hvector(# # # #) Controls aspects of the simulation, all four numbers must be integers. Two random vectors of size N
are needed to perform the simulation of the likelihood. These two vectors are chosen from a random NxQ matrix, Q>=2. The first number
of hvec sets Q while the second and third numbers indicate which columns will be used to simulate the likelihood. Finally, the third
number sets the number of rows -from the top row onwards- to be
discarded from the chosen columns. For instance, rep(500) hvec(2 1 2 100) asks for a 500x2 random matrix, to take the
first and second columns for the simulation of the likelihood and to discard 100 rows. The resulting 400x2 random matrix is
used for simulating the likelihood. The default values are hvec(2 1 2 100).

method(#) Type of random draws to be used for simulating the likelihood. Option 1 indicates that Halton sequences shall be used. Option 2 indicates that a Hammersley set should be used.
Finally, option 3 indicates that pseudouniform random numbers should be used. The default value is 1.

from(matname) Specifies the matrix to be used for the initial values. The matrix may be obtained from a previous
estimation command using e(b). This is useful if the model was first estimated constraining the thresholds to be
cut1<cut2<...<cutg using the thresctr option.

cluster(clustvar) Clustered sandwich estimator of the covariance matrix. This option must be used together with the the habased option.

constraints(clist) Specifies the linear constraints to be applied during estimation. The
default is to perform unconstrained estimation. Constraints are defined using the constraint command; see constraint.

thresctr Causes maximisation to be performed under the constraints cut1<cut2<...<cutg.

hbased Maximisation will be performed using analytical first derivatives and numerical second derivatives.

trace To show details including the parameter estimates at each iteration.

evaluate Causes the program to simply evaluate the log-likelihood for values passed
to it using the from(matrix) option and to calculate the corresponding standard errors.

robust The Eicker-Huber-White (sandwich) estimator of the covariance matrix is reported. This option is only valid when used together with the habased option.

iterate(#) Perform maximum of # iterations; default is iterate(16000).

mloptions Usual ml maximize options.

Description

lcmc fits a latent class model for a missing ordinal covariate, mcv, and a continuous main response, y, by
Simulated Maximum Likelihood. For a proportion of the sample the missing covariate mcv is missing at random due to
survey design because the relevant question was not asked by the survey, while for the remainder of the sample the
relevant question was indeed asked or intended to be asked and the missing covariate is missing due to either
unit or item non-response. There is a selection rule s that determines whether mcv is observed.
For observations with mcv missing at random due to survey design we define s = . because we
do not know if mcv would be observed had the relevant question been asked by the survey. For
observations where the relevant question was asked, mcv is observed when s = 1 and
is missing when s = 0. Informative selection is allowed (i.e. the selection dummy, when not missing, can be a
function of unobservables that are correlated with y and/or mcv).

Important notes

lcmc assumes that the data is in the wide form (one record per individual).

The equation for the selection variable svar always comes first, then the equation for the
main continous response yvar, and finally the equation for the missing ordinal covariate mcvvar.
This order should be always observed. Otherwise the model will not be correctly estimated or it
will produce an error message.

By default the model is fitted by the BHHH method, using analytical first derivatives and an outer product gradient (OPG) approximation of the covariance matrix. The hbased option modifies this default behaviour.

Simulations conducted by the authors show that using less than 1,600 Halton draws delivers slightly
underestimated standard errors and improve with more Halton draws. However, coverage of the confidence intervals
tends to be close to the nominal level even with 800 Halton draws.

Example

. lcmcsimul.dta

/* fit latent class missing covariate model with threshold constraints */

. lcmc (sel = x2 d1 d2 d3) (y = x3 d1 d2 d3) (ordx1 = x4 d1 d2 d3), thresctr

. mat b0=e(b)

/* Fit the latent class missing covariate model with no constraints */

. lcmc (sel = x2 d1 d2 d3) (y = x3 d1 d2 d3) (ordx1 = x4 d1 d2 d3), from(b0)

Obtaining fitted values for the main response after lcmc

After estimation it is possible to get fitted values for the main response for all observations (i.e. for both those with missing and not missing ordinal covariate) using the lcmc_predict command:

lcmc_predict, rep(1600) hvec(2 1 2 100)

the fitted values are returned in a variable called yhat. Standard errors for yhat are also reported on variable seyhat. Finally, posterior probabilities that the missing ordinal covariate, mcv, takes on
categories 1, 2,...,G given covariates, are reported in variables P1, P2,...,PG. These conditional probabilities are only calculated for observations for which mcv is missing.

Authors

Alfonso Miranda (alfonso.miranda@cide.edu) and Sophia Rabe-Hesketh (sophiarh@berkeley.edu).

Conditions of use

lcmc is not an official Stata command and is an implementation of the methods discussed in Miranda and Rabe-Hesketh (2014).
There is no warranty and the authors cannot accept any responsability for the use of this software. The entire risk as to the quality
and performance is with you. Should the work prove defective, you assume the cost of all necessary servicing, repair,
or correction. You may distribute a complete, unmodified copy of this sofware as you received it. No modification or partial
copy is allowed. Software and main paper (JRSSA) should be cited together at all times.

Suggested citation

Please cite as:

Miranda, A. 2013. lcmc: Stata module (Mata) to estimate a latent class missing covariate model for continous main response,
ordinal covariate with missing values, and informative selection. Available at http://ideas.repec.org/e/pmi55.html.

Miranda, A. and Rabe-Hesketh, S. 2014. Missing ordinal covariate with informative selection. Journal of the Royal Statistical Society Series A 177 (1):?-?.

A copy of the paper is available from the author upon request.

Webpage

http://ideas.repec.org/e/pmi55.html