wald: Wald statistics for mirt models

Description Usage Arguments Author(s) References Examples

View source: R/wald.R

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).

Usage

1
wald(object, L, C = 0)

Arguments

object

estimated object from mirt, bfactor, multipleGroup, mixedmirt, or mdirt

L

a coefficient matrix with dimensions nconstrasts x npars. Omitting this value will return the column names of the information matrix used to identify the (potentially constrained) parameters

C

a constant vector of population parameters to be compared along side L, where length(C) == ncol(L). By default a vector of 0's is constructed

Author(s)

Phil Chalmers rphilip.chalmers@gmail.com

References

Chalmers, R., P. (2012). mirt: A Multidimensional Item Response Theory Package for the R Environment. Journal of Statistical Software, 48(6), 1-29. doi: 10.18637/jss.v048.i06

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## Not run: 
#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 parameter index
(infonames <- wald(mod))
index <- mod2values(mod)
index[index$est, ]

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

#simultaneously test equal factor slopes for item 1 and 2, and 4 and 5
L <- matrix(0, 2, 10)
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)
cmodel <- 'theta = 1-5
           CONSTRAIN = (1,2, a1), (4,5, a1)'
mod2 <- mirt(data, cmodel)
#or, eqivalently
#mod2 <- mirt(data, 1, constrain = list(c(1,5), c(13,17)))
anova(mod2, mod)


## End(Not run)

xzhaopsy/MIRT documentation built on May 29, 2019, 12:42 p.m.