Tricky. Using the module SEM and writing a script 😱
lavaan
syntax and SEM module of JASPJASP -> Confirmatory factor analysis -> Additional Output -> Show lavaan syntax
# Factors
Factor1 =~ lambda11*pplfair + lambda12*pplhlp + lambda13*ppltrst
# Latent means
Factor1 ~ c(0,NA)*1
symbol | meaning | example |
---|---|---|
=~ |
a new factor, its name on the right, its indicators on the left | MY_factor1 =~ indicator1 + indicator2 + indicator3 |
~1 |
intercept or mean | |
* |
Fix or constrain parameter to some value | My_factor =~ 1*my_indicator fixes the loading of my_indicator to 1; Factor1 ~ 0*1 constrains mean of Factor1 to 0. MY_factor1 =~ A*indicator1 + A*indicator2 constrains factor loadings of indicator1 and indicator2 to equality. |
c() |
Used to list constraints across groups | My_factor =~ c(1, A)*my_indicator fixes factor loading of my_indicator to 1 in the first group, and doesn’t fix it in the second group.My_factor =~ c(1, 1)*my_indicator fixes factor loading to 1 in both groups.My_factor =~ c(A, A)*my_indicator constrains factor loading in group 1 and group 2 to equality, forces them to be the same.my_indicator ~ c(0, NA)*1 fixes intercept of my_indicator to 0 in first group and freely estimate it in the second. |
NA |
“not available” in the sense the parameter is not fixed or constrained | My_factor =~ c(1, NA)*my_indicator - factor loading is fixed to 1 in the first group, but not fixed in the second. |
Add the lines in the ‘Source’ window.
install.packages("lavaan")
library("lavaan")
To run the lines, select them and click “Run” button.
ess8 <- subset(ESS8e02, subset = cntry == "NL" | cntry == "BE")
And run the line.
fitted.model <- cfa(
model = "Factor1 =~ ppltrst + pplfair + pplhlp + trstplc
Factor2 =~ trstplt + trstprt + trstep + trstun",
data = ess8,
group = "cntry",
group.equal = c("loadings", "intercepts"),
group.partial = c("Factor2 =~ trstprt")
)
summary(fitted.model)
Item response theory- a set of methods, alike factor analysis, but aimed at categorical (binary) data. It was developed primarily for educational tests of achievements and abilities, initially for “right” and “wrong” answers.
Opposed to classic test theory (e.g. Cronbach), as more nuanced and theoretically underpinned.
The indicators are not continuous, so the logistic function is used to create a continuous latent variable.
Most usual IRT models:
a
- discrimination parameter [similar factor loading];b
- difficulty parameter [similar to intercept];c
- guessing parameter.Appropriate for detecting non-invariant intercepts (but not factor loadings!). Conceptually appealing represention.
Based on scalar MGCFA model, but allows some wiggle space for loadings and intercepts.
Pros:
Cons:
blavaan
software.More explanations: van de Schoot et al., 2013
It gives more optimistic conclusions than the “exact” MGCFA test.
The alignment method can be used to estimate group-specific factor means and variances without requiring exact measurement invariance. Muthen & Asparouhov, 2013
Consists of two stages:
😃 | ☹️ |
---|---|
- provides usually more optimistic results; | - requires many groups; |
- gives a detailed info on every group and parameters non-invariance; | - requires Mplus licence |
- allows comparison of latent means even when there is no full invariance; provides a direct comparison of latent means. | - sometimes doesn’t find invariance when it’s present |
(requires Mplus software licence and basic knowledge of Mplus or R) https://maksimrudnev.com/2019/05/01/alignment-tutorial/
Similar to alignment, but with different steps.
Pros: - Convenient Tucker’s Phi coefficient shows the congruence between pancaultural loadings and rotated group-specific loadings; - employs more flexible EFA rather than CFA.
Cons: - test for structural/configural invariance only.
Available at R ccpsyc
, or manually - at SPSS.