mod <-'
# loadings
Theta =~ l1*Q1 + l2*Q2 + l3*Q3 + l4*Q4 + l5*Q5 +
l6*Q6 + l7*Q7 + l8*Q8 + l9*Q9 + l10*Q10
# thresholds (equivalent to tau of the polychoric/tetrachoric-fct.)
Q1 | th1*t1
Q2 | th2*t1
Q3 | th3*t1
Q4 | th4*t1
Q5 | th5*t1
Q6 | th6*t1
Q7 | th7*t1
Q8 | th8*t1
Q9 | th9*t1
Q10 | th10*t1
#discriminations (2PL)
alpha1 := l1/sqrt(1-l1^2) * 1.702
alpha2 := l2/sqrt(1-l2^2) * 1.702
alpha3 := l3/sqrt(1-l3^2) * 1.702
alpha4 := l4/sqrt(1-l4^2) * 1.702
alpha5 := l5/sqrt(1-l5^2) * 1.702
alpha6 := l6/sqrt(1-l6^2) * 1.702
alpha7 := l7/sqrt(1-l7^2) * 1.702
alpha8 := l8/sqrt(1-l8^2) * 1.702
alpha9 := l9/sqrt(1-l9^2) * 1.702
alpha10 := l10/sqrt(1-l10^2) * 1.702
#difficulties (2PL)
beta1 := th1/l1
beta2 := th2/l2
beta3 := th3/l3
beta4 := th4/l4
beta5 := th5/l5
beta6 := th6/l6
beta7 := th7/l7
beta8 := th8/l8
beta9 := th9/l9
beta10 := th10/l10
'
fit <- cfa(mod, data=dat, std.lv = TRUE, ordered=c(paste0("Q",1:10)), estimator="WLSMV", parameterization = "delta")
Is this the currently correct specification to run the model? Are there any tweaks?
with the 'theta' parameterization. Does the conversion of the factor loadings to discrimination and difficulties change?
The specification is correct, but the user-defined IRT parameters might not be correct because lavaan uses a probit (normal ogive) rather than logistic link. This might help:
loading to slope (normal): alpha1.N := (l1)/sqrt(1-l1^2)
loading to slope (logistic):
alpha1.L := (l1)/sqrt(1-l1^2)*1.7
threshold to intercept (normal): b
eta1.N := (-th1)/sqrt(1-l1^2)
threshold to intercept (logistic): be
ta1.L := (-alpha1.L)*loc1.L
where loc1.L is
thresholds to locations (logistic)
: loc1.L := th1/l1
# Normal results ("Standardized and conditional") (from Akihito Kamata )
#item discrim tau
# 1 0.3848 -1.4325
# 2 0.3976 -0.5505
# 3 0.4733 -0.1332
# 4 0.3749 -0.7159
# 5 0.3377 -1.1264
# Normal results (lavaan, parameterization = "delta")
# 1 0.389 -1.433
# 2 0.397 -0.550
# 3 0.471 -0.133
# 4 0.377 -0.716
# 5 0.342 -1.126
# Normal results ("Standardized and Marginal") (from Akihito Kamata )
#Item discrim tau
# 1 0.4169 -1.5520
# 2 0.4333 -0.5999
# 3 0.5373 -0.1512
# 4 0.4044 -0.7723
# 5 0.3587 -1.1966
# Normal results (lavaan, parameterization = "theta")
# 1 0.423 -1.555
# 2 0.433 -0.600
# 3 0.534 -0.151
# 4 0.407 -0.773
# 5 0.364 -1.199
?lavOptions
twopl.sim <- function( nitem = 20, npers = 100 ) {
i.loc = rnorm( nitem ); p.loc = rnorm( npers ); i.slp = rlnorm( nitem, sdlog = .4 )
temp = matrix( rep( p.loc, length( i.loc ) ), ncol = length( i.loc ) )
logits = t( apply( temp , 1, '-', i.loc) )
logits = t( apply( logits, 1, '*', i.slp) )
probabilities = 1 / ( 1 + exp( -logits ) )
resp.prob = matrix( probabilities, ncol = nitem)
obs.resp = matrix( sapply( c(resp.prob), rbinom, n = 1, size = 1), ncol = length(i.loc) )
output <- list(i.loc = i.loc, i.slp = i.slp, p.loc = p.loc, resp = obs.resp)
}
Is this a symptom of the performance of WLSMV and ULSMV estimation in small samples?
My first reaction would be to eliminate solutions with negative factor loadings as inadmissable solutions. Would this be correct?