item response theory in r

99
Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion Item Response Theory in R Thomas Rusch WU Vienna July 17, 2017

Upload: others

Post on 22-Dec-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Item Response Theory in R

Thomas Rusch

WU Vienna

July 17, 2017

Page 2: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

1 Item Response Theory

2 Unidimensional IRT

3 Multidimensional IRT

4 Multiple Group IRT, DIF, and DTF

5 Conclusion

Page 3: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

OverviewPart 2: Item Response TheoryPrimarily about possibilities in R for applying IRT models. We focus onmodel fitting, model checking, item/person parameter extraction anddiagnosing item sets.a

aRoughly following Rusch T, Mair P, Hatzinger R (2013). Psychometrics with R: Areview of CRAN packages for Item Response Theory.

We use a non-comprehensive list of packages for which there is anassociated peer-reviewed publication (skipping some great packages).

Overview of basic and advanced IRT models useful for applied itemanalysesHands-on applied analysis with various packages for fitting itemresponse models, checking model fit and item diagnostic utilities,estimation of latent trait valuesUtilizing models to detect non-standard ICC or differential itemfunctioning or latent groups 1

1Big thanks to Phil Chalmers for letting me use mirt workshop material

Page 4: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Item Response Theory

Item response theory (IRT) is a set of latent variable techniquesspecifically designed to model the interaction between a participants ability,or latent trait, with item level stimuli (difficulty, guessing, etc.)

Three main reasons to use IRT:

Model a set of items (parameter estimation, diagnostics,dimensionality checking, etc.) in which focus is on theitem/population parameters,Explain variability either in the item properties or persons who weregiven the test, andScore a set of items to obtain estimates of the latent trait(s) forindividual participants

Page 5: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Understanding our dataWhen analyzing item data, we have responses to questions as our primarysource of information. Generally, this can be coded numerically:

## Item_1 Item_2 Item_3 Item_4 Item_5 Item_6## [1,] 0 1 0 2 0 1## [2,] 1 1 0 2 0 2## [3,] 0 1 0 2 1 1## [4,] 0 1 0 1 0 0## [5,] 0 1 1 0 1 1## [6,] 1 1 1 2 1 2

But what we really want to obtain is some kind of ‘scoring’ procedure tohelp us state properties like

person 1 > person 2 << person 5 > person 4, w.r.t. their abilityhad person 3 been given a different item we would expect them tohave a 90% chance of answering correctlySome population of individuals are more likely to answer questionscorrectly, regardless of their ability (e.g., native versus non-nativespeaking populations)

Page 6: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

What is Item Response Theory?

Item response theory (IRT) is a set of latent variable techniquesspecifically designed to model the interaction between a subject’sability (i.e., latent trait) and item-level stimuli (difficulty, guessing,etc.)Focus is on the pattern of responses rather than on compositevariables and linear regression theory (i.e., classical test theory), andemphasizes how responses can be thought of in probabilistic termsLarger emphases on the error of measurement for each test itemwith respect to particular ability levels rather than a global index ofreliability/measurement error (e.g., Cronbach’s α, McDonald’s ω,etc.)Widely used in educational and psychological research to study latentvariable constructs other than ability (e.g., personality, motivation,psychopathology)

Page 7: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

What is Item Response Theory?

Unidimensional or MultidimensionalMost common IRT models are unidimensional, meaning that they modeleach item with only one latent trait, although multidimensional IRTmodels are becoming more popular due to their added flexibility.

Page 8: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Unidimensional IRT

Rasch Models

Page 9: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Rasch models (dichotomous) - I

A popular class of IRT models were developed to model how a subject’sability (θn) was related to answering a test item i (0 = incorrect, 1 =correct) given a single item-level property (difficulty), and how this couldbe understood probabilistically.

P(yi = 1|θn, bi) =exp (θn − bi)

1 + exp (θn − bi)

This is the Rasch modelGiven some ability, θn, the probability of positive endorsement isnon-linearly related to only the item difficulty (b, location parameter).In canonical form: log(P/(1− P)) = θ − bThis model can be reparametrized so that θ + d = θ − b (we prefereasiness to difficulty).

Page 10: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Item Response Function (IRF)

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●●

●●●●●●●●●●●●●

●●●●

●●●

●●●●

●●

●●

●●●●●

●●●

●●●

●●●

●●●●●

●●

●●●

●●●●●

●●

●●

●●●

●●●

●●●●●

●●

●●

●●

●●

●●●

●●

●●●

●●●●●●

●●

●●●

●●●

●●●

●●●

●●●●

●●

●●

●●

●●

●●

●●●

●●

●●●

●●●

●●●

●●●

●●●

●●

●●●

●●●●●●

●●●

●●●●

●●

●●●●

●●

●●

●●

●●

●●●●●●

●●●●●●●

●●

●●●●●●●●●●

●●●●●●

●●●●

●●●

●●●

●●●●

●●

●●●

●●●●●●●●

●●

●●●●●

●●●●●●●●●

●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●

●●

●●

●●●●●●●●

●●●●●●●●●●●●●

●●●●●●

●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

0.00

0.25

0.50

0.75

1.00

−5.0 −2.5 0.0 2.5 5.0θ

P(θ

)

Figure 1: A dichotomous IRT model is similar to a logistic regression model;however, in IRT θ is not observed directly.

Page 11: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Rasch models (dichotomous) - II

This is a rather strict model and not well suited for modellingIt is important because of its special properties:

Sum of 1’s (raw score) is sufficient and fair for comparing peopleAllows “specific objective” comparisonsItem parameters an be estimated by conditioning out the personparameter (Conditional Maximum Likelihood - CLM)

Page 12: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Rasch models (dichotomous) - III

R functionality:

