Estimating IRT models with gllamm Herbert Matschinger University
Estimating IRT models with - gllamm - Herbert Matschinger University of Leipzig – Department für Psychiatry e-mail: math@medizin. uni-leipzig. de
“Health-Related Quality Of Life” (HRQOL) • • 5 3 - categorical items to assess health related quality of lifi. dichotomized {1} {2, 3} 1. 2. 3. 4. 5. Mobility Self-care Usual (Daily) activities Pain/discomfort Anxiety/depression
Data • • • European Study of the Epidemiology of Mental Disorders (ESEMe. D) 2001 - 2003 6 European countries : N = 21425 1. 2. 3. 4. 5. 6. Belgium France Germany. Italy The Netherlands Spain 2419 2894 3555 4712 2372 5473
Research Questions • Do these 5 items measure one single dimension ? • Is the sum of endorsements a sufficient statistic? • Do the item parameters differ between countries ? • Do the discrimination parameters differ between countries ? • How much dimensions should be assumed
Random Intercept Modell 2 sets of predictors : 1) X – fixed effects 2) Z – random effects De Boeck, P. and Wilson, M. (2004). Exploratory Item Response Models: A General Linear and Nonlinear Approach. New York, Berlin: Springer.
1 and 2 - Parameter IRT ηpi = log(πpi/(1 -πpi) Logit[Pr(ypi = 1; θp)] = - βi + θ p random intercept θp fixe Effekte -βi + θp 0 Zi 0 Logit[Pr(ypi = 1; θp)] = -βi λ iθ p Logit[Pr(ypi = 1; θp)] = X´pi βi + θp X´pi λi
Preparation of the data 1. egen pattern = group(eurod 1 -eurod 5 countryn) 2. drop if pattern ==. 3. contract eurod 1 -eurod 5 countryn pattern, f(wt 2) 4. reshape long eurod, i(pattern)j(item) 5. for num 1/5: gen item. X=0 replace item. X=1 if item ==X
Structure of the data (long format) pattern item eurod wt 2 1 1 0 A 1 2 0 A 1 3 1 A 1 4 1 A 1 5 1 A 2 1 0 B 2 2 0 B 2 3 0 B 2 4 1 B 2 5 0 B item 1 item 2 item 3 item 4 item 5 1 1 1 1 1
Frequencies Item Mobility Self-car Daily activities Pain/discomfort Anxiety/Depression no 18626 / 87 20598 / 96 19063 / 89 15385 / 72 19744 / 92 yes 2783 /13 811 / 4 2344 / 11 6023 / 28 1664 / 8
1 - Parameter model for all 6 countries gllamm eurod item 1 -item 5, nocons link(logit) fam(bin) i(pattern) w(wt) adapt dot Intercept (-β) SE item 1 ; -3. 528638 . 043579 item 2 ; -5. 576689 . 061522 item 3 ; -3. 851309 . 045826 item 4 ; -1. 809436 . 033516 item 5 ; -4. 449809 . 050426 var(θ) = 6. 4802599 log likelihood = -31545. 688 . 16565955
gllapred raschu, u - [posterior means] (means and standard deviations will be stored in raschum 1 raschus 1) Non-adaptive log-likelihood: -31522. 338 -3. 155 e+04 Log-likelihood: -31545. 694 gllapred raschmu, mu - [response probabilities] (mu will be stored in raschmu) Non-adaptive log-likelihood: -31522. 338 -3. 155 e+04 Log-likelihood: -31545. 694
gr 7 raschmu raschum 1, s([item]) t 2("1 - Parameter No Differential Item Functioning - no country effect") ylab(0(0. 1)1) yline(. 5) psize(120) xline(0)
2 – Parameter (Birnbaum) model eq discrim: item 1 -item 5 gllamm eurod item 1 -item 5, nocons link(logit) fam(bin) i(pattern) w(wt) eqs(discrim) adapt dot e(b)[1, 10] eurod: item 1 eurod: item 2 eurod: item 3 eurod: pat 1_1 l: item 4 item 5 item 2 item 3 y 1 -4. 8818004 -8. 507911 -7. 8598477 -1. 6312255 -2. 9198215 1. 1467799 pat 1_1 l: pat 1_1: item 4 item 5 item 1 1. 562892 y 1. 55341432. 27273694 3. 8073739 constraint def 1 [pat 1_1]item 1=1 gllamm eurod item 1 -item 5, nocons link(logit) fam(bin) i(pattern) w(wt) constr(1) frload(1) eqs(discrim) adapt dot
2 - Parameter Model Intercept item 1 ; item 2 ; item 3 ; item 4 ; tem 5 ; -4. 885114 -8. 501162 -7. 840406 -1. 630332 -2. 919229 var(1): 1 (0) loadings for random effect 1 item 1: 3. 8137476 (. 13478418) item 2: 4. 3643911 (. 20426133) item 3: 5. 9397444 (. 32311677) item 4: 2. 1078878 (. 05010409) item 5: 1. 0385574 (. 03638325) LL = -30547. 222 SE. 1492511. 3370249. 3939964. 0350471. 0394554
gr 7 intmu intum 1 , s([item]) t 2("2 - Parameter No Differential Item Functioning - no country effect") ylab(0(0. 1)1) yline(. 5) psize(120)
1 –Parameter model / effect on θ • Generate two sets of indicator variables for two different reference categories • Estimate the model twice for different reference categories • Compare the two results with respect to the differences of the fixed parameters (item difficulties)
1 –Parameter model / effect on θ 1. char countryn[omit] 1 or 2. char countryn[omit] 2 xi 3: eq f 1: i. country gllamm eurod item 1 item 2 item 3 item 4 item 5, link(logit) fam(bin) adapt dot i(pattern) w(wt) nocons geqs(f 1) Caveat: The output does not tell you what contrast you have employed
1 –Parameter model effect on θ (reference group is Belgium (1)) Intercept (-β) SE effect SE Reference = Belgium item 1 | -3. 510938. 0803299 France . 54711696 (. 0949265) item 2 | -5. 55874. 0912916 -. 11129763 (. 0931433) Germany item 3 | -3. 833834. 0815657 Italy -. 19944865 (. 08868224) item 4 | -1. 788838. 0753648 Netherlands . 14494306 (. 10088877) item 5 | -4. 432465. 0842277 Spain -. 21903409 (. 08672157) var(1): 6. 4690974 (. 16557056) LL = -31485. 737 26
1 –Parameter model effect on θ (reference group is France (2)) Intercept (-β) SE effect SE Reference = France item 1 | -2. 96341. 0696799 Belgium -. 54803974 (. 09490968) item 2 | -5. 01124. 0813064 Germany -. 65890334 (. 08620927) item 3 | -3. 28631. 0709361 Italy -. 74705435 (. 08142842) item 4 | -1. 24127. 0651058 Netherlands -. 40267533 (. 09432633) item 5 | -3. 88495. 0737165 Spain var(1): 6. 4690974 (. 16557056) LL = -31485. 737 -. 76663319 (. 07938433)
Differences between „fixed“ parameters (β) France Belgium -2. 96341 -3. 510938 -5. 011237 -5. 55874 -3. 28631 -3. 833834 -1. 241268 -1. 788838 -3. 884948 -4. 432465 Difference 0. 548 for each item
Systematics in differences • The „fixed“ parameter depend on the contrast employed for the predictor. • The „fixed“ parameter are the item difficulties for the reference category of the predictor. • The difference in difficulties between the two estimates are the differences between the two reference categories (countries) • These differences are the same for all items
Modeling country differences via „fixed“ effects / effects on β • The „fixed“ effects depend on the reference category • Choose category 1 (Belgium) for reference • Define all possible interaction effects between the items and the 5 dummies (France to Spain) • Constrain all the 5 interaction effects to be equal for each item
Interactions and constraints char countryn[omit] xi 3: i. countryn*item 1 i. countryn*item 2 i. countryn*item 3 i. countryn*item 4 i. countryn*item 5 for A in num 2/5 B in num 1/4: constraint for A in num 6/9 B in num 1/4: constraint for A in num 10/13 B in num 1/4: constraint for A in num 14/17 B in num 1/4: constraint for A in num 18/21 B in num 1/4: constraint def A _Ico 2 Xit = _IBco 2 Xit def A _Ico 3 Xit = _IBco 3 Xit def A _Ico 4 Xit = _IBco 4 Xit def A _Ico 5 Xit = _IBco 5 Xit def A _Ico 6 Xit = _IBco 6 Xit
gllamm syntax gllamm eurod item 1 - item 5 _Ico 2 Xit- _I 4 co 6 Xit, link(logit) fam(bin)i(pattern) w(wt) nocons adapt dot constr(2/21) gllamm model ( 1) ( 2) ( 3) ( 4) ( 5) ( 6) ( 7) ( 8) ( 9) (10) (11) (12) (13) (14) (15) (16) (17) (18) (19) (20) with constraints: [eurod]_Ico 2 Xit [eurod]_Ico 3 Xit [eurod]_Ico 4 Xit [eurod]_Ico 5 Xit [eurod]_Ico 6 Xit - [eurod]_I 1 co 2 Xit [eurod]_I 2 co 2 Xit [eurod]_I 3 co 2 Xit [eurod]_I 4 co 2 Xit [eurod]_I 1 co 3 Xit [eurod]_I 2 co 3 Xit [eurod]_I 3 co 3 Xit [eurod]_I 4 co 3 Xit [eurod]_I 1 co 4 Xit [eurod]_I 2 co 4 Xit [eurod]_I 3 co 4 Xit [eurod]_I 4 co 4 Xit [eurod]_I 1 co 5 Xit [eurod]_I 2 co 5 Xit [eurod]_I 3 co 5 Xit [eurod]_I 4 co 5 Xit [eurod]_I 1 co 6 Xit [eurod]_I 2 co 6 Xit [eurod]_I 3 co 6 Xit [eurod]_I 4 co 6 Xit = = = = = 0 0 0 0 0
Results Belgium item 1 item 2 item 3 item 4 item 5 | | | -3. 510822 -5. 558637 -3. 833719 -1. 788679 -4. 432352 . 0803441. 0913007. 081579. 0753829. 0842393 France Ico 2 Xit |. 5468687. 0949383 Germany Ico 3 Xit | -. 1115037. 0931599 Italy Ico 4 Xit | -. 1996552. 0887003 Netherlands Ico 5 Xit |. 1447117. 1009002 Spain Ico 6 Xit | -. 2192302. 0867413. . . . . . I 4 co 2 Xit |. 5468687. 0949383 I 4 co 3 Xit | -. 1115037. 0931599 I 4 co 4 Xit | -. 1996552. 0887003 I 4 co 5 Xit |. 1447117. 1009002 I 4 co 6 Xit | -. 2192302. 0867413 Item 1 Item 5
var(1): 6. 4695502 (. 16557072) LL= -31485. 71012285193 Compare with results from slide 19 These two models are equal ! Both models assume equal item functioning with respect to country differences
Modeling country differences without constraints on „fixed“ effects • Results for a model without these 20 constraints are completely different. – LL = -3115 compared to – 31484 df(15) • Deviations from Belgium are different for each item • Item-difficulties are heterogeneous with respect to countries
Results Belgium item 1 item 2 item 3 item 4 item 5 | | | France Germany Italy Netherlands Spain Ico 2 Xit Ico 3 Xit Ico 4 Xit Ico 5 Xit Ico 6 Xit France Germany Italy Netherlands Spain I 1 co 2 Xit I 1 co 3 Xit I 1 co 4 Xit I 1 co 5 Xit I 1 co 6 Xit -3. 510822 -5. 558637 -3. 833719 -1. 788679 -4. 432352 | | | . 2672621. 4485834 -. 3667433 -. 1668095. 1085338 . 0803441. 0913007. 081579. 0753829. 0842393 | | | . 1939196 -. 6497205 -. 3702901 -. 2827915 -. 1267169 . 1360669. 1301335. 1284983. 1474595. 122575. 1898053. 1954673. 1787872. 2075728. 169957 Item 1 Item 2
Results cont. France Germany Italy Netherlands Spain I 2 co 2 Xit I 2 co 3 Xit I 2 co 4 Xit I 2 co 5 Xit I 2 co 6 Xit | | | -. 2079065 -. 4445011 -. 51551. 1836286 -. 1787188 . 141196. 1373677. 1304282. 1448181. 1247335 France Germany Italy Netherlands Spain I 3 co 2 Xit I 3 co 3 Xit I 3 co 4 Xit I 3 co 5 Xit I 3 co 6 Xit | | | . 6728065 -. 0709686 -. 1572684. 5405529 -. 5646274 . 1156087. 1138256. 1080919. 1222693. 1067354 France Germany Italy Netherlands Spain I 4 co 2 Xit I 4 co 3 Xit I 4 co 4 Xit I 4 co 5 Xit I 4 co 6 Xit | | | 1. 640549 -. 7005679. 4469239 -. 9392069. 1914548 . 1511489. 1700497. 1478239. 196039. 1461186 Item 3 Item 4 Item 5
2 –Parameter Modell effect on θ • Now we choose the e – contrast of xi 3 • The model was estimated twice – Reference category 6 (Spain) • char countryn[omit] 6 – Reference category 1 (Belgium) • char countryn[omit] 1 • „Fixed“ effects keep virtually the same • „Loadings“ keep almost the same • The effect for the reference category is the negativ sum of all the other effects
2 –Parameter Modell effect on θ xi 3: eq f 1: e. country eq discrim: item 1 -item 5 constraint def 2 [pat 1_1]item 1=1 gllamm eurod item 1 item 2 item 3 item 4 item 5, link(logit) fam(bin) adapt dot i(pattern) w(wt) nocons geqs(f 1) eqs(discrim) constr(2) frload(1) gllapred birncontu, u (means and standard deviations will be stored in birncontum 1 birncontus 1) gllapred birncontmu, mu (mu will be stored in birncontmu)
2 –Parameter Modell effect on θ Intercept SE Loading SE item 1: -4. 801975. 1460378 item 1: 3. 8015702. 13333549 item 2: -8. 457937. 3378112 item 2: 4. 3896022. 20675589 item 3: -7. 658351. 3787267 item 3: 5. 8764124. 31438171 item 4: -1. 599355. 0351327 item 4: 2. 1281491. 05062713 item 5: -2. 903158. 0392471 item 5: 1. 0433228. 03642365 Deviation SE (1) Belgium: . 00116297 . 0249041 (2) France: . 13703951 . 0233686 (3) Germany: -. 02622923 . 0212044 (4) Italy: -. 10642868 . 0196428 (5) Netherlands: . 06823874 . 0252931 (6) Spain: -. 07378098 . 0181395 LL=-30506
gr 7 birncontmu birncontum 1 , s([countryn]) ylab(0(0. 1)1) yline(0. 5) t 1("2 - Parameter No Differential Item Functioning - effect on theta") xline(0)
LL für 1 - and 2 -parameter models 1 - Parameter 2 –Parameter Belgium -3576. 45 -3455. 79 France -5083. 85 -4887. 21 Germany -4911. 54 -4795. 49 Italy -6485. 03 -6221. 22 Netherlands -3428. 12 -3331. 91 Spain -7603. 61 -7415. 22
DIF for difficulties β (i-contrast) xi 3: i. countryn*item 1 i. countryn*item 2 i. countryn*item 3 i. countryn*item 4 i. countryn*item 5 i. countryn _Icountryn_1 -6 (naturally coded; _Icountryn_1 omitted) unrecognized command: _Icountryn_ r(199); gllamm eurod item 1 -item 5 _Ico 2 Xit- _I 4 co 6 Xit, nocons link(logit) fam(bin) i(pattern) w(wt) constr(2) frload(1) eqs(discrim) adapt dot. Caveat: You will never know later on what contrast you have employed
Belgium ---------------| Coef. Std. Err. ------+-----------item 1 | -5. 060236 . 2046231 item 2 | -8. 197401 . 3721319 item 3 | -7. 625611 . 4503168 item 4 | -1. 636369 . 08049 item 5 | -3. 142707 . 0942269
Item 1 -----------------| Coef. Std. Err. ------+-------------_Ico 2 Xit | . 3273206 . 1845059 France _Ico 3 Xit | . 6340536 . 1725151 Germany _Ico 4 Xit | -. 4935873 . 1723957 Italy _Ico 5 Xit | -. 1209027 . 1988732 Netherlands _Ico 6 Xit | . 1167805 . 1615509 Spain
Item 2 -----------------| Coef. Std. Err. ------+-------------_I 1 co 2 Xit | . 2694966 . 2662902 France _I 1 co 3 Xit | -. 8450162 . 2730304 Germany _I 1 co 4 Xit | -. 6450119 . 2538839 Italy _I 1 co 5 Xit | -. 2683981 . 2922587 Netherlands _I 1 co 6 Xit | -. 2463331 . 2377217 Spain
Item 3 -----------------| Coef. Std. Err. ------+-------------_I 2 co 2 Xit | -. 4286408 . 2792733 France _I 2 co 3 Xit | -. 780114 . 2661109 Germany _I 2 co 4 Xit | -1. 038312 . 2641851 Italy _I 2 co 5 Xit | . 5058603 . 2947703 Netherlands _I 2 co 6 Xit | -. 3856712 . 2397361 Spain
Item 4 -----------------| Coef. Std. Err. ------+-------------_I 3 co 2 Xit | . 607621 . 1018758 France _I 3 co 3 Xit | -. 053771 . 0992247 Germany _I 3 co 4 Xit | -. 1220413 . 0946785 Italy _I 3 co 5 Xit | . 4768741 . 1079205 Netherlands _I 3 co 6 Xit | -. 5042381 . 0935174 Spain
Item 5 -----------------| Coef. Std. Err. ------+-------------_I 4 co 2 Xit | 1. 061981 . 1076839 France _I 4 co 3 Xit | -. 4796974 . 1252521 Germany _I 4 co 4 Xit | . 3253115 . 1061347 Italy _I 4 co 5 Xit | -. 6806979 . 1476796 Netherlands _I 4 co 6 Xit | . 1797599 . 104995 Spain
loadings for random effect 1 ***level 2 (id) var(1): 1 (0) item 1: 3. 8973286 (. 14143303) item 2: 4. 3660867 (. 20470644) item 3: 6. 1098725 (. 35212898) item 4: 2. 1373606 (. 05083788) item 5: 1. 0655632 (. 03739259)
DIF for difficulties β (i-contrast) LL=-30161. 21 Belgium France Germany Italy Netherlands Spain -5. 060236 . 3273206 . 6340536 -. 4935873 -. 1209027 . 1167805 -8. 197401 . 2694966 -. 8450162 -. 6450119 -. 2683981 -. 2463331 -7. 625611 -. 4286408 -. 780114 -1. 03831 . 5058603 -. 3856712 -1. 636369 . 607621 -. 053771 -. 122041 . 4768741 -. 5042381 -3. 142707 1. 061981 -. 4796974 . 3253115 -. 6806979 . 1797599
Germany France Spain Belgium Netherlands Italy
France Belgium Spain Netherlands Italy Germany
Netherlands Belgium Spain France Germany Italy
France Netherlands Belgium Germany Italy Spain
France Italy Spain Belgium Germany Netherlands
DIF for difficulty and discrimination (i-contrast) eq discrimc: item 1 -item 5 _Ico 2 Xit- _I 4 co 6 Xit gllamm eurod item 1 - item 5 _Ico 2 Xit- _I 4 co 6 Xit, link(logit) fam(bin) i(id) eqs(discrimc) constr(2) frload(1) w(wt) nocons adapt dot
Discrimination for Belgium ---------------| Coef. Std. Err. ------+-----------item 1: 2. 9217353 (. 3955187) item 2: 3. 5756061 (. 41036239) item 3: 6. 6334026 (. 86959252) item 4: 2. 0837394 (. 14233753) item 5: . 95331206 (. 112838)
Item 1 _Ico 2 Xit: -. 97672244 (. 46282706) France _Ico 3 Xit: -. 14834368 (. 53854614) Germany _Ico 4 Xit: 1. 1158482 (. 60224724) Italy _Ico 5 Xit: . 32108006 (. 66483885) Netherlands _Ico 6 Xit: . 00363324 (. 47251395) Spain
Item 2 _I 1 co 2 Xit: . 05795306 (. 57767685) France _I 1 co 3 Xit: . 7968 (. 7296182) Germany _I 1 co 4 Xit: 1. 7103824 (. 73387108) Italy _I 1 co 5 Xit: 1. 0374762 (. 86778915) Netherlands _I 1 co 6 Xit: 1. 178677 (. 5917116) Spain
Item 3 _I 2 co 2 Xit: -1. 6862693 (1. 0787816) France _I 2 co 3 Xit: -1. 2215711 (1. 1674393) Germany _I 2 co 4 Xit: . 12178561 _I 2 co 5 Xit: -2. 5445023 (1. 0072729) Netherlands _I 2 co 6 Xit: . 7605634 (1. 1594229) Italy (1. 2962747) Spain
Item 4 _I 3 co 2 Xit: . 20873075 (. 21891064) France _I 3 co 3 Xit: . 05125628 (. 18909945) Germany _I 3 co 4 Xit: . 07868985 (. 18044014) Italy _I 3 co 5 Xit: -. 12776638 (. 20528291) Netherlands _I 3 co 6 Xit: . 15262695 (. 17397662) Spain
Item 5 _I 4 co 2 Xit: -. 3214976 (. 13368081) France _I 4 co 3 Xit: . 13574822 (. 15949164) Germany _I 4 co 4 Xit: . 18829768 (. 13714607) Italy _I 4 co 5 Xit: -. 14969769 (. 18109017) Netherlands _I 4 co 6 Xit: . 50673288 (. 13977853) Spain
Summary • The 5 Items of the HRQOL do not portray one single dimension • Anxiety/Depression measures a different dimension • By means of the precommands xi 3 and constr many IRT models can be specified quite easily • gllamm is a perfect tool for specifying IRT models
- Slides: 62