if (FALSE) {
#----------------------------------------------------------------------------
# Example 1: Write data, specify input, and run input
# Write Mplus Data File
write.mplus(ex3_1, file = "ex3_1.dat")
# Specify Mplus input, specify NAMES option
input1 <- '
DATA: FILE IS ex3_1.dat;
VARIABLE: NAMES ARE y1 x1 x3;
MODEL: y1 ON x1 x3;
OUTPUT: SAMPSTAT;
'
# Run Mplus input
mplus(input1, file = "ex3_1.inp")
#----------------------------------------------------------------------------
# Example 2: Alternative specification using the data argument
# Specify Mplus input, leave out the NAMES option
input2 <- '
DATA: FILE IS ex3_1.dat;
MODEL: y1 ON x1 x3;
OUTPUT: SAMPSTAT;
'
# Run Mplus input, specify the data argument
mplus(input2, file = "ex3_1.inp", data = ex3_1)
}
Run the code above in your browser using DataLab