eRm: Fit by CML (RM())ltm: Fit by Marginal ML (rasch())mirt: Fit by various estimation (stochastic MML or MH-RM, EM)mirt(..., itemtype="Rasch")plRasch: Fit by pseudo-likelihood loglinear models (RaschPLE()).

Page 13: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Rasch models (polytomous) - I

Rasch models can be extended to polytomous answers. These Rasch-typemodels retain the properties of the Rasch model (only location parametersfor the item, sufficiency, specific objectivity, CML).

One general expression of these models is:

P(yni = k|θ, ψ) =exp(akkθn + dik)∑kij=1 exp(akjθn + dij)

.

For the Partial Credit Model (PCM) the akk values are treated as fixedand ordered from 0 to (ki − 1). This indicates that each successivecategory is scored equally (the akk values are often interpreted as scoringcoefficients). We have one parameter for each item × category.

eRm: PCM(), in mirt: mirt(...,itemtype="Rasch")

Page 14: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Rasch models (polytomous) - IIThe PCM can be further generalized by estimating the akk values directly,which then indicates the ordering of the categories empirically. This iscalled the Nominal Response Model (NRM).

mirt: mirt(...,itemtype="nominal")

For the Rating Scale Model (RSM) we have a PCM where all items havethe same number of the categories and constant scoring of categories overitems, only the location of items differs, so

θn + dik = θn + di + ck

This boils down to modelling

P(yk = k|θ, φ) = P(y ≥ k)− P(y ≥ k + 1),

as the difference between adjacent Rasch models (dichotomizing the itemat each category, and estimating separate Rasch models).

eRm: RSM, in mirt, ltm: Dichotomizing strategy.

Page 15: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Restricted Rasch-type modelsThere is a class of Rasch models that arise from decomposing theitem/person parameters to p basic parameters η,

dik =

p∑l=1

wiklηl

The matrix of wikl is called Q-Matrix.

LLTM: Linear decomposition of the di in the Rasch ModelLRSM: Linear decomposition of the di in the Rating Scale ModelLPCM: Linear decomposition of the dik of the Partial Credit Model

These models can also be used to measure change over time (usually inthe person parameter). For this, each item at each time point afterbaseline is seen as its own virtual item. Each virtual item parameter canthen be expressed as the parameter at baseline plus a change. Since weare having Rasch models a change of item difficulty is in effect the same aschange of person ability. In eRm one uses the option mpoints formeasurement points. It is also possible to include group information (andcovariates) as groupvec.

Page 16: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Important Functions in eRm

RM(data), PCM(data), RSM(data), LTM(data), LPCM(data),LRSM(data): Model fitting functionssummary(obj), residuals(obj), coef(obj), anova(obj):GenericsgofIRT(obj), LRtest(obj), Waldtest(obj), NPtest(obj): Testand Statistics for Model fitplotICC(obj), plotGOF(obj), plotDIF(obj), plotPImap(obj),plotPWmap(obj): Plot functionsperson.parameter(obj): Extract person parametersitem_info(obj), test_info(obj): item or scale informationperson.fit(obj), item.fit(obj): person and item fit statistics

Note: Not all functions are necessarily working with all object classes.

Page 17: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Show

**eRm**A look at functionality of **eRm**.

Page 18: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Explanatory Rasch Models - I

The idea of reparametrization used in the restricted Rasch models can begeneralized to any functional of person- and item parameter and respectivecovariates to explain scale/item variation.

This is useful because often we want to know the effect of includingadditional information to help explain the observed response patterns.

For this, we can reformulate the models as from the class of GeneralizedLinear Mixed Models (or GLLAMM - generalized linear latent and mixedmodel).

Mixed models (aka multilevel models, hierarchical models) consist of:

Fixed effects: Fixed effects are exhaustive and by design. They arerelated to estimating mean effects.Random effects: Effects for which we make a distributionalassumption and the concrete values are only realizations. They arerelated to estimating variance (components).

This formulation makes estimation of complex models feasible.

Page 19: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Mixed Effect Rasch Model

In the case of the Rasch model, the d may be seen as the fixed effects andthe θ are random effects (drawn from a population) leading to a randomintercept model. This changes the formulation slightly but with profoundeffects for the applicability:

P(yi = 1|di , θn) =exp(ζni)

1 + exp(ζni)=

exp (θn + di)1 + exp (θn + di)

with θ ∼ Fn(ψ), usually Fn(ψ) is the multivariate normal distribution withmean vector 0 and Variance-Covariance matrix Σ.

Page 20: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

GLLAMM - I

In this framework we can expand the linear predictor ζ (vector form) to2.

ζ = W η + Xβ + Zr + ε

with W a fixed effect design matrix for the d , reparametrising them with η(e.g., as in the extended Rasch models) and the X a fixed effect designmatrix for the θ reparametrizing them to β, Z being a random effectdesign matrix of the random effects r specifying item- or person-specificrandom effects and ε being a random effect error terms (we usually assumethe random effects to be normal).

An example for X would be treatment/control group and gender indicatedby 0s and 1s, or continuous variables such as age. An example for Z wouldbe an additional random effect for the school.

2We now skip the indices

Page 21: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

GLLAM - II

Now this is a very general formulation but many models can be seen asspecial cases of this and estimated in a single framework, including

The restricted Rasch models and or Rasch models with extension byitem specific covariates (using W and Z )Latent regression models where the θ is regressed on covariates (usingX and Z )Person-by-item covariate Rasch models (using W and X )Multidimensional models (using partitioned version of X )Random and fixed effects on person and item level (using W , X andZ )All combinations of the above

Page 22: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

GLLAM in R

For the Rasch model extensions discussed above, one can use thegeneralized linear mixed effect model function glmer() from lme4. Thisis an incredibly flexible way to do Rasch (or 1PL) type modelling by theformula interface.

The syntax is essentially

glmer(responses ~ 0 + fixed effects + (random effect |nesting))

