mplus.update {misty} | R Documentation |
Mplus Input Updating
Description
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.
Usage
mplus.update(x, update, file = "Mplus_Input_Update.inp",
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)
Arguments
x |
|
update |
a character vector 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 |
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 specifiying Mplus input command sections
included in the output (see 'Details' in the |
result |
a character vector specifiying Mplus result sections included
in the output (see 'Details' in the |
exclude |
a character vector specifiying 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 |
Details
- The
...
Specification The
...
Specification can be used to update specific options in theVARIABLE
andANALYSIS
section, while keeping all other options in themisty.object
of typemplus
specified in the argumentx
. Note that the...
specification is only available for theVARIABLE
andANALYSIS
section.- The
---;
Specification can be used to remove entire sections (e.g.,
OUTPUT: ---;
) or options within theVARIABLE:
andANALYSIS:
section (e.g.,ANALYSIS: ESTIMATOR IS ---;
) from the Mplus input.- Comments in the Mplus Input
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
andANALYSIS
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 it is recommended to remove all comments in the
VARIABLE
andVARIABLE
section when the function crashes.
Value
Returns an object of class misty.object
, which is a list with following
entries:
call |
function call |
type |
type of analysis |
x |
a character vector containing the Mplus input text |
args |
specification of function arguments |
input |
list with input command sections |
write |
write command sections |
result |
list with input command sections ( |
Author(s)
Takuya Yanagida
References
Muthen, L. K., & Muthen, B. O. (1998-2017). Mplus User's Guide (8th ed.). Muthen & Muthen.
See Also
read.mplus
, write.mplus
, mplus.print
,
mplus
, mplus.run
, mplus.lca
Examples
## 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(mod1, 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(mod2, update2, file = "ex3_1_update2.inp")
#----------------------------------------------------------------------------
# Example 3: Remove OUTPUT section
Remove OUTPUT section
update3 <- '
OUTPUT: ---;
'
# Run updated Mplus input
mod3 <- mplus.update(mod3, update3, file = "ex3_1_update3.inp")
## End(Not run)