View source: R/outputParamTab.R
outputParamTab | R Documentation |
This function takes the model from fitted dySEM
scripts and
creates tables of expected output and/or exports them as .rtf
s.
outputParamTab(
dvn,
model = NULL,
fit,
tabletype = NULL,
gtTab = FALSE,
writeTo = NULL,
fileName = NULL
)
dvn |
Input dvn list from |
model |
A character input specifying type of model to output: "cfa", "bidyc", "apim", "mim", "cfm", or "bidys". |
fit |
input object from fitted |
tabletype |
A character input of what type of table(s) is(are) desired. Options are "measurement" (i.e., loadings, intercepts, etc.), "structural" (i.e., latent slopes, such as actor/partner effects, k parameters), or "both" (i.e., both measurement and structural tables). |
gtTab |
A logical input indicating whether to generate the table(s) in |
writeTo |
A character string specifying a directory path to where the |
fileName |
A character string specifying a desired base name for the output |
If gtTab = TRUE
and writeTo
is specified, then output will simultaneously be saved as a .rtf
file to the user's specified directory.
If output file(s) is(are) successfully saved, a confirmation message will be printed to the console.
If a file with the same name already exists in the user's chosen directory, it will be overwritten.
A tibble::tibble()
if gtTab = FALSE
(default), or gt::gt()
object if gtTab = TRUE
, of specified model parameter estimates and corresponding statistical tests.
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)
outputParamTab(dvnx, model = "cfa", sat.config.mod, tabletype = "measurement",
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)
outputParamTab(dvnxy, model = "cfa", sat.config.mod, tabletype = "measurement",
writeTo = tempdir(), fileName = "APIM_indist")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.