outputModel | R Documentation |
This function takes the model from fitted dySEM() scripts and exports table(s) and/or a path diagram figure of expected output.
outputModel(
dvn,
model = NULL,
fit,
table = TRUE,
tabletype = NULL,
figure = TRUE,
figtype = NULL,
writeTo = NULL,
fileName = NULL
)
dvn |
input dvn list from scrapeVarCross |
model |
character input specifying type of model to output (e.g., "cfa", "apim", "cfm") |
fit |
input object from fitted lavaan model |
table |
logical input of whether table output is desired. Default is TRUE |
tabletype |
character input of what type of table(s) is(are) desired. options are "measurement" (i.e,, loadings, intercepts,), "structural" (i.e., latent slopes, such as actor/partner effects, k parameters), or "both" (i.e., both measurement and structural tables) |
figure |
logical input of whether figure output is desired. Default is TRUE |
figtype |
character input of what type of figure is desired |
writeTo |
A character string specifying a directory path to where the file(s) should be saved. If set to “.”, the file(s) will be written to the current working directory. The default is NULL (which will throw an error), and examples use a temporary directory created by tempdir(). |
fileName |
A character string specifying a desired base name for the output file(s).
If a |
If a file with the same name already exists in the user's chosen directory, it will be overwritten.
Ignore console (prints unnecessary semPlot::semPaths details). More importantly, prints word files for the table(s) and/or figure, outputted to the users working directory
dvnx <- scrapeVarCross(dat = commitmentQ, x_order = "spi", x_stem = "sat.g", x_delim1 = ".",
x_delim2="_", distinguish_1="1", distinguish_2="2")
sat.config.script <- scriptCor(dvnx, lvname = "Sat", constr_dy_meas = "none",
constr_dy_struct = "none")
sat.config.mod <- lavaan::cfa(sat.config.script, data = commitmentQ, std.lv = FALSE,
auto.fix.first= FALSE, meanstructure = TRUE)
outputModel(dvnx, model = "cfa", fit = sat.config.mod, table = TRUE,
tabletype = "measurement", figure = "TRUE", figtype = "standardized",
writeTo = tempdir(), fileName = "dCFA_configural")
dvnxy <- scrapeVarCross(dat = commitmentQ, x_order = "spi", x_stem = "sat.g", x_delim1 = ".",
x_delim2="_", distinguish_1="1", distinguish_2="2",
y_order="spi", y_stem="com", y_delim1 = ".", y_delim2="_")
apim.indist.script <- scriptAPIM(dvnxy, lvxname = "Sat", lvyname = "Com", est_k = TRUE)
apim.indist.mod <- lavaan::cfa(apim.indist.script, data = commitmentQ, std.lv = FALSE,
auto.fix.first= FALSE, meanstructure = TRUE)
outputModel(dvnxy, model = "apim", fit = apim.indist.mod, table = TRUE,
tabletype = "measurement", figure = "TRUE", figtype = "standardized",
writeTo = tempdir(), fileName = "APIM_indist")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.