I want to do a structural equation model with several latent variables with item parcels. Some parcels shall be created randomly. I am currently struggling with the "parcelAllocation" function (semTools) and hope that someone can help me out!
My main dataset is called "Mydata". I have three latent variables (MAAS, PFS and SFS) for which I want to create random item parcels.
- MAAS has 15 items (Mydata$MAAS_1 to Mydata$MAAS_15), I want 3 parcel with 5 items per parcel
- PFS has 7 items (Mydata$PFS_1 to Mydata$PFS_7), I want 3 parcels with 2-3 items per parcel
- SFS has 7 items (Mydata$SFS_1 to Mydata$SFS_7), I want 3 parcels with 2-3 items per parcel
I've been trying to use the parcelAllocation
function as explained by the authors but I seem to have difficulties understanding it (or its output).
This is the code I tried:
# Specify item-level models for each variable
item.syntaxMaas <- paste0("MAAS = ~ MAAS_", 1:15)
item.syntaxPfs <- paste0("PFS = ~ PFS_", 1:7)
item.syntaxSfs <- paste0("SFS = ~ SFS_", 1:7)
cat(item.syntax, sep = "\n")
# Create parcels for MAAS variable
maas.parcel.names <- paste0("maas.par", 1:3)
maas.mod.parcels <- 'MAAS = ~ maas.par1 + maas.par2 + maas.par3'
# Create parcels for PFS variable
pfs.parcel.names <- paste0("pfs.par", 1:3)
pfs.mod.parcels <- 'PFS =~ pfs.par1 + pfs.par2 + pfs.par3'
# Create parcels for SFS variable
sfs.parcel.names <- paste0("sfs.par", 1:3)
sfs.mod.parcels <- 'SFS =~ sfs.par1 + sfs.par2 + sfs.par3'
# Allocate indicators to parcels using parallel computing
maas.parcels <- parcelAllocation(maas.mod.parcels, data = Mydata,
nAlloc = 100, parcel.names = maas.parcel.names,
item.syntax = item.syntaxMaas, std.lv = TRUE)
pfs.parcels <- parcelAllocation(pfs.mod.parcels, data = Mydata,
nAlloc = 100, parcel.names =
pfs.parcel.names,
item.syntax = item.syntaxPfs,
std.lv = TRUE, parallel = "snow")
sfs.parcels <- parcelAllocation(sfs.mod.parcels, data = Mydata,
nAlloc = 100, parcel.names = sfs.parcel.names,
item.syntax = item.syntaxSfs, std.lv = TRUE,
parallel = "snow")
I just want to know which items were allocated to which parcel, but when I run
maas.parcels
I get this Output:
.
I do not get what the output means. Where can I see which items were allocated to which parcel? Is there another function for that? Or did I do something wrong?
Ah and I want the parcels to be average scores of the items going into them. I did not find an argument for that. Is there a possibility to get that?