
Convert lavaan fitted object to fix the psychonetrics model's loadings
Source:R/network_helpers.R
lav_to_pnet_fix.RdConvert lavaan fitted object to fix the psychonetrics model's loadings
Arguments
- fit
A lavaan fitted object
- lnm.model
Optional. UNfitted psychonetrics model object. Must have the same factor structure as the lavaan fitted object. If not provided, a new psychonetrics model will be created based on the lavaan model's structure.
- ...
Additional arguments passed to the function `lnm` of `psychonetrics` package.
Examples
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
fit <- cfa(HS.model, data=HolzingerSwineford1939, group = "school")
#> Error in cfa(HS.model, data = HolzingerSwineford1939, group = "school"): could not find function "cfa"
lnm_mod_fixed = lav_to_pnet_fix(fit, data = HolzingerSwineford1939, groupvar = "school")
#> Error in lav_to_pnet_fix(fit, data = HolzingerSwineford1939, groupvar = "school"): Package 'psychonetrics' is required for this function. Please install it first.
lnm_mod_fixed %>% runmodel %>% parameters
#> Error in parameters(.): could not find function "parameters"