th_est_ml {flexmet}R Documentation

Latent Trait Estimation

Description

Compute latent trait estimates using either maximum likelihood (ML) or expected a posteriori (EAP) trait estimation.

Usage

th_est_ml(dat, bmat, maxncat = 2, cvec = NULL, dvec = NULL, lb = -4, ub = 4)

th_est_eap(
  dat,
  bmat,
  maxncat = 2,
  cvec = NULL,
  dvec = NULL,
  int = int_mat(npts = 33)
)

Arguments

dat

Data matrix of binary item responses with one column for each item. Alternatively, a vector of binary item responses for one person.

bmat

Matrix of FMP item parameters, one row for each item.

maxncat

Maximum number of response categories (the first maxncat - 1 columns of bmat are intercepts)

cvec

Vector of lower asymptote parameters, one element for each item.

dvec

Vector of upper asymptote parameters, one element for each item.

lb

Lower bound at which to truncate ML estimates.

ub

Upper bound at which to truncate ML estimates.

int

Matrix with two columns used for numerical integration in EAP. Column 1 contains the x coordinates and Column 2 contains the densities.

Value

Matrix with two columns: est and either sem or psd

est

Latent trait estimate

sem

Standard error of measurement (mle estimates)

psd

Posterior standard deviation (eap estimates)

Examples


set.seed(3453)
bmat <- sim_bmat(n_items = 20, k = 0)$bmat

theta <- rnorm(10)
dat <- sim_data(bmat = bmat, theta = theta)

## mle estimates
mles <- th_est_ml(dat = dat, bmat = bmat)

## eap estimates
eaps <- th_est_eap(dat = dat, bmat = bmat)

cor(mles[,1], eaps[,1])
# 0.9967317


[Package flexmet version 1.1 Index]