write.mplus | R Documentation |
This function writes a matrix or data frame to a tab-delimited file without variable names, a Mplus input template, and a text file with variable names. Note that only numeric variables are allowed, i.e., non-numeric variables will be removed from the data set. Missing data will be coded as a single numeric value.
write.mplus(x, file = "Mplus_Data.dat", data = TRUE, input = TRUE,
var = FALSE, na = -99, check = TRUE)
x |
a matrix or data frame to be written to a tab-delimited file. |
file |
a character string naming a file with or without the file extension
'.dat', e.g., |
data |
logical: if |
input |
logical: if |
var |
logical: if |
na |
a numeric value or character string representing missing values
( |
check |
logical: if |
Returns a character string indicating the variable names for the Mplus input file.
Takuya Yanagida takuya.yanagida@univie.ac.at
Muthen, L. K., & Muthen, B. O. (1998-2017). Mplus User's Guide (8th ed.). Muthen & Muthen.
read.mplus
, mplus.run
, write.sav
,
write.xlsx
, write.dta
## Not run:
# Example 1: Write Mplus Data File and a Mplus input template
write.mplus(mtcars)
# Example 2: Write Mplus Data File "mtcars.dat" and a Mplus input template "mtcars_INPUT.inp",
# missing values coded with -999,
# write variable names in a text file called "mtcars_VARNAMES.inp"
write.mplus(mtcars, file = "mtcars.dat", var = TRUE, na = -999)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.