write.mitmlMplus {mitml} | R Documentation |
Write mitml
objects to Mplus format
Description
Saves objects of class mitml
as a series of text files which can be processed by the statistical software Mplus (Muthen & Muthen, 2012).
Usage
write.mitmlMplus(x, filename, suffix = "list", sep = "\t", dec = ".",
na.value = -999)
Arguments
x |
An object of class |
filename |
File base name for the text files containing the imputed data sets, specified without file extension. |
suffix |
File name suffix for the index file. |
sep |
The field separator. |
dec |
The decimal separator. |
na.value |
A numeric value coding the missing data in the resulting data files. |
Details
The Mplus format for multiply imputed data sets comprises a set of text files, each containing one imputed data set, and an index file containing the names of all data files.
During export, factors and character variables are converted to numeric.
To make this more transparent, write.mitmlMplus
produces a log file which contains information about the data set and the factors that have been converted.
In addition, a basic Mplus input file is generated that can be used for setting up subsequent analysis models.
Value
None (invisible NULL
).
Author(s)
Simon Grund
References
Muthen, L. K., & Muthen, B. O. (2012). Mplus User's Guide. Seventh Edition. Los Angeles, CA: Muthen & Muthen.
See Also
panImpute
, jomoImpute
, mitmlComplete
Examples
## Not run:
data(studentratings)
fml <- ReadDis + SES ~ ReadAchiev + (1|ID)
imp <- panImpute(studentratings, formula = fml, n.burn = 1000, n.iter = 100, m = 5)
# write imputation files, index file, and log file
write.mitmlMplus(imp, filename = "imputation", suffix = "list", na.value = -999)
## End(Not run)