help realcomImpute

Title

realcomImpute Export data to Realcom-Impute

Syntax

realcomImpute varlist using filename , options

Main
* numresponses(num) number of response variables (variables to be imputed) in varlist

* cons(consvar) variable containing constant

* level2id(level2idvar) variable level 2 identifiers

level1wgt(level1wgtvar) variable containing level 1 weights

level2wgt(level2wgtvar) variable containing level 2 weights

+ replace overwrite existing filename

* denotes required option

If filename is specified without an extension, .txt is assumed.

If your filename contains embedded spaces, remember to enclose it in double quotes.

An element of varlist for realcomImpute which is a response takes one of three forms:
varname, m.varname, or o.varname. Details are given in Remarks

Description

realcomImpute exports data to a file that can be read by the Realcom Impute
package, which can perform multiple imputation of missing
values in multi-level datasets - for more details visit the Realcom Impute website
at www.cmm.bristol.ac.uk/research/Realcom/imputation.shtml.

Options

numresponses(num) specifies how many of the variables in varlist are to be responses in the imputation model (variables to be imputed).
The first numresponses(num) variables in varlist are assumed to be the responses. This option must be specified.

cons(consvar) specifies the name of a variable which contains a constant (i.e. all observations set to 1). This option is required.

level2id(level2idvar) specifies the name of the variable which contains the level 2 identifier. This option is required.
The data should be sorted by this variable - if it is not, the command will give an error.
If you wish to perform single-level imputation, specify some variable
for the level 2 id, and then in Realcom, click the button labelled 'Clear level-2 identifier'.

level1wgt(level1wgtvar) specifies the name of the variable containing level 1 weights. This is optional.

level2wgt(level2wgtvar) specifies the name of the variable containing level 2 weights. This is optional.

Remarks

realcomImpute exports data to a file that can be read by the Realcom Impute package, which can perform multiple imputation of missing
values in multi-level datasets.

The varlist should contain all the variables you want to export, with responses (variables that you want to impute) followed by
explanatory/auxiliary variables (which should have no missing values). The command assumes that the first numresponses(num)
variables are responses (variables to be imputed), with the remainder explanatory variables in the imputation model. Level 1 response variables
must precede level 2 response variables. Note that which variables are responses/explanatory variables in the imputation model depends on which variables
have missing values, and not which will be responses/explanatory variables in your final model of interest.

Those elements of varlist which are responses (variables to be imputed) take one of three forms:
varname, m.varname, or o.varname. m.varname denotes that the variable is unordered categorical,
o.varname that it is ordered categorical, and varname that it is continuous.
Binary responses can be entered either using m.varname or o.varname. Only variables which are responses (i.e. to be imputed)
may have a prefix specified. Alternatively, one can use varname to enter all response variables, and then edit
the response types in the Realcom Impute program.

For categorical variables which have no missing values, and which will serve as explanatory variables in the imputation model, you must generate
appropriate dummy variables for the different levels and pass these dummy variables to realcomImpute.

The command creates a file of the listed variables which can be
read into the Realcom Impute package. After creating multiple imputations using Realcom
Impute, the imputations can be loaded back into Stata using the realcomImputeLoad command.

Examples

. realcomImpute nlitpre m.fsmn nlitpost using temp.txt, numresponses(2) cons(cons) level2id(school) replace

Author

Jonathan Bartlett
jwb133@googlemail.com
www.thestatsgeek.com
www.missingdata.org.uk

Also see

realcomImputeLoad