Generics for the models exist. Drawback is that one needs to know how tomodel this properly, which is quite involved (setting up W , Z and X ).

Page 23: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Show

**lme4**A look at functionality of **lme4**.

Page 24: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Exercise: Rasch Modelling in R

ExerciseExercises pertaining to Rasch Modelling are available inExercise_03.html.

Page 25: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Unidimensional IRT

Parametric IRT

Page 26: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Parametric IRT models (dichotomous) - IIRT models generalize the approach also taken in the Rasch model byallowing for a more flexible specification of relationship between ability anditem answer. They are better suited for modelling but their results usuallylack the Rasch properties.

The most famous IRT model is the Two Parameter Logistic Model(2PL)3

P(y = 1|θ, a, d) =1

1 + exp (−(aθ + d))

In canonical form: log(P/(1− P)) = aθ + dThis adds a second item parameter a to the Rasch model, the itemdiscrimination or slope of the ICC. The Rasch model is realized whenthe slope parameters are fixed to a constant (usually 1).

3Those who are more familiar with the traditional IRT metric, whereaθ + d = a(θ − b), the a parameters will be the identical for these parameterizations,while b = −d/a

Page 27: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Unidimensional Plots (2PL)

0.00

0.25

0.50

0.75

1.00

−4 −2 0 2 4θ

P(θ

)

a

0.25

0.5

1

0.00

0.25

0.50

0.75

1.00

−4 −2 0 2 4θ

P(θ

)

d

−1

0

1

Figure 2: Item response curves when varying the slope and intercept parametersin the 2PL model

Page 28: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Parametric IRT models (dichotomous) - II

Generalization of the 2PL model are also possible to accommodate forother common testing phenomenon, such as guessing (3PL) and/orcareless responding effects. The most general one in use is the FourParameter Logistic Model (4PL)

P(y = 1|θ, a, d , g , u) = g +(u − g)

1 + exp (−(aθ + d))

which when specific constraints are applied reduces to the 3PL, 2PL, andRasch model.

Given θ the probability of positive endorsement is related to the itemeasiness (d), discrimination (a), probability of randomly guessing (g),and probability of randomly answering incorrectly (u)For psychological questionnaires the lower and upper bounds oftenhave no real rational, and are taken to be 0 and 1, respectively (inclinical instruments they may be justified)

Page 29: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Unidimensional plots (4PL)

0.00

0.25

0.50

0.75

1.00

−4 −2 0 2 4θ

P(θ

)

g

0

0.15

0.25

0.00

0.25

0.50

0.75

1.00

−4 −2 0 2 4θ

P(θ

)

u

0.75

0.85

1

Figure 3: Item response curves when varying the lower and upper boundparameters in the 4PL model

Page 30: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

IRT in R

R functionality:

ltm: 2PL ltm() and 3PL (lower asymptote) tpm(); fit by MarginalMLmirt: 2PL mirt(..., itemtype="2PL") , 3PL (with loweritemtype="3PL" or upper "3PLu" asymptote) , 4PLitemtype="4PL"; fit by various estimation (stochastic MML orMH-RM, EM)MCMCpack: 2PL MCMCirt1d

Page 31: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

IRT Figures

To help understand how the parameterizations in IRT models affect theshape of the probability response curves, mirt has an interactive graphicalinterface to allow the parameters to be modified in real time.

The interface is shipped with the package by default, and can becalled using the following:

library('mirt')itemplot(shiny = TRUE)

Page 32: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Parametric IRT models (polytomous)

Polytomous item response models exist for ordinal categories, rating scales,partial credit scoring, unordered categories, and so on. They usuallygeneralize the models we already mentioned in the Rasch context.

Graded Response Model: Good for Likert items which are often modeledby ordinal/rating scale. We can express it simply as the difference:

P(y = k|θ, φ) = P(y ≥ k)− P(y ≥ k + 1),

between adjacent 2PL models (dichotomizing the item at each category,and estimating separate 2PL models). This generalizes the Rating ScaleModel to include different discrimination for the items. This strategy canof course be extended to the 3PL and 4PL.

Page 33: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Parametric IRT models (polytomous)There are also models from the so-called ‘divide by total’ family of IRTparameterizations, such as the Generalized Partial Credit Model andGeneralized Nominal Response Model.

They are of following form

P(y = k|θ, ψ) =exp(akk(aθ) + dk)∑kj=1 exp(akk(aθ) + dk)

.

Note the a, which means the discrimination effect for each person can bedifferent. The akk values indicate the ordering of the categories.

For the generalized partial credit model the akk values are treated asfixed and ordered from 0 to (k − 1) as in the PCM.In nominal models, some akk values are estimated to indicate theordering of the categories empirically.

If a = 1 the Rasch-type models result. I am not aware of 3 or 4 PLversions.

Page 34: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Unidimensional plots (polytomous)

Trace lines for item 6

θ

P(θ

)

0.0

0.2

0.4

0.6

0.8

1.0

−6 −4 −2 0 2 4 6

Trace lines for item 5

θ

P(θ

)

0.0

0.2

0.4

0.6

0.8

1.0

−6 −4 −2 0 2 4 6

Trace lines for item 4

θ

P(θ

)

0.0

0.2

0.4

0.6

0.8

1.0

−6 −4 −2 0 2 4 6

Figure 4: Probability curves for ordinal/graded (left), generalized partial credit(center), and nominal (right) response models

Page 35: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Important Functions in ltm

rasch(data), ltm(data), tpm(data), grm(data), gpcm(data) :Model fitting functions (with constraints)GoF(obj), margins(obj), unidimtest(obj): Tests for Model fitplot(obj),summary(obj), residuals(obj), coef(obj),anova(obj): Genericsfactor.scores(obj): Extract person parametersinformation(obj): item or scale informationperson.fit(obj), item.fit(obj): person and item fit statistics

