calculating the item-score functions based on lavaan output

96 views
Skip to first unread message

Michael Paul Grosz

unread,
Oct 9, 2014, 8:54:41 AM10/9/14
to lav...@googlegroups.com
Dear lavaan creators and users,

Based on the lavaan output from the categorical data option, I would like to calculate the item-score functions.
I know how to do this with logit models. However, lavaan uses the probit link function not the logit link function so I am not sure how to do it.

Here is how I would do it if lavaan would use the logit link function:
given that the loading for the item in question is .959 and the treshold is -.221.

trait = seq(-4, 4, by=0.1)
loading = .959
treshold = -.221
prob = NULL

for (i in 1:80 ) {
prob[i] =exp(loading*(trait[i]-(treshold)))/(1+exp(loading*(trait[i]-(treshold))))
}

plot(prob)

does anybody know I need to modify the code so that I get then correct item-score function (i.e., the one that is based on the probit not the logit fuction?)

best,
Michael


Terrence Jorgensen

unread,
Oct 9, 2014, 10:36:16 AM10/9/14
to lav...@googlegroups.com
The logit transformation takes a probability (p) and transforms it using

logit = log( p / (1 - p) )

The equation you are using to transform logits into probabilities is simply the inverse logit function:

p = exp(logit) / (1 + exp(logit))

The probit function, however, takes a probability and finds the associated z score (quantile in a standard normal distribution).  For instance, the z scores associated with -1.96, -1, and 0 should look familiar if you run this syntax:

?qnorm
qnorm(p = c(-1.96, -1, 0))

To transform the probits back into probabilities, you can apply the inverse of the qnorm() function, which is the pnorm() function:

prob <- pnorm(probits)

where I *think* you still use the same equation for calculating an individual's probit from the item and person parameters:

probits <- loading * (trait - threshold)
prob <- pnorm(probits)

These functions are vectorized in R, so you shouldn't have to loop over [i] individuals, but your answer will be the same if you do.

Terry

Message has been deleted

Michael Paul Grosz

unread,
Oct 12, 2014, 9:28:53 AM10/12/14
to lav...@googlegroups.com
Hi Terry,

I am furthermore wondering whether it's necessary to transform the lavaan parameters into traditional IRT parameters before calcuating the item-score functions.

In an MPLUS forum, it says that in order to get the BILOG parametrization one needs to transform the MPLUS loadings and thresholds in the following way.

BILOG slope = loading/(sqrt(1-loading**2))
BILOG Threshold = threshold/loading

Are the same transformations possible for the lavaan parameters (standardized loadings and thresholds)?
(Btw, I need to use the standardized loadings not the unstandardized loadings, right?)
As BILOG seem to use the traditional IRT parametrization, it might be necessary to transform the lavaan parameters before calculating the item-score functions (even if we use the probits and not the logits to calculate the probabilities). Or is this not necessary when working with the probits and pnorm?

What do you think?
Anybody else who has a good understanding of these things?

best,
Michael
Reply all
Reply to author
Forward
0 new messages