Learn R Programming

ltbayes (version 0.3)

profileci: Profile Likelihood Confidence Interval of the Latent Trait of an Item Response Model

Description

profileci numerically computes the profile likelihood confidence interval of the latent trait of an item response model for a given response vector or sum score(s).

Usage

profileci(fmodel, y, zmin = -5, zmax = 5, lower = TRUE, upper = TRUE, level = 0.95, ...)

Arguments

fmodel
Either a function with first argument zeta which returns the log-likelihood function or the log of the (unnormalized) posterior distribuion as a named object post in a list. In the latter case the prior should be specified as uniform, and if the function includes an argument prior for specifying the prior distribution this will be set to a uniform distribution.
y
A m-dimensional vector or a s by m matrix of item responses, where in the latter case the posterior is computed by conditioning on the event that the response pattern is one of the s response patterns in y.
zmin
Minimum value of the latent trait when searching for the MLE.
zmax
Maximum value of the latent trait when searching for the MLE.
lower
Logical for whether to compute the lower bound of the confidence interval (default is TRUE).
upper
Logical for whether to compute the upper bound of the confidence interval (default is TRUE).
level
Confidence level as a value in the open unit interval (default is 0.95).
...
Additional arguments to pass to fmodel.

Value

zeta
Maximum likelihood estimate of the latent trait.
post
Value of the log-likelihood function at the maximum likelihood estimate of the latent trait.
lower
Lower bound of the confidence interval.
f.lower
Value of the log-likelihood function at lower.
upper
Upper bound of the confidence interval.
f.upper
Value of the log-likelihood function at upper.

Warning

Finding the confidence interval is not guaranteed. Inspection of the profile of the posterior (perhaps by using posttrace) is recommended to verify that zmin and zmax are set appropriately. Problems can arise for posterior distributions that are multimodal or where no (finite) mode exists.

Details

This function solves for the profile likelihood confidence interval using a root-finding approach. This can be used as an alternative to using the Fisher or observed information to compute a Wald confidence interval for the latent trait.

See Also

See uniroot for details on the root-finding function, and postsamp for the function that finds the MLE.

Examples

Run this code
alph <- c(1.27,1.34,1.14,1,0.67)   # discrimination parameters
beta <- c(1.19,0.59,0.15,-0.59,-2) # difficulty parameters
gamm <- c(0.1,0.15,0.15,0.2,0.01)  # lower asymptote parameters

# profile confidence interval given a sum score of 3
profileci(fmodel3pl, patterns(5, 2, 3), apar = alph, bpar = beta, cpar = gamm)

Run the code above in your browser using DataLab