Note: Not all functions are necessarily working with all object classes.

Page 36: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Show

**ltm**A look at functionality of **ltm**.

Page 37: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Important Functions in mirt

mirt(data,model,itemtype), bfactor(data),mixedmirt(data,model,formula): Model fitting functions fordifferent itemtypeswald(obj): Test and Statistics for Model fititemplot(obj,options): Plot functions (many different options)plot(obj),summary(obj), fitted(obj), residuals(obj),coef(obj), anova(obj): Genericsfscores(obj): Extract person parametersiteminfo(obj), testinfo(obj), expected.item(obj): item orscale informationM2(obj), itemfit(obj): person and item fit statistics

Page 38: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Show

**mirt**A look at functionality of **mirt**.

Page 39: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Exercise: Unidimensional Parametric IRT Modelling in R

ExerciseExercises pertaining to parametric IRT are available inExercise_04.html.

Page 40: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Unidimensional IRT

Nonparametric IRT

Page 41: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

IRF in parametric IRTSo far we looked at parametric IRT, meaning that we restricted thefunctional form of the RF (response function for item or category).Typical RF assumptions:

Monotonic S-Curves:Logistic Models (Rasch, IRT), Probit Models, More Obscure Links(Log-Log, Cauchit)By far the most popular

Unimodal non-monotonic concave RF:Deviation from location causes a decrease in the response probabilityin either wayMiddle categories in polytomous modelsFor dichotomous items: Ideal point models have the form

P(y = 1|θ, a, d) = exp(−0.5(aθ + d)2).

May be with non-ability based measures (e.g., personality traits,preference ratings, etc).For example, I think R is ok. You may disagree because you think Ris not ok, or because you think R is super.Can be fit with mirt(..,itemtype="ideal")

Page 42: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Nonparametric IRT - I

Parametric IRT can thus be restrictive or needs to be justified (e.g., whyuse square in the ideal point model?)

Non- or semiparametric aproaches allow for any RF.

The RF needs to be estimated though.

Unless the parametric approach is needed on theoretical grounds, I’dalways first explore with nonparametric models. This also emphasizesexploration and graphical presentation.

Page 43: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Estimating the RF

The nonparametric way is to estimate the RF directly from the data. TheNonparametric IRT Model is therefore fairly general

P(yi = k|θ) = fki (θ).

This means every item i ’s category k can have as RF its own functionalform fki which we estimate by f̂ki . This is called non-parametric becauseone has an infinite number of possible functional forms.

How to find f̂ki ?

Smoothing: From the observed yi the f̂ki is estimated by smoothing(splines or kernel smoothing).Estimate step functions: f̂ki is approximated by step functions.

Page 44: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Estimating RF by SmoothingThere are two main ways of smoothing to estimate the RF:

Spline Response Models: They estimate f̂ki (θ) via smoothing splines.A B−spline function is a piecewise polynomial function of degree < gas a function of θ. The points where the splines meet are called knots.The overall spline is the weighted sum of the local polynomials (basisfunctions) over the knots. For cubic basis functions, it is called an-spline. They can be fitted in mirt withmirt(...,itemtype="spline").Kernel Smoothing Models: They estimate f̂ki (θ) via Kernel smoothing.The y are smoothed via a Kernel function of θ. A Kernel is a sort ofdistance window over which to smooth with weight corresponding tothe Kernel function value. There are many Kernels, e.g.,“uniform”“,”Gaussian“. They can be fitted with the ksIRT() fromKernSmoothIRT.

In practize, the two approaches need not differ much. Splines may bebetter with small data sets and sharp turns in the IRF. The Kernelapproach is easier to analyze mathematically and extends straightforwardlyto multiple dimensions.

Page 45: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Important Functions in KernSmoothIRT

ksIRT(data,key,weights): Model fitting function. formatspecifies whether multiple choice (1), rating scale or partial credit (2)or nominal treatment (3) or allows mixed formats. Other scoring rulescan be specified with weights.plot(obj,plottype): Plot functions (many different options)subjthetaML(obj): Extract person parameterssubjEIS(obj), subjETS(obj), subjscoreML(obj),subjOCC(obj): subject-wise scores (expected item and test, MLscores; OCC gives all incl. observed)

Page 46: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Show

**KernSmoothIRT**A look at functionality of **KernSmoothIRT**.

Page 47: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Mokken Scaling - I

Another nonparametric approach is Mokken scaling

Item Response Function assumed is a monotonic non-decreasingfunction (possibly non smooth)Works with dichotomous and polytomous itemsAllows to partition data according to nonparametric models thatimply ordinality

Very useful as a diagnostic suite for checking assumptions in parametricand nonparametric IRT.

Page 48: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Mokken Scaling - II

The underlying models arise from the assumptions:

1 Unidimensionality of θ2 Local Independence3 Latent Monotonicity4 Nonintersection (RF do not intersect)

The two underlying models are:

Monotone homogeneity model (MHM) or nonparametric gradedresponse model (fulfills 1-3)Double monotonicity model (DMM) (fullfills 1-4)

Rasch-type models are a special case of DMM, 2-4PL of MHM, which canbe used for checking.

Page 49: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Mokken Scaling in R

Main functionalities in package mokken:

Scalability coefficients Hij : Covariance over maximal covariance giventhe marginal per item pair. If they belong on the same Mokken scale,they should have a positive scalability. (coefH())Item Scalability Hi : Covariance between item and item set scoreminus the item over the maximum covariance given the marginals. Ifite belongs to that set on the same Mokken scale, a positive itemscalability >.3 is needed (coefH())Test scalability H: For a set of items, Hi over all items on a set. IfH = 1 it is a Guttmann scale. Weak scale if H < 0.3 (coefH())Algorithms that partition a set of item to scales meeting the Mokkencriteria and a set of unscalable items. Function aisp() (usesearch="ga", the item’s number indicates the scale, 0 is unscalable).Diagnostic assumption checks

