View source: R/Tabu_searchprep.R
search.prep | R Documentation |
Given a fitted lavaan model (e.g., CFA), prepares a table that contains parameters that can be fixed/freed as part of a model specification search.
search.prep(fitted.model, loadings = TRUE, fcov = TRUE, errors = FALSE)
fitted.model |
- an object of class "lavaan" that contains the initially fitted model for the search |
loadings |
- a logical value that indicates whether cross-loadings will be part of the search |
fcov |
- a logical value indicating whether factor covariances will be part of the search |
errors |
- a logical value indicating whether error covariances will be part of the search |
A data.frame
with lavaan-formatted parameter values.
Carl F. Falk
Other Tabu Search:
add.param()
,
refit.model()
## Not run:
# load simulation data and select columns used in this example
data(simulated_test_data)
tabuData <- simulated_test_data[, c(1:10)]
# specify an improper model (improper because data is unidimensional)
tabuModel <- "
Ability =~ Item1 + Item2 + Item3 + Item4
FakeAbility =~ Item5 + Item6 + Item7 + Item8
Ability ~ Outcome
FakeAbility ~ 0*Outcome"
# run the initial misspecified model for Tabu
init.model <- lavaan::lavaan(
model = tabuModel, data = tabuData,
auto.var = TRUE, auto.fix.first = FALSE, std.lv = TRUE, auto.cov.lv.x = TRUE
)
# Use search.prep to prepare for the Tabu search
ptab <- search.prep(fitted.model = init.model, loadings = TRUE, fcov = TRUE, errors = FALSE)
# add an additional (mispecified) parameter
additional.param <- "Item1 ~~ 0.5*Item3"
ptab <- add.param(fitted.model = init.model, ptab = ptab, syntax = additional.param)
# Perform Tabu Search
trial <- tabu.sem(init.model = init.model, ptab = ptab, obj = AIC, niter = 2, tabu.size = 5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.