Dear all,
I am trying to run a SEM with nested data, for which I use the lavaan.survey function. Including this nested structure is quite straightforward:
# Running the normal SEM
fit1 <- sem(model1, fixed.x=T, data=data)
# Creating a design factor for the nested structure
design <- svydesign(ids= ~ Random.factor, nest=TRUE, data=data)
# Combining SEM and the design factor
However, I receive a warning in the lavaan.survey function, no matter what I change in the model:
Warning message:
1: In lavaan.survey(lavaan.fit = fit.surv12,
survey.design = design, :
Some of the standard errors may not be trustworthy. Some of the observed covariances or means are collinear, and this has generated collinearity in your parameter estimates. This may be a sample size issue, missing data problem, or due to having too few clusters relative to the number of parameters. Problem encountered in group(s) 1
I have tested for the variance inflation factor among my variables, but it is absolutely not present. I expect that missing data and the sample size are no issue. Hence, the problem should be in "having too few clusters relative to the number of parameters". I have 18 groups in my random factor, ranging between 1 and 32 observations per group:
|
Group.nr |
Nr of replicates |
|
1 |
16 |
|
2 |
16 |
|
3 |
32 |
|
4 |
16 |
|
5 |
15 |
|
6 |
8 |
|
7 |
1 |
|
8 |
1 |
|
9 |
1 |
|
10 |
1 |
|
11 |
1 |
|
12 |
1 |
|
13 |
1 |
|
14 |
1 |
|
15 |
6 |
|
16 |
5 |
|
17 |
15 |
|
18 |
10 |
I have 18 groups in my random factor, ranging between 1 and 32 observations per group:
# By default, R will crash if a primary sampling unit (psu) has a single observation.# Set R to produce conservative standard errors instead of crashing by running this line:options( survey.lonely.psu = "adjust" )# this setting matches the MISSUNIT option in SUDAAN