Page 50: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Checking Assumptions with Mokken ScalingStochastic ordering of latent trait (SOL): Is essentially the MHM (Ass.1-3) and for it to hold it means that 0 ≤ Hij ≤ 1 for all i 6= j and0 ≤ Hj ≤ 1 for all j and 0 ≤ H ≤ 1. Necessary to use the score torank (groups of) subjects (strong SOL does not hold for polytomousMHM)check.monotonicity(): Checks Assumption 3. The summary()gives with #vi the number of violations, the sum of those greaterthan a cut-off and some standardized versions (sum/#ac) as well as asignificance test (#zsig). Values >0 are warning signs.check.pmatrix(), check.restscore(): Check Assumption 4.The summary() gives the #vi, the sum and sum/#ac. Values >0 arewarning signs.check.iio(): Invariant item ordering (IIO) The summary() gives#vi, the sum and a significance test (tsig). Values >0 are warningsigns. One can also backward.selection() to see where theviolations occured, what happened after they were removed. Onelands at a scale with IIO.

One can also use plot().

Page 51: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Important Functions in mokken

coefH(data): Scalability coefficientsaisp(data): Scale partitioningcheck.iio(data), check.pmatrix(data),check.restscore(data), check.monotonicity(data):Assumption checks

Page 52: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Show

**mokken**A look at functionality of **mokken**.

Page 53: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Exercise: Nonparametric Unidimensional IRT Modelling inR

ExerciseExercises pertaining to nonparametric IRT are available inExercise_05.html.

Page 54: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Multidimensional Item Response Theory

Multidimensional IRT

Page 55: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Multidimensional Item Response Theory

We now turn to multidimensional IRT (MIRT).

Luckily, there is little new, we simply extend some of the models we lookedat before.

Our canonical workhorse will be mirt(). Nearly all we did with mirt sofar extends straightforwardly to two dimensions.

Page 56: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Multidimensional IRT models

Multidimensional IRT (MIRT) models replace the single θ and a valueswith vectors θ and a, respectively. This means we now fit a surface. Thisis analogous to the transition from zero-order logistic regression tomultiple logistic regression.

The Multidimensional 4PL Model is

P(y = 1|θ, a, d , g , u) = g +(u − g)

1 + exp [−(a′θ + d)].

This model has a very intimate relationship to non-linear factor analysiswhen g = 0 and u = 1 (since logit(P) ≈ a′θ + d), and is often called a‘compensatory’ model due to the relationship between latent trait scores.

Similar relationship exists for the Multidimensional Graded ResponseModel

Page 57: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Multidimensional IRT models

The MIRT extension for the nominal/generalize partial credit model canalso readily be understood using the previously declared parameterization.

The Multidimensional GPCM, Multidimensional GNRM are

P(y = k|θ, ψ) =exp(akk(a′θ) + dk)∑kj=1 exp(akk(a′θ) + dk)

.

Again, various akk ’s may be freed to estimate the empirical ordering of thecategories (nominal) or treated as fixed values to specify the particularscoring function (gpcm/rating scale).

Page 58: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Multidimensional plots

Figure 5: Probability curves for multidimensional 2PL and ordinal (top),generalized partial credit and nominal models (bottom)

Page 59: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Compensatory models

The multidimensional models in the previous graphs are know as‘compensatory’ models. The reason for this is that

A low θk parameter on one of the dimensions does not necessarilyentail a low probability of positive endorsementHigh values on adjacent θm 6=k can compensate due to the relationshipz = a1θ1 + a2θ2 + dE.g., if a1 = a2 = 1 and d = 0, a participant with the valuesθ(1)1 = −3 and θ(1)2 = 3 will have exactly the same responseprobability as an individual with the ability values θ(2)1 = θ

(2)2 = 0

Page 60: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Partially compensatory models

Noncompensatory (or partially compensatory) models, on the other hand,are not as affected by high/low θ since they are constructed by multiplyingindividual response curves, e.g., for the 2PL:

P(y = 1|θ, ψ) = g + (1− g)m∏

k=1

11 + exp(−(akθk + dk))

This model appears to be appealing from a theoretical perspective in manyability testing situations where the response probabilities should be entirelydependent on adjacent traits.

E.g., a question that asks how to solve a mathematical problem, butpresents the problem in words, will require the subject to have asufficient reading comprehension before being able to measure theirmathematical ability.Unfortunately parameters can be very unstable without highly optimaldata conditions.

Page 61: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Partially compensatory models

Item 3 Trace

−6−4

−20

24

6

−6−4

−20

24

6

0.0

0.2

0.4

0.6

0.8

1.0

θ1

θ2

P(θ)

0.0

0.2

0.4

0.6

0.8

1.0

Figure 6: Partially compensatory 2PL model with a1 = 1, a2 = 0.5, d1 = 1 andd2 = 0.

Page 62: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Exploratory and Confirmatory MIRT

MIRT models can be understood as non-linear extensions of moretraditional factor analysis methodology, and as such have exploratoryand confirmatory aspectsFor exploratory models, the orientation of the θ axes used to estimatethe model are constrained to be orthogonal (no inter-factorcorrelations), and should be rotated following convergence for betterinterpretationConfirmatory models have no rotational indeterminacy, and are similarto confirmatory FA in structural equation modeling (by definition,unidimensional IRT models are confirmatory)

Page 63: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Exploratory MIRT in R

Fitting exploratory multidimensional models with mirt is verystraightforward:

One fits the same model as we did in the unidimensional case (viaargument itemtype) but now also specifies the model, which in this caseis simply an integer with the number of dimensions dim.

The call is therefore mirt(data,model=dim,itemtype="irtmodel").

Other notable packages for multidimensional IRT are plRasch for Raschmodels and ltm which can also do some multidimensional IRT.

