iota(ltm.obj, logL.fun, fscore.obj = NULL, data = NULL, prior = NULL, theta0 = NULL, range.int = c(-Inf, Inf), range.theta = c(-10, 10))
ltm
, grm
, or gpcm
functions).
factor.scores
from the ltm package.
A set of response patterns must be supplied, using either a factor.scores
object or a data matrix. A prior density function must also be supplied.
Additionally, either ltm.obj or logL.fun must be supplied. If a log-likelihood function is supplied directly, it must take three arguments: z, a vector of latent trait values, dat, a data matrix, and i, a row index. logL.fun must return the vector of log-likelihoods for the vector of latent trait values, for a single response pattern (i.e., the function must return the vector of log-likelihoods for the trait vector z, for the response pattern in row i of data matrix dat).
iota
will also optionally return a p-value for the null hypothesis of no change from the prior to posterior probability of a specific latent trait value. theta0 specifies the latent trait value. If theta0 is a scalar, it is assumed to be the latent trait value of interest. If theta0 is a vector, it must be equal in length to the number of unique response patterns in fscore.obj or data, where each value in the vector is assumed to correspond to each response pattern. Finally, the latent trait with the greatest prior density (over the range range.theta) can be specified with theta0="max prior". By default, theta0=NULL, specifying that no log-likelihods or p-values should be returned.
Note that currently, range.int must be within [-10, 10] for grm
and gpcm
objects. If a grm
or gpcm
object is supplied and range.int is outside this range, the range will be reset to [-10, 10].
Jeffreys
, ltm
, grm
, gpcm
, factor.scores
ltm.lsat <- ltm(LSAT~z1, IRT=FALSE)
Nu.lsat = nrow(unique(LSAT))
iota(ltm.lsat, data=LSAT, prior=Jeffreys(ltm.lsat))
iota(ltm.lsat, data=LSAT, prior=Jeffreys(ltm.lsat), theta0=c("max.prior"))
iota(ltm.lsat, data=LSAT, prior=Jeffreys(ltm.lsat), theta0=0)
iota(ltm.lsat, data=LSAT, prior=Jeffreys(ltm.lsat), theta0=rnorm(Nu.lsat))
Run the code above in your browser using DataLab