Description Usage Arguments Value Author(s) See Also Examples
Performs stepwise search to optimize the structure of omega_theta, omega_psi, theta or psi. Starts at empty or full structure and iteratively adds or removes edges to optimize the criterion.
1 2 3 4 5 |
data |
The data argument as used in |
matrix |
Character string indicating the matrix to be optimized. Can be |
criterion |
Character string indicating the criterion to be used. |
start |
A character string indicating the structure of the matrix at the start of the algorithm. |
alpha |
The alpha level for chi-square significance testing. |
lambda |
The lambda argument as used in |
sampleSize |
The sample size, only used if |
maxIter |
The maximum number of edges to test. Defaults to M(M-1)/2 |
nCores |
Number of cores to use in parallel estimation. |
maxChange |
Set to higher than one to change multiple edges in each run. Each iteration, maxChange is reset to max(number of changed edges - 1, 1). Can result in instable results when searching |
... |
Arguments sent to |
verbose |
Logical if progress should be printed to the consile. |
file |
An optional character string containing a file name to store temporary results in. |
startValues |
A list containing start values as used in |
An object of class lvnetSearch
, which is a list containing:
best |
The |
modList |
A list containing the chain of fitted models |
niter |
The number of iterations used |
Sacha Epskamp <mail@sachaepskamp.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Load dataset:
library("lavaan")
data(HolzingerSwineford1939)
Data <- HolzingerSwineford1939[,7:15]
# Measurement model:
Lambda <- matrix(0, 9, 3)
Lambda[1:3,1] <- NA
Lambda[4:6,2] <- NA
Lambda[7:9,3] <- NA
# Search best fitting omega_psi:
## Not run:
res <- lvnetSearch(Data, "omega_psi", lambda = Lambda)
res$best
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.