Page 64: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Confirmatory MIRT in R

Confirmatory models are generally specified with the mirt.model()function’s syntax.

mirt uses a customized syntax for defining confirmatory patterns (i.e.,Q-matrix), and requires calling the mirt.model() function. Factor namescan be defined by the user, but the keyword COV is reserved for specifyingwhich covariance parameters should be estimated.

The syntax definitions can contain other keyword elements as well that areuseful for specifying equality constraints, prior parameter distributions,polynomial trait combinations, etc. Also supports using item namesinstead of index locations.

CONSTRAIN and CONSTRAINB – parameter equality constraints withinand between groupsPRIOR – specify prior parameter distributions (e.g., normal,log-normal, beta)START – specify explicit start/fixed parameter values

Page 65: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Mixed Effect IRT - I

Latent regression for IRT models is possible in mirt withmixedmirt().The latent regression model attempts to decompose the θ effects intofixed-effect components to explain differences between individuals indifferent populations.If the IRT models are not from the Rasch family, various item-specificslopes must be fixed to a constant in order to identify the Σ elements

Page 66: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Mixed Effect IRT - II

Purpose of mixed-effects modeling is to include continuous or categoricalitem and person predictors into the model directly by way of the interceptparameters. An example of including a fixed effect predictor into themodel at the person level would be the inclusion of ‘Gender’, where anindicator coding is used to change the expected probability to:

P(x = 1; θ,Ψ, βmale) = g +(u − g)

1 + exp [−(a′θ + d + βmaleX )].

Notice here that θ is not directly decomposed and instead additionalintercepts are modeled. This model is distinct from the latent regressionmodel, which has the form

P(x = 1; θ,Ψ, βmale) = g +(u − g)

