Learn R Programming

mirt (version 0.8.0)

wald: Wald test for mirt models

Description

Compute a Wald test given an L vector or matrix of numeric contrasts. Requires that the model information matrix be computed (including SE = TRUE when using the EM method). Use wald(model) to observe how the information matrix columns are named, especially if the estimated model contains constrained parameters (e.g., 1PL). The information matrix names are labelled according to which parameter number(s) they correspond to (to check the numbering use mod2values on the estimated object).

Usage

wald(object, L, C = 0)

  ## S3 method for class 'wald':
print(x, ...)

Arguments

L
a coefficient matrix with dimensions nconstrasts x npars, or a vector if only one set of contrasts is being tested. Omitting this value will return the column names of the information matrix used to identify the (potentially constrained) param
object
estimated object from mirt, bfactor, confmirt, multipleGroup, or mixedmirt
C
a constant vector/matrix to be compared along side L
x
an object of class 'wald'
...
additional arguments to be passed

Examples

Run this code
#View parnumber index
data(LSAT7)
data <- expand.table(LSAT7)
mod <- mirt(data, 1, SE = TRUE)
coef(mod)

#see how the information matrix relates to estimated parameters, and how it lines up with the index
(infonames <- wald(mod))
index <- mod2values(mod)
index

#second item slope equal to 0?
L <- rep(0, 10)
names(L) <- infonames
L[3] <- 1
wald(mod, L)

#simultaneously test equal factor slopes for item 2 and 3, and 4 and 5
L <- matrix(0, 2, 10)
colnames(L) <- infonames #colnames() not required
L[1,1] <- L[2, 7] <- 1
L[1,3] <- L[2, 9] <- -1
L
wald(mod, L)

#logLiklihood tests (requires estimating a new model)
mod2 <- mirt(data, 1, constrain = list(c(1,5), c(13,17)))
anova(mod2, mod)

Run the code above in your browser using DataLab