I'm trying to use parcel.allocate (semTools)
My Reprex:
'model' and 'item.syntax' arguments specify different factors.'model' specifies: AG, DF, GR, hO1, hO2, hO3, KL, LW, TX
'item.syntax' specifies: AG, DF, GR, KL, LW, TX
Sorry for my mistake and thank you for your help! To provide a reproducible example, I added a higher order factor to the example from the function (see below). I also tried to add the factors to the item.syntax (as I understood it), but it still does not work. The error message says:
lavaan->lav_lavaan_step01_ovnames_checklv():
some latent variable names collide with observed variable names: f1 f2
What did I do wrong?
Thank you for your advice using the data sets; that will help (and I will use it if necessary), but I would rather try to use the more comfortable function ParcelAllocation.
library(lavaan)
library(semTools)
## Specify the item-level model (if NO parcels were created)
item.syntax <- c(paste0("f1 =~ f1item", 1:9),
paste0("f2 =~ f2item", 1:9),
paste0("f3 =~ f1"),
paste0("f3 =~ f2"))
cat(item.syntax, sep = "\n")
## Below, we reduce the size of this same model by
## applying different parceling schemes
## 3-indicator parcels
mod.parcels <- '
f1 =~ par1 + par2 + par3
f2 =~ par4 + par5 + par6
f3 =~ f1 + f2
'
## names of parcels
(parcel.names <- paste0("par", 1:6))
## Not run:
## override default random-number generator to use parallel options
RNGkind("L'Ecuyer-CMRG")
parcelAllocation(mod.parcels, data = simParcel, nAlloc = 100,
parcel.names = parcel.names, item.syntax = item.syntax,
std.lv = TRUE, # any addition lavaan arguments
parallel = "snow") # parallel options
What did I do wrong? Error says: error: lavaan->lav_lavaan_step01_ovnames_checklv(): some latent variable names collide with observed variable names: f1 f2
Thank you for the alternative though; that might help to fit my model to each randomly drawn parcel set...