mplus.update | R Documentation |
This function updates specific input command sections of a misty.object
of type mplus
to create an updated Mplus input file, run the updated
input file by using the mplus.run()
function, and print the updated Mplus
output file by using the mplus.print()
function.
mplus.update(x, update, file = "Mplus_Input_Update.inp", comment = FALSE,
replace.inp = TRUE, mplus.run = TRUE,
show.out = FALSE, replace.out = c("always", "never", "modified"),
print = c("all", "input", "result"),
input = c("all", "default", "data", "variable", "define",
"analysis", "model", "montecarlo", "mod.pop", "mod.cov",
"mod.miss", "message"),
result = c("all", "default", "summary.analysis.short",
"summary.data.short", "random.starts", "summary.fit",
"mod.est", "fit", "class.count", "classif",
"mod.result", "total.indirect"),
exclude = NULL, variable = FALSE, not.input = TRUE, not.result = TRUE,
write = NULL, append = TRUE, check = TRUE, output = TRUE)
x |
|
update |
a character string containing the updated input command sections. |
file |
a character string indicating the name of the updated Mplus
input file with or without the file extension |
comment |
logical: if |
replace.inp |
logical: if |
mplus.run |
logical: if |
show.out |
logical: if |
replace.out |
a character string for specifying three settings:
|
print |
a character vector indicating which results to show, i.e.
|
input |
a character vector specifying Mplus input command sections
included in the output (see 'Details' in the |
result |
a character vector specifying Mplus result sections included
in the output (see 'Details' in the |
exclude |
a character vector specifying Mplus input command or result
sections excluded from the output (see 'Details' in the
|
variable |
logical: if |
not.input |
logical: if |
not.result |
logical: if |
write |
a character string naming a file for writing the output into
a text file with file extension |
append |
logical: if |
check |
logical: if |
output |
logical: if |
The function is used to update following Mplus input sections:
TITLE
DATA
DATA IMPUTATION
DATA WIDETOLONG
DATA LONGTOWIDE
DATA TWOPARTE
DATA MISSING
DATA SURVIVAL
DATA COHORT
VARIABLE
DEFINE
ANALYSIS
MODEL
MODEL INDIRECT
MODEL CONSTRAINT
MODEL TEST
MODEL PRIORS
MODEL MONTECARLO
MODEL POPULATION
MODEL COVERAGE
MODEL MISSING
OUTPUT
SAVEDATA
PLOT
...;
SpecificationThe ...;
Specification
is used to update specific options in the VARIABLE
and ANALYSIS
section, while keeping all other options in the misty.object
of type
mplus
specified in the argument x
. The ...;
specification
is only available for the VARIABLE
and ANALYSIS
section. Note
that ...;
including the semicolon ;
needs to be specified,
i.e., ...
without the semicolon ;
will result in an error message.
---;
SpecificationThe ---;
specification is
used to remove entire sections (e.g., OUTPUT: ---;
) or options within the
VARIABLE:
and ANALYSIS:
section (e.g., ANALYSIS: ESTIMATOR IS ---;
)
from the Mplus input. Note that ---;
including the semicolon ;
needs to be specified, i.e., ---
without the semicolon ;
will
result in an error message.
Comments in the Mplus Input can cause
problems when following keywords in uppercase, lower case, or mixed upper and lower
case letters are involved in the comments of the VARIABLE
and ANALYSIS
section:
VARIABLE
section: "NAMES", "USEOBSERVATIONS",
"USEVARIABLES", "MISSING", "CENSORED", "CATEGORICAL", "NOMINAL", "COUNT",
"DSURVIVAL", "GROUPING", "IDVARIABLE", "FREQWEIGHT", "TSCORES", "AUXILIARY",
"CONSTRAINT", "PATTERN", "STRATIFICATION", "CLUSTER", "WEIGHT", "WTSCALE",
"BWEIGHT", "B2WEIGHT", "B3WEIGHT", "BWTSCALE", "REPWEIGHTS", "SUBPOPULATION",
"FINITE", "CLASSES", "KNOWNCLASS", "TRAINING", "WITHIN", "BETWEEN", "SURVIVAL",
"TIMECENSORED", "LAGGED"
, or "TINTERVAL"
.
ANALYSIS
section: "TYPE", "ESTIMATOR", "MODEL",
"ALIGNMENT", "DISTRIBUTION", "PARAMETERIZATION", "LINK", "ROTATION",
"ROWSTANDARDIZATION", "PARALLEL", "REPSE", "BASEHAZARD", "CHOLESKY", "ALGORITHM",
"INTEGRATION", "MCSEED", "ADAPTIVE", "INFORMATION", "BOOTSTRAP", "LRTBOOTSTRAP",
"STARTS", "STITERATIONS", "STCONVERGENCE", "STSCALE", "STSEED", "OPTSEED",
"K-1STARTS", "LRTSTARTS", "RSTARTS", "ASTARTS", "H1STARTS", "DIFFTEST",
"MULTIPLIER", "COVERAGE", "ADDFREQUENCY", "ITERATIONS", "SDITERATIONS",
"H1ITERATIONS", "MITERATIONS", "MCITERATIONS", "MUITERATIONS", "RITERATIONS",
"AITERATIONS", "CONVERGENCE", "H1CONVERGENCE", "LOGCRITERION", "RLOGCRITERION",
"MCONVERGENCE", "MCCONVERGENCE", "MUCONVERGENCE", "RCONVERGENCE", "ACONVERGENCE",
"MIXC", "MIXU", "LOGHIGH", "LOGLOW", "UCELLSIZE", "VARIANCE", "SIMPLICITY",
"TOLERANCE", "METRIC", "MATRIX", "POINT", "CHAINS", "BSEED", "STVALUES",
"PREDICTOR", "ALGORITHM", "BCONVERGENCE", "BITERATIONS", "FBITERATIONS",
"THIN", "MDITERATIONS", "KOLMOGOROV", "PRIOR", "INTERACTIVE"
, or "PROCESSORS"
.
Note that comments are removed from the input text by default, i.e., comment = FALSE
.
Returns an object of class misty.object
, which is a list with following
entries:
call |
function call |
type |
type of analysis |
x |
|
args |
specification of function arguments |
input |
list with input command sections |
write |
updated write command sections |
result |
list with input command sections ( |
Takuya Yanagida
Muthen, L. K., & Muthen, B. O. (1998-2017). Mplus User's Guide (8th ed.). Muthen & Muthen.
read.mplus
, write.mplus
, mplus
,
mplus.print
, mplus.plot
, mplus.bayes
,
mplus.run
, mplus.lca
## Not run:
#----------------------------------------------------------------------------
# Example 1: Update VARIABLE and MODEL section
# Write Mplus Data File
write.mplus(ex3_1, file = "ex3_1.dat")
# Specify Mplus input
input <- '
DATA: FILE IS ex3_1.dat;
VARIABLE: NAMES ARE y1 x1 x3;
MODEL: y1 ON x1 x3;
OUTPUT: SAMPSTAT;
'
# Run Mplus input
mod0 <- mplus(input, file = "ex3_1.inp")
# Update VARIABLE and MODEL section
update1 <- '
VARIABLE: ...;
USEVARIABLES ARE y1 x1;
MODEL: y1 ON x1;
'
# Run updated Mplus input
mod1 <- mplus.update(mod0, update1, file = "ex3_1_update1.inp")
#----------------------------------------------------------------------------
# Example 2: Update ANALYSIS section
# Update ANALYSIS section
update2 <- '
ANALYSIS: ESTIMATOR IS MLR;
'
# Run updated Mplus input
mod2 <- mplus.update(mod1, update2, file = "ex3_1_update2.inp")
#----------------------------------------------------------------------------
# Example 3: Remove OUTPUT section
# Remove OUTPUT section
update3 <- '
OUTPUT: ---;
'
# Run updated Mplus input
mod3 <- mplus.update(mod2, update3, file = "ex3_1_update3.inp")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.