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)
|
Loading required package: OpenMx
To take full advantage of multiple cores, use:
mxOption(NULL, 'Number of Threads', parallel::detectCores()) #now
Sys.setenv(OMP_NUM_THREADS=parallel::detectCores()) #before library(OpenMx)
This is lavaan 0.6-3
lavaan is BETA software! Please report any bugs.
Attaching package: 'lavaan'
The following object is masked from 'package:OpenMx':
vech
Estimating initial lvnet model
sh: 1: wc: Permission denied
sh: 1: cannot create /dev/null: Permission denied
|
| | 0%
|
|======================= | 33%
|
|=============================================== | 67%
|
|======================================================================| 100%
Changing 1 edge
|
| | 0%
|
|======================= | 33%
|
|=============================================== | 67%
|
|======================================================================| 100%
lvnet estimation completed.:
- Chi-square (25) = 86.31, p = 0
- RMSEA = 0.09 (95% CI: 0.07 - 0.11)
Use summary(object) to inspect more fitmeasures and parameter estimates (see ?summary.lvnet)
Use plot(object) to plot estimated networks and factor structures (see ?plot.lvnet)
Use lvnetCompare(object1, object2) to compare lvnet models (see ?lvnetCompare)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.