Thanks, Solomon, and sounds good—I’ll wait for others to chime in.
Just so we’re referring to the same thing…in your example, we could extract the estimates of the latent factor scores (i.e., people’s levels on the latent factor) using posterior_linpred()
based on the following code (adapted from Guido’s post here):
library(data.table)
my_fit_posterior <- posterior_linpred(my_fit)
tmp = data.table(t(my_fit_posterior))
setnames(tmp,names(tmp), paste0("iter.",1:ncol(tmp)))
complete.dat = data.table(dat)[complete.cases(dat)]
plp_wide = cbind(complete.dat, tmp)
plp_long =
melt(plp_wide,
id.vars = names(dat),
variable.name = "iter")
plp_long.ID.iter =
plp_long[,list(latent = mean(value)),
by = c("person","iter")]
plp.long.ID =
plp_long.ID.iter[,list(m = mean(latent),
CI05 = quantile(latent,.05),
CI95 = quantile(latent,.95)),
by = c("person")]
Items differ in their “validity” (or association) with respect to the latent factor scores (i.e., item discrimination).