1 + exp [−(a′θ + d ].

where θ = βmaleX + ε.

Page 67: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Mixed IRT in R

mixedmirt() in the mirt package was design to include fixed and randomintercepts coefficients into the modeling framework directly.

For the M4PL model,

P(Y ) = g +(u − g)

1 + exp (−(W η + Xβ + Zr + ε))

where similar terms are the same as in the mixed effects rasch models:W η the item fixed effects, Xβ the person fixed effects (latent regression)and the Zr controls the person- and/or item-specific random effects termsand ε a random error.

Effects organized to explain person effects (i.e., latent regression models),but also can explain variability in the test itself (i.e., explain why someitems are more difficult than others, account for speeded effects,). Hence,the above model can simultaneously capture item and person effects.

Generalizations of this equation are fairly simple to polytomous responses,however intercept designs require slightly more care.

Page 68: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

mixedmirt() syntax

Has the usual data and model arguments as before, however it alsosupports

covdata – a data.frame of person-level covariate information, anditemdesign – a data.frame of item design based effects

The fixed effects are controlled with

fixed – a standard R formula to decompose the intercept effects(e.g., ~ items + gender*IQ). Corresponds to the W η effectslr.fixed – an R formula to decompose the latent trait(s).Corresponds to the Xβ effects

Page 69: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

mixedmirt()

Random effect terms have a syntax similar to the nlme package:

random – an | separated R formula indicating random intercepts andslope effects for the intercepts (e.g., ~ 1 | group) (Zr)lr.random – an | separated R formula indicating random interceptsand slope effects for the trait (Zr)

By modeling variability with the random effects, fixed effects predictorscan be used to ‘explain’ different sources of variation (e.g., why schoolsmay be different, or why some items are more difficult than others).Hence, random effects are generally interpreted as ‘residual variation’.

Page 70: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Show

**mirt**A look at functionality of **mirt**.

Page 71: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Measuring Change - I

From the Rasch family there is a multidimensional model to measurechange over time, the Linear Logistic Model with Relaxed Assumption(LLRA)

Keeps the Rasch properties of specific objectivity for the time changeOnly allows to estimate the change but not the baseline (condition onthose)In the most general formulation specifies each item as its owndimensionRelaxed assumptions does not mean little assumptions (crucial:changes must be independent of each other, including changes of thesame person for other items)

Page 72: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Measuring Change - II

The model at T1 (baseline) is

P(Xvih1 = 1|T1) =exp(hθvi1 + ωih)∑mil=0 exp(lθvi1 + ωil)

At any measurement point Tt (t ∈ {2, 3, . . . })

P(Xviht = 1|Tt) =exp(hθvit + ωih)∑mil=0 exp(lθvit + ωil)

=exp(h(θvi1 + δvit) + ωih)∑mil=0 exp(l(θvi1 + δvit) + ωil)

δvit = θvit − θvi1 ... amount of change of person v for trait i between time T1 and Tth ... h-th response category (h = 0, . . . ,mi )ωih ... parameter for category h for item i

Page 73: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Model Reparametrization

The flexiblity of LLRA now arises from a (linear) reparametrisation of δvitto include different effects:

δvit = wTit η

wTit ... row of design matrix W for item/trait i up to Tt

η is a vector of parameters typically describing effects for factor orcovariate levels like groups as well as trend and interactions. Often it willlook like this:

δvit =∑j

qvjitλjit + τit +∑j<l

qvjitqvlitρjlit

qvjit ... dosage of covariate/factor j for trait i between T1 and Ttλjit ... main effect of the covariate/factor j on trait i at Ttτit ... trend effect on trait i for Ttρjlit ... interaction effects of treatments j and l on trait i at Tt

Page 74: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

LLRA in R

The eRm package offers functionality for LLRA with the LLRA() function.This function fits the quasi-staurated model (each item is its owndimensions).

Generics as for all eRm() models.plotTR() and plotGR() to plot.collapse_W() convenience function specify Q-Matrix to fitrestricted models (i.e., restrict treatment or trend effects over items,groups and subjects)

Page 75: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Show

**eRm**A look at functionality of **eRm**.

Page 76: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Exercise: Multidimensional IRT Modelling in R

ExerciseExercises pertaining to multidimensional IRT are available inExercise_06.html.

Page 77: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Multiple Groups

Multiple Group IRT

Page 78: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Multiple Group models

Multiple group analysis (MGA) takes into account empirical groups thatare thought to behave differently to the response data. For instance, itemsmay be more difficult for one group or another, may have unequal slopes,etc., and these play a key role in determining the ‘fairness’ of a test. Wediscussed this in parts already from the perspective of reparametrization ofitem and person parameters in Explanatory IRT. Here we return to this ina more “canned” and specialized versions, and also extend it.

MGA has two principle approaches:

Hard partitioning: Completely separate the data according tomembership (e.g., multiple single groups, reparametrization) up to asingle group model (i.e., ignore group membership)Soft partitioning: Models between these extremes, where we try tofind a model that does not need strict independence while beingmindful of differences (e.g., partial parameter restriction, finitemixture models)

Page 79: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Multiple Group Likelihood

The log-likelihood contribution for an individual that is evaluated for thesemodels is

LLtotal = wG1LLG1 + wG2LLG2 + · · ·+ wGgLLGg + wGnLLGn

The weights wGg are ∈ [0; 1]. If wGg = {0, 1} we have hard partitioning.

Parameters can therefore be constrained to be equal across members ofdifferent groups, or freely estimated, and allows for nested modelcomparisons.

We distinguish by focus the following the special cases:

MGA to look at measurement invariance, where items behave thesame depending on the groupMGA as differential item functioning (DIF), where items functiondifferently depending on the group

Page 80: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Invariance and Manifest Groups - Confirmation

For a hypothesis-driven, confirmatory approach to invariance, we can usethe multipleGroup() function from mirt. It defaults to the completelyindependent groups approach.

Because of the property that the restricted model is nested in theunrestricted one and can simply use anova().

invariance argument has keywords to constraint or relax variousparameters, such as ‘slopes’, ‘intercepts’, ‘free_means’, etc.mirt.model() syntax arguments with the CONSTRAINB keyword isalso very useful to constrain parameter between the groups to beequal for testing

Page 81: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Invariance and Manifest Groups - Confirmation

The invariance argument provides a quick way to define equalityconstraints across all groups simultaneously, and also allows the estimationof group-level hyper parameters (e.g., latent means and variances).

free_means – for freely estimating all latent means (reference groupconstrained to a vector of 0)free_varcov, free_var, free_cov – for freely estimate elementsof the variance-covariance matrix across groups (reference group hasvariances equal to 1 by default)slopes – to constrain all the slopes to be equal across all groupsintercepts – to constrain all the intercepts to be equal across allgroups

Additionally, specifying specific item names (from colnames(data)) willconstrain all freely estimated parameters in the specified item(s) to beequal across groups.

Page 82: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Differential item functioning

DIF is a widely studied area in IRT to detect potential bias in items acrossdifferent populations. Formally, when

Pfocal(k = K |θ) 6= Preference(k = K |θ)

then the item is said to demonstrate DIF.

DIF tests generally require that groups are ‘equated’, either by ad-hoclinking methods or by providing a set of anchor items to link the θmetrics during estimationDifferent types of DIF exist, but largely these have been grouped intouniform and non-uniform DIF

In R: difR, mirt, psychotree

Page 83: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Differential item functioning in R - I

With difR: For uniform (u) and non-uniform (nu) DIF. Only fordichotomous item models.

11 DIF methods, including non-IRT methodsIRT methods:

difLord(), difGenLord() (u and nu DIF in two and multiplegroups)difRaju() (un and nu DIF for two groups)difLRT() (u DIF in Rasch models)dichoDif(),genDichoDif(): Convenience function to check DIF (allmethods for 2 or more groups)

Page 84: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Show

**difR**A look at functionality of **difR**.

Page 85: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Differential item functioning in R - IIWith mirt: Via the Wald test or the likelihood-ratio test through theautomated testing function DIF().

DIF(obj) requires a small pre-selected number of invariant “anchor”items, and that the group hyper-parameters are freed for all but onegroup. This ‘equates’ the groups to remove population differencesConstrains are added or removed, depending on the starting model,and tested to determine whether the model improves/gets worseItems requiring free parameters across groups are said to contain DIF

Item trace lines

θ

P(θ

)

0.0

0.2

0.4

0.6

0.8

1.0

−6 −4 −2 0 2 4 6

Item_1

−6 −4 −2 0 2 4 6

Item_2

−6 −4 −2 0 2 4 6

Item_3

Page 86: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Show

**mirt**A look at functionality of **mirt**.

Page 87: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Invariance and DIF - Exploration

It may be that we have a possibly large number of groups and for some ofthem invariance holds but we don’t know which ones. One can thereforeautomatically look for groups for which there is no invariance.

One package that allows to do that is psychotree which starts from asingle group model and greedily partitions the data along groups withparameter instability (defined by categorical or metric covariates). Thisautomatically detects groups for which invariance does not hold.

It currently works with Rasch models

raschtree(): Model-based recursive partitioning of Rasch Modelpctree(): Model-based recursive partitioning of PCMrstree(): Model-based recursive partitioning of RSM

Page 88: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Show

**psychotree**A look at functionality of **psychotree**.

Page 89: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Mixture IRT modelsWhat if we do not want or cannot have hard partitioning? Assign eachobservation to a number g <∞ of G latent groups with a certain weightfrom [0; 1]. Each group has different parameters. This is called a finitemixture model:

P(y) =G∑gπgPIRT (y ;ψg )

with πg being the mixing proportion (∑

g πg = 1) and PIRT (x ;ψg ) beingthe IRT model in each group g with ξg all of its parameters. Concomitantvariables z additionally allow to model the πg := π(g) = h(z) (e.g., withlogistic model).

These models allow to:

Detect and explain clusters of observationsDetect (artifical) DIF between clustersIncorporate additional (unexplained) heterogeneityConnect IRT to Latent Class Models

Page 90: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Mixture IRT models in R

Currently, only Rasch type models are available for mixture models.

mRm: mrm(data,cl=groups) Mixed dichotomous Rasch modelspsychomix: raschmix(formula, data, k=groups) Mixeddichotomous Rasch models with possible concomitant variablesmixRasch : mixRasch(data,n.c=groups) Dichotomous andpolytomous Rasch models.

All feature some standard generics.

Page 91: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Show

**mixRasch** and **psychomix**A look at functionality of **mixRasch** and **psychomix**.

Page 92: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Exercise: MGA, Measurement Invariance and DIF in R

ExerciseExercises pertaining to MGA, MI, and DIF are available inExercise_07.html.

Page 93: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

ConclusionWe made a tour through the availability of IRT in R and it is impressivewhat we can already do.

But there is even much more going on in R, incl. support for

Customized IRT models and latent densities in mirtAdditional IRT models (testlet, NOHARM, Rasch copula, facets,ISOP, LSEM) in sirtItem calibration with plinkTest equating with kequateComputerized adaptive testing with catRDiscrete latent traits (DINO, DINA, etc.) models with CDM,GDINA, NPCD

Unfortunately we were forced to disregard those important areas and greatsoftware. A big shout-out to the authors of these packages.

What is even better: The development continues. With what we did todayyou should find your way around the growing ecosystem of IRT in R (andperhaps even develop!)

Page 94: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

End of Workshop

This is the end of our workshop (Yay!). Just to review what we learned:

R as a software for data analysisBasic concepts of IRT (item response function, etc)Many different IRT models (unidim, multidim, parametric,nonparametric, mixed, etc)R packages for IRT analysisEstimating single and multiple group IRT models in RMultiple-group estimation, DIF, DTF and Mixtures

Page 95: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

References - I

Chalmers, R. P. (2012). mirt: A Multidimensional Item Response Theory Packagefor the R Environment. Journal of Statistical Software, 48.De Boeck P, Bakker M, Zwitser R, Nivard M, Hofman A, Tuerlinckx F, Partchev I(2010). The Estimation of Item Response Models with the lmer Function from thelme4 Package in R. Journal of Statistical Software, 39(12).Frick H, Strobl C, Leisch F, Zeileis A (2012a). Flexible Rasch Mixture Modelswith Package psychomix. Journal of Statistical Software, 48(7).Hatzinger R, Rusch T (2009). IRT models with relaxed assumptions in eRm: Amanual-like instruction. Psychology Science Quarterly, 51(1), 87.Ihaka R, Gentleman R (1996). R: A Language for Data Analysis and Graphics.Journal of Computational and Graphical Statistics, 5(3), 299–314.Jara A, Hanson T, Quintana F, Müller P, Rosner G (2011). DPpackage: BayesianSemi- and Nonparametric Modeling in R. Journal of Statistical Software, 40(5).Magis D, Beland S, Tuerlincx F, De Boeck P (2010). A general framework and anR package for the detection of dichotomous differential item functioning. BehaviorResearch Methods, 42(3), 847–862.

Page 96: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

References - II

Mair P, Hatzinger R (2007a). Extended Rasch Modeling: The eRm Package forthe Application of IRT Models in R. Journal of Statistical Software, 20(9).Martin A, Quinn K, Park JH (2011). MCMCpack: Markov Chain Monte Carlo inR. Journal of Statistical Software, 42(9).Mazza A, Punzo A, McGuire B (2012). KernSmoothIRT: An R Package allowingfor Kernel Smoothing in Item Response Theory. Journal of Statistical Software,58(6).Preinerstorfer D (2012). mRm: An R package for conditional maximum likelihoodestimation in mixed Rasch models. R package version 1.1.2, URLhttp://CRAN.R-project.org/ package=mRm.R Development Core Team (2017). R: A Language and Environment forStatistical Computing. R Foundation for Statistical Computing, Vienna, Austria.Rizopoulos D (2006). ltm: An R package for Latent Variable Modelling and ItemResponse Theory Analyses. Journal of Statistical Software, 17(5).

Page 97: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

References - III

Rusch T, Maier M, Hatzinger R (2013). Linear Logistic Models with RelaxedAssumptions in R. In B Klaussen, D van den Poel, A Ultsch (eds.), Algorithmsfrom & for Nature and Life, Studies in Classification, Data Analysis, andKnowledge Organization, pp. 337–347, Springer-Verlag, Heidelberg.Rusch T, Mair P, Hatzinger R (2013). Psychometrics with R: A review of packagesfor Item Response Theory. Discussion Paper Series/Center for Empirical ResearchMethods, 2013/2. WU Vienna University of Economics and Business, Vienna.Strobl, C., J. Kopf, and A. Zeileis (2015). Rasch trees: A new method fordetecting differential item functioning in the Rasch model. Psychometrika, 80(2),289-316.Van der Ark LA (2007). Mokken Scale Analysis in R. Journal of StatisticalSoftware, 20(11).Van der Ark LA (2012). New Developments in Mokken Scale Analysis in R.Journal of Statistical Software, 48(5).Willse J (2009). mixRasch: Mixture Rasch Models with JMLE. R package version0.1, URL http://CRAN.R-project.org/package=mixRasch.

Page 98: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

Discussion

Discussion

Page 99: Item Response Theory in R

Item Response Theory Unidimensional IRT Multidimensional IRT Multiple Group IRT, DIF, and DTF Conclusion

License

Please attribute Thomas Rusch. This work is licensed under CC-BY-SA:

https://creativecommons.org/licenses/by-sa/4.0/