bridging the gap from logr to irt
DESCRIPTION
Bridging the gap from LogR to IRT. Indebted to: Wu, A. D., & Zumbo, B.D. (2007). Thinking About Item Response Theory from a Logistic Regression Perspective: A Focus on Polytomous Models. - PowerPoint PPT PresentationTRANSCRIPT
Bridging the gap from LogR to IRT
Indebted to:Wu, A. D., & Zumbo, B.D. (2007).
Thinking About Item Response Theory from aLogistic Regression Perspective: A Focus on Polytomous Models.
In Shlomo S. Sawilowsky (Ed.), Real Data Analysis (pp. 241-269). Information Age Publishing, Inc.., Greenwich, CT..
Bridging the gap from LogR to IRT
• The explanatory variable– In IRT, the exposure is a cts latent variable– Hence IRT = generalized linear latent model
• The outcome variable(s)– Logistic regression typically models ONE outcome,
whereas IRT models a number of categorical outcomes simultaneously
Aim of IRT
• To relate a subjects’ responses to a number of test items, to an underlying ability (AKA trait) by way of a mathematical function
• Due to the non-linear relationship, a logistic curve is often used, and is referred to as the Item Characteristic Curve or Item Response Function
ICC / IRF
Increasing prob of correct response
Increasing level of latent trait
Options for form of ICC
Examples• Step function (Guttman)• 2 parameter normal ogive (Lord)• 2 parameter logistic (Birnbaum)• 1 parameter logistic (Rasch)• Nonparametric, monotone increasing (Mokken)
Back to the logistic form
• Two parameter binary logistic IRT model
• θ: ability level
• αi: the slope (AKA discrimination) for item i
• βi: the threshold (AKA difficulty) for item I
• (θ – βi): discrepancy between item & ability of respondent
))(exp(1
))(exp(),,|1(
ii
iiiiiuP
For a single item:
))(exp(1
))(exp(),,|1(
uP
)exp(1
)exp()|1(
Xc
XcXuP
Let X = (θ – βi)& add intercept c
Recall:
-15
-10
-50
5lo
gitp
-6 -4 -2 0 2 4bwt_z
0.2
.4.6
.81
Pr(
hea
dci
rc)
-6 -4 -2 0 2 4bwt_z
Slope
Value of covariate (ability) at point of inflection
So
• For a uni-dimensional IRT model (a single trait θ) the 2PL IRT model is a simple LogR model
• In the binary IRT setting we simultaneously model a number of items
• The parameters for each item may/may-not vary across items
Conditional Independence
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Trait
Before After
The Rasch model
A worked example across multiple packages
Abortion data
Analysis of Multivariate Social Science Data, Second Edition
David J. Bartholomew Fiona SteeleIrini MoustakiJane Galbraith
Dataset actually comes from the first edition so hope it’s still in the second!!!
Idea
• Same Rasch model 4 ways– R (LTM)– Mplus– Raschtest– GLLAMM (via long format data-prepping)
Table 7.1 – attitude towards abortion
Response patterns Freq
1111 141
0000 103
0111 44
0011 21
0001 13
1110 12
0010 10
0100 9
0110 7
1011 6
0101 6
1101 3
1100 3
1000 1
1010 0
1001 0
Total 379
Abortion should be permitted if:
1] The woman decides on her own that she does not wish to have the child
2] The couple agree that they do not wish to have the child
3] The woman is not married and does not wish to marry the man
4] The couple cannot afford any more children
Basic output
SUMMARY OF CATEGORICAL DATA PROPORTIONS
WOMAN Category 1 0.562 Category 2 0.438 COUPLE Category 1 0.406 Category 2 0.594 NOT_MARR Category 1 0.364 Category 2 0.636 AFFORD Category 1 0.383 Category 2 0.617
0.00%
20.00%
40.00%
60.00%
80.00%
100.00%
WOMAN COUPLE NOT_MARR AFFORD
Abortion: [R]
rasch(data = abortion[, c(2, 3, 4, 5)], IRT.param = FALSE)
> summary(rasch1)
Model Summary: log.Lik AIC BIC -657.7894 1325.579 1345.078
Coefficients: value std.err z.valswoman -0.7843 0.2762 -2.8395coupl 1.1288 0.2724 4.1437nt.mr 1.7950 0.2969 6.0453affrd 1.5129 0.2870 5.2716z 4.9064 0.4264 11.5057
Integration:method: Gauss-Hermitequadrature points: 21
Optimization:Convergence: 0 max(|grad|): 0.00097 quasi-Newton: BFGS
plot(rasch1, type = c("ICC"))
par(mfrow = c(2, 2))plot(rasch1, items = c(1), type = c("IIC"), ylim=c(0,7))plot(rasch1, items = c(2), type = c("IIC"), ylim=c(0,7))plot(rasch1, items = c(3), type = c("IIC"), ylim=c(0,7))plot(rasch1, items = c(4), type = c("IIC"), ylim=c(0,7))
margins(rasch2, "two")
Response: (0,0) Item i Item j Obs Exp (O-E)^2/E 1 2 4 111 119.38 0.59 2 1 4 125 133.09 0.49 3 1 2 143 140.62 0.04
Response: (1,0) Item i Item j Obs Exp (O-E)^2/E 1 1 4 13 7.28 4.50 ***2 1 2 5 9.57 2.18 3 2 4 27 20.99 1.72
Response: (0,1) Item i Item j Obs Exp (O-E)^2/E 1 2 4 37 30.81 1.24 2 1 4 80 72.37 0.80 3 3 4 19 21.27 0.24
Response: (1,1) Item i Item j Obs Exp (O-E)^2/E 1 1 4 147 152.26 0.18 2 1 2 155 149.97 0.17 3 3 4 208 203.36 0.11
margins(rasch2, "three")
Response: (0,0,0) Item i Item j Item k Obs Exp (O-E)^2/E 1 1 2 4 111 117.01 0.31 2 2 3 4 102 104.53 0.06 3 1 3 4 110 110.44 0.00
Response: (1,0,0) Item i Item j Item k Obs Exp (O-E)^2/E 1 1 2 4 0 2.37 2.37 2 1 2 3 0 2.04 2.04 3 2 3 4 10 7.63 0.74
Response: (0,1,0) Item i Item j Item k Obs Exp (O-E)^2/E 1 1 3 4 15 22.65 2.58 2 2 3 4 9 14.85 2.30 3 1 2 4 14 16.08 0.27
Response: (1,1,0) Item i Item j Item k Obs Exp (O-E)^2/E 1 1 2 4 13 4.90 13.38 ***2 1 3 4 11 5.56 5.33 ***3 2 3 4 17 13.36 0.99
Response: (0,0,1) Item i Item j Item k Obs Exp (O-E)^2/E 1 1 2 4 32 23.61 2.98 2 1 2 3 29 26.93 0.16 3 2 3 4 12 11.20 0.06
Response: (1,0,1) Item i Item j Item k Obs Exp (O-E)^2/E 1 1 3 4 2 4.19 1.15 2 2 3 4 7 10.07 0.94 3 1 2 3 5 7.53 0.85
Response: (0,1,1) Item i Item j Item k Obs Exp (O-E)^2/E 1 2 3 4 25 19.61 1.48 2 1 3 4 63 55.29 1.08 3 1 2 3 49 51.00 0.08
Response: (1,1,1) Item i Item j Item k Obs Exp (O-E)^2/E 1 1 2 3 151 146.10 0.16 2 1 2 4 142 145.07 0.06 3 1 3 4 145 148.07 0.06
'***' denotes a chi-squared residual greater than 3.5
Abortion: [Mplus]
Read the data into Mplus
data: file is "abortion_attitude.txt";
variable: names are woman couple not_marr afford num; categorical are woman couple not_marr afford; usevariables are woman couple not_marr afford;
freqweight = num;
analysis: type = basic;
Basic output – sample stats
FIRST ORDER SAMPLE PROPORTIONS : WOMAN COUPLE NOT_MARR AFFORD ________ ________ ________ ________ 1 0.438 0.594 0.636 0.617
SECOND ORDER SAMPLE PROPORTIONS WOMAN COUPLE NOT_MARR AFFORD ________ ________ ________ ________ WOMAN COUPLE 0.420 NOT_MARR 0.420 0.538 AFFORD 0.396 0.512 0.559
SAMPLE THRESHOLDS WOMAN$1 COUPLE$1 NOT_MARR AFFORD$1 ________ ________ ________ ________ 1 0.156 -0.237 -0.347 -0.299
Basic output – sample stats
SAMPLE TETRACHORIC CORRELATIONS
WOMAN COUPLE NOT_MARR AFFORD ________ ________ ________ ________ WOMAN COUPLE 0.902 NOT_MARR 0.866 0.882 AFFORD 0.768 0.821 0.903
STANDARD DEVIATIONS FOR SAMPLE TETRACHORIC CORRELATIONS
WOMAN COUPLE NOT_MARR AFFORD ________ ________ ________ ________ WOMAN COUPLE 0.125 NOT_MARR 0.158 0.137 AFFORD 0.217 0.181 0.120
Rasch model in Mplus
data: file is “...abortion_attitude.txt";
variable: names are woman couple not_marr afford num; usevariables are woman couple not_marr afford; categorical are woman couple not_marr afford;
freqweight = num;
analysis: ESTIMATOR = MLR;
model: F by woman* (1) couple (1) not_marr (1) afford (1); F@1;
plot: type = plot3;
Mplus results
TESTS OF MODEL FIT
Loglikelihood
H0 Value -709.937 H0 Scaling Correction Factor 1.009 for MLR
Information Criteria Number of Free Parameters 5 Akaike (AIC) 1429.874 Bayesian (BIC) 1449.562 Sample-Size Adjusted BIC 1433.698 (n* = (n + 2) / 24)
Chi-Square Test of Model Fit for the Binary and Ordered Categorical (Ordinal) Outcomes
Pearson Chi-Square Value 22.788 Degrees of Freedom 10 P-Value 0.0116
Likelihood Ratio Chi-Square Value 22.595 Degrees of Freedom 10 P-Value 0.0123
Mplus results
Two-Tailed Estimate S.E. Est./S.E. P-Value
F BY WOMAN 4.336 0.390 11.124 0.000 COUPLE 4.336 0.390 11.124 0.000 NOT_MARR 4.336 0.390 11.124 0.000 AFFORD 4.336 0.390 11.124 0.000
Thresholds WOMAN$1 0.776 0.311 2.496 0.013 COUPLE$1 -1.047 0.306 -3.417 0.001 NOT_MARR$1 -1.573 0.315 -4.994 0.000 AFFORD$1 -1.339 0.322 -4.161 0.000
Variance of F 1.000 0.000 999.000 999.000
IRT PARAMETERIZATION IN TWO-PARAMETER LOGISTIC METRICWHERE THE LOGIT IS 1.7*DISCRIMINATION*(THETA - DIFFICULTY)
Item Discriminations
F BY WOMAN 2.551 0.229 11.124 0.000 COUPLE 2.551 0.229 11.124 0.000 NOT_MARR 2.551 0.229 11.124 0.000 AFFORD 2.551 0.229 11.124 0.000
Item Difficulties WOMAN$1 0.179 0.071 2.514 0.012 COUPLE$1 -0.241 0.072 -3.353 0.001 NOT_MARR$1 -0.363 0.074 -4.913 0.000 AFFORD$1 -0.309 0.074 -4.199 0.000
Variance of F 1.000 0.000 999.000 999.000
ICC’s
Abortion: [Stata] –Raschtest–
raschtest
woman couple not_marr afford, meandifficc
Estimation method: Conditional maximum likelihood (CML)Number of items: 4Number of groups: 5 (3 of them are used to compute the statistics of test)Number of individuals: 365 (0 individuals removed for missing values)Number of individuals with null or perfect score: 242Conditional log-likelihood: -131.2562 Log-likelihood: -320.5403
Difficulty Standardized Items parameters Std. Err. R1c df p-value Outfit Infit U----------------------------------------------------------------------------- woman 1.64747 0.19064 1.940 2 0.3790 -1.232 -0.422 -1.411 couple -0.19486 0.16979 2.342 2 0.3100 -0.574 -0.313 -0.838 not_marr -0.87046 0.18302 1.580 2 0.4538 -1.272 -1.467 -0.854 afford -0.58216 0.17588 3.937 2 0.1397 2.336 2.113 3.015----------------------------------------------------------------------------- R1c test R1c= 15.343 6 0.0177 Andersen LR test Z= 14.594 6 0.0237-----------------------------------------------------------------------------The mean of the difficulty parameters is fixed to 0You have groups of scores with less than 30 individuals. The tests can be
invalid.
Ability Expected Group Score parameters Std. Err. Freq. Score ll -------------------------------------------------------------- 0 0 -2.560 2.860 102 0.38 -------------------------------------------------------------- 1 1 -1.114 0.814 29 1.15 -31.4221 -------------------------------------------------------------- 2 2 -0.109 0.664 33 1.97 -39.3159 -------------------------------------------------------------- 3 3 1.054 0.984 61 2.84 -53.2214 -------------------------------------------------------------- 4 4 2.833 3.626 140 3.66 --------------------------------------------------------------
0.2
5.5
.75
1
-2 -1 0 1 2Latent trait
Observed ICC Expected ICC
Observed and Expected ICC for the item woman
0.2
5.5
.75
1
-2 -1 0 1 2Latent trait
Observed ICC Expected ICC
Observed and Expected ICC for the item couple0
.25
.5.7
51
-2 -1 0 1 2Latent trait
Observed ICC Expected ICC
Observed and Expected ICC for the item not_marr
0.2
5.5
.75
1
-2 -1 0 1 2Latent trait
Observed ICC Expected ICC
Observed and Expected ICC for the item afford
raschtest woman couple not_marr afford, method(mml)
Estimation method: Marginal maximum likelihood (MML)Number of items: 4Number of groups: 5 (5 of them are used to compute the statistics of test)Number of individuals: 365 (0 individuals removed for missing values)Number of individuals with null or perfect score: 242Marginal log-likelihood: -665.8056 Log-likelihood: -281.5298
Difficulty Standardized Items parameters Std. Err. R1m df p-value Outfit Infit---------------------------------------------------------------------- woman 1.25298 0.26213 4.606 2 0.0999 -2.624 0.164 couple -0.66034 0.30265 18.408 2 0.0001 . -3.567 not_marr -1.27117 0.29512 11.668 2 0.0029 . -0.046 afford -1.02314 0.29784 26.037 2 0.0000 . -0.611---------------------------------------------------------------------- R1m test R1m= 31.056 8 0.0001---------------------------------------------------------------------- Sigma 4.12109 0.28776----------------------------------------------------------------------You have groups of scores with less than 30 individuals. The tests can be
invalid.
Ability Expected Group Score parameters Std. Err. Freq. Score --------------------------------------------------- 0 0 -4.33624 1.60486 102 0.11 --------------------------------------------------- 1 1 -2.24208 0.68050 29 0.70 --------------------------------------------------- 2 2 -1.29596 1.34362 33 1.34 --------------------------------------------------- 3 3 2.05542 0.97822 61 3.55 --------------------------------------------------- 4 4 3.91275 1.56707 140 3.91 ---------------------------------------------------
Abortion: [Stata] –GLLAMM–
Rasch model – data prepping
Difficulty
The data
+---------------------------------------+ | woman couple not_marr afford num | |---------------------------------------| 1. | 1 1 1 1 141 | 2. | 0 0 0 0 103 | 3. | 0 1 1 1 44 | 4. | 0 0 1 1 21 | 5. | 0 0 0 1 13 | 6. | 1 1 1 0 12 | 7. | 0 0 1 0 10 | 8. | 0 1 0 0 9 | |---------------------------------------| 9. | 0 1 1 0 7 | 10. | 1 0 1 1 6 | 11. | 0 1 0 1 6 | 12. | 1 1 0 1 3 | 13. | 1 1 0 0 3 | 14. | 1 0 0 0 1 | 15. | 1 0 1 0 0 | 16. | 1 0 0 1 0 | +---------------------------------------+
The data
+---------------------------------------+ | woman couple not_marr afford num | |---------------------------------------| 1. | 1 1 1 1 141 | 2. | 0 0 0 0 103 | 3. | 0 1 1 1 44 | 4. | 0 0 1 1 21 | 5. | 0 0 0 1 13 | 6. | 1 1 1 0 12 | 7. | 0 0 1 0 10 | 8. | 0 1 0 0 9 | |---------------------------------------| 9. | 0 1 1 0 7 | 10. | 1 0 1 1 6 | 11. | 0 1 0 1 6 | 12. | 1 1 0 1 3 | 13. | 1 1 0 0 3 | 14. | 1 0 0 0 1 | 15. | 1 0 1 0 0 | 16. | 1 0 0 1 0 | +---------------------------------------+
+---------------------+ | i1 i2 i3 i4 num | |---------------------| 1. | 1 1 1 1 141 | 2. | 0 0 0 0 103 | 3. | 0 1 1 1 44 | 4. | 0 0 1 1 21 | 5. | 0 0 0 1 13 | 6. | 1 1 1 0 12 | 7. | 0 0 1 0 10 | 8. | 0 1 0 0 9 | |---------------------| 9. | 0 1 1 0 7 | 10. | 1 0 1 1 6 | 11. | 0 1 0 1 6 | 12. | 1 1 0 1 3 | 13. | 1 1 0 0 3 | 14. | 1 0 0 0 1 | 15. | 1 0 1 0 0 | 16. | 1 0 0 1 0 | +---------------------+
Reshape
+-----------------------------------+| i1 i2 i3 i4 num pattern ||-----------------------------------|| 1 1 1 1 141 1 || 0 0 0 0 103 2 || 0 1 1 1 44 3 || 0 0 1 1 21 4 ||-----------------------------------|
+------------------------------+ | pattern item score num | |------------------------------| | 1 1 1 141 | | 1 2 1 141 | | 1 3 1 141 | | 1 4 1 141 | |------------------------------| | 2 1 0 103 | | 2 2 0 103 | | 2 3 0 103 | | 2 4 0 103 | |------------------------------| | 3 1 0 44 | | 3 2 1 44 | | 3 3 1 44 | | 3 4 1 44 | |------------------------------|
gen pattern = _nreshape long i, i(pattern) j(item)rename i score
Create dummies for the 4 items
+------------------------------------------------------------------------------+| pattern item score num d1 d2 d3 d4 negd1 negd2 negd3 negd4 ||------------------------------------------------------------------------------|| 1 1 1 141 1 0 0 0 -1 0 0 0 || 1 2 1 141 0 1 0 0 0 -1 0 0 || 1 3 1 141 0 0 1 0 0 0 -1 0 || 1 4 1 141 0 0 0 1 0 0 0 -1 ||------------------------------------------------------------------------------|| 2 1 0 103 1 0 0 0 -1 0 0 0 || 2 2 0 103 0 1 0 0 0 -1 0 0 || 2 3 0 103 0 0 1 0 0 0 -1 0 || 2 4 0 103 0 0 0 1 0 0 0 -1 |+------------------------------------------------------------------------------+…etc.
tab item, gen(d)forvalues i=1/4 {
gen negd`i' = -d`i'}
Relate this back to original equation
+------------------------------------------------------------------------------+| pattern item score num d1 d2 d3 d4 negd1 negd2 negd3 negd4 ||------------------------------------------------------------------------------|| 1 1 1 141 1 0 0 0 -1 0 0 0 || 1 2 1 141 0 1 0 0 0 -1 0 0 || 1 3 1 141 0 0 1 0 0 0 -1 0 || 1 4 1 141 0 0 0 1 0 0 0 -1 ||------------------------------------------------------------------------------|
Rasch model using GLLAMM
• Rename num wt2
(shows that weighting applies at level-2 i.e. person level)
• constraint def 1 [patt1]_cons = 1
• gllamm score negd1-negd4, i(pattern) ///
weight(wt) ///
link(logit) ///
family(binomial) ///
frload(1) constr(1) ///
nip(15) nocons adapt trace
Rasch results
log likelihood = -852.8413222195184 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval]-------------+---------------------------------------------------------------- negd1 | .333879 .1287913 2.59 0.010 .0814527 .5863054 negd2 | -.4827996 .1301057 -3.71 0.000 -.7378022 -.2277971 negd3 | -.7138122 .1321945 -5.40 0.000 -.9729087 -.4547158 negd4 | -.6117231 .131175 -4.66 0.000 -.8688214 -.3546249------------------------------------------------------------------------------ Variances and covariances of random effects------------------------------------------------------------------------------
***level 2 (pattern) var(1): 1 (0)------------------------------------------------------------------------------
We constrained this to unit variance
Plot ICC’s0
.2.4
.6.8
1
-5 0 5x
Woman CoupleNot_married Afford
twoway(function Woman =invlogit(x-[score]negd1), range(-6 6)) /// (function Couple =invlogit(x-[score]negd2), range(-6 6) lpatt(".")) /// (function Not_married =invlogit(x-[score]negd3), range(-6 6) lpatt("-")) /// (function Afford =invlogit(x-[score]negd4), range(-6 6) lpatt("_"))
---------------------------- | Coef.
------------------+--------- negd1 (woman) | .334 negd2 (couple) | -.483 negd3 (not_marr) | -.714 negd4 (afford) | -.612 ----------------------------
Curves are parallelFirst item is most “difficult”
GLLAMM versus raschtest
• Raschtest – Avoids the need to derive dummy variables– Needs complete dataset, not frequency-weights– Reformats the dataset in the background so no need
to do it yourself– Can employ CML (an estimation specific to Rasch
models) which requires no integration
Polytomous IRT
Extension to polytomous IRT
• We now have a hierarchy of parameters to model
1. At the test level• A number of items models simultaneously with the
potential for parameters to vary across items
2. At the item level• Contrasts are used to model the response categories
within each item. Parameters may/may-not vary across response categories.
So when faced with a set of polytomous items
We must decide
1. The payoff from not collapsing into binary items
2. The form of contrasts needed to model over response categories within items
3. Any constraints required across these response categories
4. Any parameter constraints across items within a single test
4 commonly used polytomous IRT models
• Partial Credit model (PCM)– Masters (1982)
• Rating Scale model (RSM)– Andrich (1978a/b)
• Graded Response model (GRM)– Samejima (1969)
• Nominal Response model (NRM)– Bock (1972)
Partial Credit Model
Partial Credit Model (PCM)
• Designed for items where you can obtain a “partial credit”, e.g.
0 = solved nothing,
1 = solved part A,
2 = solved parts A and B
• i.e. those who scored a ‘2’ can also be thought of as having achieved a ‘1’
Partial Credit Model (PCM)
– Here items scored from 0 to m, however it’s possible for items to have differing numbers of categories
– βij is referred to as the “step parameter”
)](exp[
)](exp[)| itemfor levelattain (
00
0
ij
r
j
m
r
ij
x
jixP
0)(with
0
0ij
j
Partial Credit Model (PCM)
)]()exp[(]exp[1
)]()exp[()|2 (
211
21
xP
)]()exp[(]exp[1
1)|0 (
211
xP
)]()exp[(]exp[1
]exp[)|1 (
211
1
xP
E.g. for an item with three categories 0,1,2:
Same format as adjacent category ordinal model
))()exp(()exp(1
)exp()|1(
110011
11
XcXcXc
XcXuP
))()exp(()exp(1
))()exp(()|0(
110011
1100
XcXcXc
XcXcXuP
))()exp(()exp(1
1)|2(
110011 XcXcXcXuP
Hence, PCM is a DIRECT or divide-by-total model
Collapse to two category levels:
]exp[1
1)|0 (
1
xP
]exp[1
]exp[)|1 (
1
1
xP
Or for an item with two categories 0,1:
i.e. the familiar 1PL or Rasch model- the PCM is the polytomous extension of the Rasch model
Step parameters
βij “step parameters”
occur at the intersection
of adjacent ICC’s
- thresholds for transition
from one category to
the next
Disordering of steps
Suggests lack of ordinality
e.g. 1/3/2/4 instead of 1/2/3/4
Partial Credit Model (PCM)
Outcome
Level 1 C1
Level 2 C1 C2
Level 3 C2 C3
Level 4 C3
Within item constraints
Ideally want ordering of steps so that each response category is endorsed in turn as trait level increases
Across item constraints
Rasch-based hence items have equal discrimination. This can be relaxed to give Generalised PCM but this loses the desirable Rasch properties
Adjacent category model
Rating Scale Model
Rating Scale Model (RSM)
• Traditionally used for attitudes data
• Constrained form of PCM, hence is also Rasch
Rating Scale Model (RSM)
)](exp[
)](exp[)(
00
0
ij
r
j
m
r
ij
x
jijP
)](exp[
)](exp[)(
00
0
ji
r
j
m
r
ji
x
jijP
PCM RSM
Probabilities estimated directly, as with PCMNot suitable for items with differing response formats
All items share same step parameters δj
There is a location parameter βi which can vary across items
Rating Scale Model (RSM)
Outcome
Level 1 C1
Level 2 C1 C2
Level 3 C2 C3
Level 4 C3
Adjacent category model Within item constraints
Ideally want ordering of steps so that each response category endorsed in turn as trait level increases
Across item constraints
Constrained, more parsimonious version of PCM Only appropriate for instance where all items have same number of response categories + have same response options (text)
Graded Response Model
Graded Response Model (GRM)
)exp(1
)exp()|(
Xc
XcXjuP
j
j
)](exp[1
)](exp[)|(
iji
ijijuP
This is the IRT equivalent of the contrasts described earlier for the POM:
Consequently
• The Graded Response Model is a difference or indirect IRT model, in contrast to the PCM/RSM
• The βij are thresholds with interpretation akin to the binary 1PL/2PL models– The ability level for which the probability of making a response
equal to or greater than the threshold j is 50%
• Plots of P(u ≥ j |θ) are Operating Characteristic Curves
ICC’s for GHQ-01 under GRM
GRM parameters correspond to where p=0.5 crosses each OCC in turn
ICC’s for GHQ-01 under GRM
ICC’s obtained by subtraction
ICC’s for GHQ-01 under GRM
1st and last GRM parameters can also be obtained from equivalent ICC plot: where p=0.5 crosses ICC’s #1, #4
Graded Response Model (GRM)
Outcome
Level 1 C1C2
C3Level 2
C1Level 3C2
Level 4 C3
Within item constraints
Discrimination αi equal across item levels= homogeneous GRM ~ POM
Without this, the OCC’s will cross at some trait level hence the difference can be negative
Across item constraints
Discrimination αi differ across itemsβij differ across items
βij = ci + bj = Modified GRM
)](exp[1
)](exp[)(
iji
ijijuP
Location Thresholds
Nominal Response Model
Nominal Response Model (NRM)
)exp(
)exp()(
0
ijij
J
j
ijijij
c
cP
Nominal Response Model (NRM)
Within items
Across items
Outcome
Level 1 C1 C2 C3
Level 2 C1
Level 3 C2
Level 4 C3
Contrasts relative to baseline As in multinomial logistic model
Some ordinal examples
Winsteps: PCM and RSM
Ego-GHQ Odd items
Winsteps
• Specialist package for fitting IRT models of the Rasch family• John M Linacre• www.winsteps.com
• Estimation using Joint Maximum Likelihood• Impressive array of output tables and figures
[Winsteps] PCM
Partial Credit in Winsteps
The conventional representation of the Partial Credit model is
log ( Pnij / Pni(j-1) ) = θn - βij
Winsteps parameterizes βij as βi + δij where sum(δij) = 0. And βi is the
average (βij).
log ( Pnij / Pni(j-1) ) = θn - βi - δij
Algebraically these two representations are identical. Thus every item has a mean difficulty, βi. (~location)This simplifies communication, because the results of a Partial Credit
analysis now have the same form as any other polytomous analysis supported by Winsteps.
PCM step parameters (table 3.2)
FOR GROUPING "0" Item NUMBER: 2 ghq03 Item DIFFICULTY MEASURE OF 1.10 ADDED TO MEASURES-------------------------------------------------------------------|CATEGORY OBSERVED|OBSVD SAMPLE|INFIT OUTFIT||STRUCTURE|CATEGORY||LABEL SCORE COUNT %|AVRGE EXPECT| MNSQ MNSQ||CALIBRATN| MEASURE||-------------------+------------+------------++---------+--------|| 0 0 116 10| -1.24 -2.27| 1.61 1.45|| NONE |( -4.36)| 0| 1 1 783 71| -.41 -.27| 1.12 1.13|| -4.36 | -.43 | 1| 2 2 167 15| 1.96 1.95| .98 .98|| 1.32 | 3.28 | 2| 3 3 43 4| 3.27 3.52| 1.24 1.36|| 3.04 |( 5.35)| 3-------------------------------------------------------------------
STRUCTURE CALIBRATN, the calibrated measure of the transition from the category below to this category.
This is an estimate of the Rasch-Andrich model parameter, δj. Use this for anchoring in Winsteps.
(This corresponds to δj in the βi+δj parameterization of the "Rating Scale" model, and is similarly applied as the δij of the βij=βi+δij of the "Partial Credit" model.) The bottom category has no prior transition, and so that the measure is shown as NONE.
CATEGORY PROBABILITIES: MODES - Structure measures at intersectionsP -+---------+---------+---------+---------+---------+---------+-R 1.0 + +O | 333|B | 111111 33 |A |0 111 111 33 |B .8 + 00 11 1 33 +I | 0 1 11 3 |L | 0 11 1 3 |I | 0 1 1 3 |T .6 + 0 1 1 3 +Y | 0 1 1 222 3 | .5 + * 1 22 22 3 +O | 1 0 2* *2 |F .4 + 1 0 2 1 3 2 + | 1 0 2 1 3 2 |R | 1 00 22 1 3 2 |E | 1 0 2 13 22 |S .2 + 11 0 22 311 2 +P |1 00 2 3 1 22 |O | 000 222 33 11 222 |N | 22****0 3333 1111 222|S .0 +*******************3333333*******00000000000000000***********+E -+---------+---------+---------+---------+---------+---------+- -6 -4 -2 0 2 4 6 Person [MINUS] Item MEASURE
PCM – location/difficulty parameters (table 13.1)
--------------------------------------------------------------------------------------------|ENTRY TOTAL MODEL| INFIT | OUTFIT |PT-MEASURE |EXACT MATCH| ||NUMBER SCORE COUNT MEASURE S.E. |MNSQ ZSTD|MNSQ ZSTD|CORR. EXP.| OBS% EXP%| Item ||------------------------------------+----------+----------+-----------+-----------+-------|| 6 745 1119 2.34 .06|1.09 1.7| .94 -.6| .72 .73| 62.8 67.0| ghq11 || 2 1267 1119 1.10 .07|1.23 4.3|1.22 3.4| .58 .68| 74.3 74.6| ghq03 || 5 1398 1119 .69 .05| .76 -6.2| .80 -4.8| .83 .77| 69.5 59.6| ghq09 || 3 1593 1119 .20 .05| .98 -.4| .98 -.6| .76 .75| 62.7 61.5| ghq05 || 1 1548 1119 .08 .06| .90 -2.2| .88 -2.2| .73 .70| 76.6 71.7| ghq01 || 4 1605 1119 -.01 .06| .97 -.7| .95 -.9| .73 .72| 70.9 68.1| ghq07 ||------------------------------------+----------+----------+-----------+-----------+-------|| MEAN 1359.3 1119.0 .73 .06| .99 -.6| .96 -1.0| | 69.4 67.1| || S.D. 299.4 .0 .81 .01| .15 3.3| .13 2.4| | 5.3 5.3| |--------------------------------------------------------------------------------------------
PCM: Individual expected score ICC’s
PCM: Item Information Functions
PCM:
[Winsteps] RSM
PCM → RSM in Winsteps
Winsteps parameterization of PCM:
log ( Pnij / Pni(j-1) ) = θn - βi - δij
This is comparable to the familiar RSM formulation
log ( Pnij / Pni(j-1) ) = θn - βi – δj
Recall in the RSM, items share the same step parameters.Winsteps deals with this by grouping the J items.
J groups → PCM, 1 group → RSMk (< J) groups → somewhere in between
PCM input file&INST TITLE = C:\work\courses\summer_school\GHQ_IRT\Winsteps\ego_ghq12_id_0123.dta PERSON = Person ; persons are ... ITEM = Item ; items are ... ITEM1 = 1 ; column of response to first item in data record NI = 6 ; number of items NAME1 = 8 ; column of first character of person identifying labelNAMELEN = 1 ; length of person label XWIDE = 1 ; number of columns per item response CODES = 0123 ; valid codes in data file UPMEAN = 0 ; person mean for local origin USCALE = 1 ; user scaling for logits UDECIM = 2 ; reported decimal places for user scalingISGROUPS = 000000 ; Item Scale Grouping for modeling rating scales; STATA file created or last modified: 25/08/2009 18:28:37; : 25 Aug 2009 18:28; STATA Cases processed = 1119; STATA Variables processed = 14TOTALSCORE = Yes ; Include extreme responses in reported scores; Person Label variables: columns in label: columns in line
&ENDghq01ghq03ghq05ghq07ghq09ghq11END LABELS311332333333222322111210102210
RSM input file&INST TITLE = C:\work\courses\summer_school\GHQ_IRT\Winsteps\ego_ghq12_id_0123.dta PERSON = Person ; persons are ... ITEM = Item ; items are ... ITEM1 = 1 ; column of response to first item in data record NI = 6 ; number of items NAME1 = 8 ; column of first character of person identifying labelNAMELEN = 1 ; length of person label XWIDE = 1 ; number of columns per item response CODES = 0123 ; valid codes in data file UPMEAN = 0 ; person mean for local origin USCALE = 1 ; user scaling for logits UDECIM = 2 ; reported decimal places for user scalingISGROUPS = AAAAAA ; Item Scale Grouping for modeling rating scales; STATA file created or last modified: 25/08/2009 18:28:37; : 25 Aug 2009 18:28; STATA Cases processed = 1119; STATA Variables processed = 14TOTALSCORE = Yes ; Include extreme responses in reported scores; Person Label variables: columns in label: columns in line
&ENDghq01ghq03ghq05ghq07ghq09ghq11END LABELS311332333333222322111210102210
RSM step parameters (δj)
• Single table for step parameters as they are shared by all items
SUMMARY OF CATEGORY STRUCTURE. Model="R"-------------------------------------------------------------------|CATEGORY OBSERVED|OBSVD SAMPLE|INFIT OUTFIT||STRUCTURE|CATEGORY||LABEL SCORE COUNT %|AVRGE EXPECT| MNSQ MNSQ||CALIBRATN| MEASURE||-------------------+------------+------------++---------+--------|| 0 0 1249 19| -3.10 -3.10| 1.06 1.02|| NONE |( -4.27)| 0| 1 1 3278 49| -1.32 -1.29| .95 .92|| -3.15 | -1.42 | 1| 2 2 1629 24| .74 .62| .89 .89|| .35 | 1.59 | 2| 3 3 498 7| 2.43 2.62| 1.20 1.22|| 2.81 |( 3.96)| 3-------------------------------------------------------------------
CATEGORY PROBABILITIES: MODES - Structure measures at intersectionsP -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-R 1.0 + +O | |B | |A |00 |B .8 + 00 +I | 00 1111 33|L | 0 111 111 3 |I | 0 11 11 22 3 |T .6 + 00 1 1 222 222 33 +Y | 0 11 1 22 22 3 | .5 + * 112 23 +O | 1 0 221 322 |F .4 + 1 0 2 1 3 2 + | 11 00 2 1 3 22 |R | 1 0 22 1 3 2 |E | 11 0 2 11 33 22|S .2 + 11 00 22 13 +P |11 0022 3311 |O | 222000 333 111 |N | 22222 00000 3333 1111 |S .0 +**************3333333333333333*000000000000000000******+E -+-----+-----+-----+-----+-----+-----+-----+-----+-----+- -5 -4 -3 -2 -1 0 1 2 3 4 Person [MINUS] Item MEASURE
Single ICC plot since “person minus item measure” is constant for all items
RSM difficulty parameters (βi)
TABLE 13.1 C:\work\courses\summer_school\GHQ_IRT\ ZOU638WS.TXT Aug 26 8:32 2009INPUT: 1119 Persons 6 Items MEASURED: 1119 Persons 6 Items 4 CATS 3.67.0--------------------------------------------------------------------------------Person: REAL SEP.: 1.91 REL.: .78 ... Item: REAL SEP.: 16.26 REL.: 1.00
Item STATISTICS: MEASURE ORDER-------------------------------------------------------------------------------------------
|ENTRY TOTAL MODEL| INFIT | OUTFIT |PT-MEASURE |EXACT MATCH| ||NUMBER SCORE COUNT MEASURE S.E. |MNSQ ZSTD|MNSQ ZSTD|CORR. EXP.| OBS% EXP%| Item ||------------------------------------+----------+----------+-----------+-----------+------|| 6 745 1119 2.85 .06|1.39 8.1|1.20 3.7| .74 .72| 60.6 69.3| ghq11|| 2 1267 1119 1.12 .06|1.03 .8|1.00 .1| .60 .73| 67.6 63.5| ghq03|| 5 1398 1119 .72 .05|1.10 2.4|1.11 2.5| .82 .73| 55.5 62.8| ghq09|| 1 1548 1119 .28 .05| .72 -7.4| .72 -7.2| .74 .73| 73.9 63.3| ghq01|| 3 1593 1119 .14 .05|1.05 1.1|1.04 .9| .75 .73| 62.7 63.6| ghq05|| 4 1605 1119 .11 .05| .83 -4.2| .83 -4.1| .73 .73| 70.7 63.6| ghq07||------------------------------------+----------+----------+-----------+-----------+------|| MEAN 1359.3 1119.0 .87 .06|1.02 .1| .98 -.7| | 65.1 64.3| || S.D. 299.4 .0 .95 .00| .21 4.9| .16 3.8| | 6.2 2.2| |-------------------------------------------------------------------------------------------
RSM: Individual expected score ICC’s
RSM: Individual expected score ICC’s
Compare parameters
PCM RSM
Item βi δ1 δ2 δ3 βi δ1 δ2 δ3
ghq11 2.34 -1.90 0.03 1.87 2.85 -3.15 0.35 2.81
ghq3 1.10 -4.36 1.32 3.04 1.12 “ “ “
ghq9 0.69 -2.23 -0.06 2.29 0.72 “ “ “
ghq1 0.20 -4.51 1.01 3.50 0.28 “ “ “
ghq5 0.08 -3.03 0.20 2.83 0.14 “ “ “
ghq7 -0.01 -4.04 0.76 3.29 0.11 “ “ “
Note in this set up, sum of step parameters = zero for each item
Compare item fit
PCM-------------------------------------------------------------------------------------------|ENTRY TOTAL MODEL| INFIT | OUTFIT |PT-MEASURE |EXACT MATCH| ||NUMBER SCORE COUNT MEASURE S.E. |MNSQ ZSTD|MNSQ ZSTD|CORR. EXP.| OBS% EXP%| Item ||------------------------------------+----------+----------+-----------+-----------+------|| 2 1267 1119 1.10 .07|1.23 4.3|1.22 3.4|A .58 .68| 74.3 74.6| ghq03|| 6 745 1119 2.34 .06|1.09 1.7| .94 -.6|B .72 .73| 62.8 67.0| ghq11|| 3 1593 1119 .20 .05| .98 -.4| .98 -.6|C .76 .75| 62.7 61.5| ghq05|| 4 1605 1119 -.01 .06| .97 -.7| .95 -.9|c .73 .72| 70.9 68.1| ghq07|| 1 1548 1119 .08 .06| .90 -2.2| .88 -2.2|b .73 .70| 76.6 71.7| ghq01|| 5 1398 1119 .69 .05| .76 -6.2| .80 -4.8|a .83 .77| 69.5 59.6| ghq09||------------------------------------+----------+----------+-----------+-----------+------|
RSM-------------------------------------------------------------------------------------------|ENTRY TOTAL MODEL| INFIT | OUTFIT |PT-MEASURE |EXACT MATCH| ||NUMBER SCORE COUNT MEASURE S.E. |MNSQ ZSTD|MNSQ ZSTD|CORR. EXP.| OBS% EXP%| Item ||------------------------------------+----------+----------+-----------+-----------+------|| 2 1267 1119 1.12 .06|1.03 .8|1.00 .1|c .60 .73| 67.6 63.5| ghq03|| 6 745 1119 2.85 .06|1.39 8.1|1.20 3.7|A .74 .72| 60.6 69.3| ghq11|| 3 1593 1119 .14 .05|1.05 1.1|1.04 .9|C .75 .73| 62.7 63.6| ghq05|| 4 1605 1119 .11 .05| .83 -4.2| .83 -4.1|b .73 .73| 70.7 63.6| ghq07|| 1 1548 1119 .28 .05| .72 -7.4| .72 -7.2|a .74 .73| 73.9 63.3| ghq01|| 5 1398 1119 .72 .05|1.10 2.4|1.11 2.5|B .82 .73| 55.5 62.8| ghq09||------------------------------------+----------+----------+-----------+-----------+------|
Test Information Function: PCM/RSM
0.00
0.50
1.00
1.50
2.00
2.50
-8 -6 -4 -2 0 2 4 6 8
RSM
PCM
[R] PCM versus RSM
Using the package –eRm–
eRm
• extended Rasch modelling
• Similar parameterization to Winsteps– For both PCM/RSM the step parameter βij is split into
βi and δij (or δj)
• Different estimation to Winsteps– Uses Conditional Maximum Likelihood (CML), as
used in -raschtest-, which is computationally easier than JML
PCM: Example with 2 items (sum0 = TRUE)
jj
jiji
iii
iii
ii
thresholdlocation
threshold
threshold
threshold
323
212
11
eta 1 eta 2 eta 3 eta 4 eta 5beta ghq01.c1 -1 -1 -1 -1 -1beta ghq01.c2 1 0 0 0 0beta ghq01.c3 0 1 0 0 0beta ghq03.c1 0 0 1 0 0beta ghq03.c2 0 0 0 1 0beta ghq03.c3 0 0 0 0 1
Model parameters eta eta 1 1.6555484 eta 2 -1.6267047 eta 3 1.8482333 eta 4 -0.4656337 eta 5 -4.1723330
Model matrix W
βij = W*etaItem Easiness Parameters (beta):beta ghq01.c1 2.761 beta ghq01.c2 1.656beta ghq01.c3 -1.627 beta ghq03.c1 1.848 beta ghq03.c2 -0.466beta ghq03.c3 -4.172
Location Threshold 1 Threshold 2 Threshold 3ghq01 0.54223 -2.76089 1.10534 3.28225ghq03 1.39078 -1.84823 2.31387 3.70670
Design Matrix
0,
ji
ij
RSM: Example with 2 items (sum0 = TRUE)
jj
jiji
iii
iii
ii
thresholdlocation
threshold
threshold
threshold
323
212
11
eta 1 eta 2 eta 3beta ghq01.c1 -1 0 0beta ghq01.c2 -2 1 0beta ghq01.c3 -3 0 1beta ghq03.c1 1 0 0beta ghq03.c2 2 1 0beta ghq03.c3 3 0 1
Model parameters etaeta 1 -0.4978386 eta 2 -3.9701867 eta 3 -9.8605819
Model matrix W
βij = W*etaItem Easiness Parameters (beta):beta ghq01.c1 0.498beta ghq01.c2 -2.975beta ghq01.c3 -8.367beta ghq03.c1 -0.498beta ghq03.c2 -4.966 beta ghq03.c3 -11.354
Location Threshold 1 Threshold 2 Threshold 3ghq01 2.78902 -0.49784 3.47235 5.39256ghq03 3.78470 0.49784 4.46803 6.38823
Design Matrix
0,
ji
ij
Note, distance between thresholds is now constant over items
PCM: Example with 2 items (sum0 = FALSE)
jj
jiji
iii
iii
ii
thresholdlocation
threshold
threshold
threshold
323
212
11
eta 1 eta 2 eta 3 eta 4 eta 5beta ghq01.c1 0 0 0 0 0beta ghq01.c2 1 0 0 0 0beta ghq01.c3 0 1 0 0 0beta ghq03.c1 0 0 1 0 0beta ghq03.c2 0 0 0 1 0beta ghq03.c3 0 0 0 0 1
Model parameters eta eta 1 -3.8662273 eta 2 -9.9093688 eta 3 -0.9126535 eta 4 -5.9874083 eta 5 -12.4549913
Model matrix W
βij = W*etaItem Easiness Parameters (beta):beta ghq01.c1 0.000 beta ghq01.c2 -3.866 beta ghq01.c3 -9.909 beta ghq03.c1 -0.913 beta ghq03.c2 -5.987 beta ghq03.c3 -12.455
Location Threshold 1 Threshold 2 Threshold 3ghq01 3.30312 0.00000 3.86623 6.04314 ghq03 4.15166 0.91265 5.07475 6.46758
Design Matrix
RSM: Example with 2 items (sum0 = FALSE)
jj
jiji
iii
iii
ii
thresholdlocation
threshold
threshold
threshold
323
212
11
eta 1 eta 2 eta 3beta ghq01.c1 0 0 0beta ghq01.c2 0 1 0beta ghq01.c3 0 0 1beta ghq03.c1 1 0 0beta ghq03.c2 2 1 0beta ghq03.c3 3 0 1
Model parameters etaeta 1 -0.4978386 eta 2 -3.9701867 eta 3 -9.8605819
Model matrix W
βij = W*etaItem Easiness Parameters (beta):beta ghq01.c1 0.000beta ghq01.c2 -3.970 beta ghq01.c3 -9.861 beta ghq03.c1 -0.996 beta ghq03.c2 -5.962 beta ghq03.c3 -12.848
Location Threshold 1 Threshold 2 Threshold 3ghq01 3.28684 0.00000 3.97016 5.89036ghq03 4.28251 0.99567 4.96584 6.88604
Design Matrix
Note, location +threshold parameters now comparable between PCM/RSM
PCM RSM
Sum0 = TRUE
Sum0 = FALSE
Just to prove it’s the same model…
> ego_pcm_odd_erm2<-PCM(ego[,c(1,3,5,7,9,11)], sum0 = TRUE)> LRtest(ego_pcm_odd_erm) Andersen LR-test: LR-value: 84.651 Chi-square df: 14 p-value: 0
> ego_pcm_odd_erm2<-PCM(ego[,c(1,3,5,7,9,11)], sum0 = FALSE)> LRtest(ego_pcm_odd_erm2)
Andersen LR-test: LR-value: 84.651 Chi-square df: 14 p-value: 0
Partial Credit Model with 6 items (odd-GHQ)
> ego_pcm_odd_erm<-PCM(ego[,c(1,3,5,7,9,11)])
beta ghq01.c1 3.46beta ghq01.c2 2.29beta ghq01.c3 -0.87beta ghq03.c1 2.48beta ghq03.c2 0.14beta ghq03.c3 -3.41beta ghq05.c1 2.03beta ghq05.c2 1.49beta ghq05.c3 -1.21beta ghq07.c1 3.10beta ghq07.c2 2.23beta ghq07.c3 -0.68beta ghq09.c1 0.95beta ghq09.c2 0.27beta ghq09.c3 -2.38beta ghq11.c1 -0.66beta ghq11.c2 -2.80beta ghq11.c3 -6.43
0,
ji
ij
LocationThreshold
1Threshold
2Threshold
3
ghq01 0.29 -3.46 1.17 3.16
ghq03 1.14 -2.48 2.34 3.56
ghq05 0.40 -2.03 0.54 2.70
ghq07 0.23 -3.10 0.87 2.91
ghq09 0.79 -0.95 0.69 2.65
ghq11 2.14 0.66 2.14 3.63
j
jilocation 3
1
eta 1 eta 2 eta 3 eta 4 eta 5 eta 6
2.29 -0.87 2.48 0.14 -3.41 2.03
eta 7 eta 8 eta 9 eta 10 eta 11 eta 12
1.49 -1.21 3.10 2.23 -0.68 0.95
eta 13 eta 14 eta 15 eta 16 eta 17
0.27 -2.38 -0.66 -2.80 -6.43
> ego_rsm_odd_erm<-RSM(ego[,c(1,3,5,7,9,11)], sum0 = TRUE)
Design Matrix Block 1: Location Threshold 1 Threshold 2 Threshold 3ghq01 2.11281 -0.49631 2.42362 4.41113ghq03 2.81321 0.20409 3.12401 5.11152ghq05 2.00262 -0.60650 2.31343 4.30094ghq07 1.97330 -0.63582 2.28411 4.27162ghq09 2.48345 -0.12567 2.79426 4.78177ghq11 4.26932 1.66020 4.58013 6.56764
> ego_rsm_odd_erm2<-RSM(ego[,c(1,3,5,7,9,11)], sum0 = FALSE)
Warning messages:1: In sqrt(diag(solve(parest$hessian))) : NaNs produced2: In sqrt(diag(lres$W %*% solve(parest$hessian) %*% t(lres$W))) : NaNs produced
Design Matrix Block 1: Location Threshold 1 Threshold 2 Threshold 3ghq01 225.29491 0.00000 -270.3309 946.2156ghq03 314.61332 89.31842 -181.0124 1035.5340ghq05 -0.74024 -226.03514 -496.3660 720.1804ghq07 -12.34834 -237.64325 -507.9741 708.5723ghq09 187.89149 -37.40341 -307.7343 908.8122ghq11 819.56596 594.27105 323.9402 1540.4866
?! Try changing starting values
Let’s try the GHQ even items instead
> ego_rsm_even_erm<-RSM(ego[,c(2,4,6,8,10,12)], sum0 = TRUE)
Design Matrix Block 1: Location Threshold 1 Threshold 2 Threshold 3ghq02 2.82054 -0.11586 3.35950 5.21797ghq04 2.93927 0.00287 3.47823 5.33670ghq06 3.14174 0.20535 3.68071 5.53918ghq08 2.71370 -0.22270 3.25266 5.11113ghq10 3.37903 0.44263 3.91800 5.77647ghq12 2.62412 -0.31228 3.16308 5.02155
> ego_rsm_even_erm2<-RSM(ego[,c(2,4,6,8,10,12)], sum0 = FALSE)
Design Matrix Block 1: Location Threshold 1 Threshold 2 Threshold 3ghq02 2.93640 0.00000 3.47537 5.33383ghq04 3.05513 0.11873 3.59410 5.45256ghq06 3.25761 0.32121 3.79658 5.65504ghq08 2.82956 -0.10684 3.36853 5.22699ghq10 3.49490 0.55850 4.03387 5.89233ghq12 2.73998 -0.19642 3.27895 5.13741
Phew!!
GHQ-even RSM versus PCM
> ego_pcm_even_erm2<-PCM(ego[,c(2,4,6,8,10,12)], sum0 = FALSE)
> ego_rsm_even_erm2<-RSM(ego[,c(2,4,6,8,10,12)], sum0 = FALSE)
Location Threshold 1 Threshold 2 Threshold 3
ghq02 2.94 0.00 3.48 5.33
ghq04 3.06 0.12 3.59 5.45
ghq06 3.26 0.32 3.80 5.66
ghq08 2.83 -0.11 3.37 5.23
ghq10 3.49 0.56 4.03 5.89
ghq12 2.74 -0.20 3.28 5.14
Location Threshold 1 Threshold 2 Threshold 3
ghq02 2.36 0.00 2.44 4.63
ghq04 2.56 -1.50 3.84 5.34
ghq06 2.67 -0.06 3.07 5.00
ghq08 2.29 -1.82 3.40 5.29
ghq10 2.72 0.90 2.54 4.73
ghq12 2.19 -1.24 3.00 4.81
GHQ-even RSM versus PCM
> ego_pcm_even_erm2<-PCM(ego[,c(2,4,6,8,10,12)], sum0 = FALSE)
> ego_rsm_even_erm2<-RSM(ego[,c(2,4,6,8,10,12)], sum0 = FALSE)
Location Threshold 1 Threshold 2 Threshold 3 Diff 1 Diff 2
ghq02 2.94 0.00 3.48 5.33 3.48 1.86
ghq04 3.06 0.12 3.59 5.45 3.48 1.86
ghq06 3.26 0.32 3.80 5.66 3.48 1.86
ghq08 2.83 -0.11 3.37 5.23 3.48 1.86
ghq10 3.49 0.56 4.03 5.89 3.48 1.86
ghq12 2.74 -0.20 3.28 5.14 3.48 1.86
Location Threshold 1 Threshold 2 Threshold 3 Diff 1 Diff 2
ghq02 2.36 0.00 2.44 4.63 2.44 2.19
ghq04 2.56 -1.50 3.84 5.34 5.34 1.50
ghq06 2.67 -0.06 3.07 5.00 3.13 1.93
ghq08 2.29 -1.82 3.40 5.29 5.23 1.89
ghq10 2.72 0.90 2.54 4.73 1.64 2.19
ghq12 2.19 -1.24 3.00 4.81 4.24 1.81
PCM/RSM are nested:
> LRtest(ego_pcm_even_erm2)Warning message: Persons with median raw scores are assigned to the lower raw score group!Warning in LRtest.Rm(ego_pcm_even_erm2) : The following items were excluded due to inappropriate response patterns within subgroups: ghq08 Full and subgroup models are estimated without these items!
Andersen LR-test: LR-value: 74.267 Chi-square df: 14 p-value: 0
> LRtest(ego_rsm_even_erm2)Warning message: Persons with median raw scores are assigned to the lower raw score group!Warning in LRtest.Rm(ego_rsm_even_erm2) : The following items were excluded due to inappropriate response patterns within subgroups: ghq08 Full and subgroup models are estimated without these items!
Andersen LR-test: LR-value: 317.87 Chi-square df: 6 p-value: 0
Linking IRT to “Factor Analysis”
[Mplus] EGO: GRM (1)
DATA: File is "C:\work\IRT experimenting\ego_ghq12_id.dta.dat" ;
VARIABLE: Names are ghq01 ghq02 ghq03 ghq04 ghq05 ghq06 ghq07 ghq08 ghq09 ghq10 ghq11 ghq12 f1 id; Missing are all (-9999) ; usevariables = ghq01 ghq03 ghq05 ghq07 ghq09 ghq11; categorical = ghq01 ghq03 ghq05 ghq07 ghq09 ghq11; ANALYSIS: ESTIMATOR = MLR;
LINK = logit;
MODEL: f BY ghq01* ghq03 ghq05 ghq07 ghq09 ghq11; f@1;
PLOT: TYPE = PLOT3; First item’s loading is freely estimatedTrait variance fixed to one
[Mplus] EGO: GRM (1) Estimate S.E. Est./S.E. P-Value F BY GHQ01 2.054 0.152 13.538 0.000 GHQ03 1.206 0.105 11.513 0.000 GHQ05 2.036 0.135 15.115 0.000 GHQ07 1.889 0.132 14.279 0.000 GHQ09 2.899 0.254 11.421 0.000 GHQ11 1.849 0.130 14.195 0.000
Thresholds GHQ01$1 -4.545 0.264 -17.199 0.000 GHQ01$2 0.943 0.106 8.860 0.000 GHQ01$3 3.966 0.209 19.016 0.000 GHQ03$1 -2.636 0.142 -18.549 0.000 GHQ03$2 1.740 0.095 18.270 0.000 GHQ03$3 3.723 0.167 22.251 0.000 GHQ05$1 -3.000 0.158 -19.018 0.000 GHQ05$2 0.363 0.100 3.637 0.000 GHQ05$3 3.320 0.179 18.593 0.000 GHQ07$1 -4.022 0.212 -19.015 0.000 GHQ07$2 0.601 0.097 6.193 0.000 GHQ07$3 3.461 0.181 19.139 0.000 GHQ09$1 -2.289 0.190 -12.038 0.000 GHQ09$2 0.819 0.134 6.130 0.000 GHQ09$3 4.204 0.310 13.579 0.000 GHQ11$1 0.155 0.094 1.651 0.099 GHQ11$2 2.340 0.122 19.125 0.000 GHQ11$3 4.564 0.219 20.835 0.000
[Mplus] EGO: GRM (1) – ICC’s
1
3
5
7
9
11
[Mplus] EGO: GRM (1) – IIF
1
3
5
7
9
11
[Mplus] EGO: GRM (1) – IIF
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
-6 -4 -2 0 2 4
Info
rmat
ion
ghq_01
ghq_03
ghq_05
ghq_07
ghq_09
ghq_11
Data extracted from Mplus and plot done in Excel
[Mplus] EGO: GRM (1) – IIF + TIF
0
1
2
3
4
5
6
-6 -4 -2 0 2 4
Info
rmat
ion
ghq_01
ghq_03
ghq_05
ghq_07
ghq_09
ghq_11
Total
Data extracted from Mplus and plot done in Excel
[R] EGO: GRM (1)
ego_grm_odd<-grm(ego[,c(1,3,5,7,9,11)], IRT.param = FALSE)
coef(ego_grm_odd)
beta.1 beta.2 beta.3 beta
ghq01 -4.544 0.946 3.968 2.049
ghq03 -2.637 1.739 3.722 1.203
ghq05 -2.995 0.365 3.318 2.027
ghq07 -4.018 0.604 3.464 1.885
ghq09 -2.281 0.821 4.195 2.883
ghq11 0.159 2.348 4.574 1.849
[R] EGO: GRM (1)
ego_grm_odd<-grm(ego[,c(1,3,5,7,9,11)], IRT.param = FALSE)
coef(ego_grm_odd)
beta.1 beta.2 beta.3 beta
ghq01 -4.544 0.946 3.968 2.049
ghq03 -2.637 1.739 3.722 1.203
ghq05 -2.995 0.365 3.318 2.027
ghq07 -4.018 0.604 3.464 1.885
ghq09 -2.281 0.821 4.195 2.883
ghq11 0.159 2.348 4.574 1.849
$1 $2 $3 loading
GHQ01 -4.545 0.943 3.966 2.054
GHQ03 -2.636 1.740 3.723 1.206
GHQ05 -3 0.363 3.320 2.036
GHQ07 -4.022 0.601 3.461 1.889
GHQ09 -2.289 0.819 4.204 2.899
GHQ11 0.155 2.340 4.564 1.849
Results from Mplus
par(mfrow = c(2, 3))plot(ego_grm_odd, type = c("ICC"))
par(mfrow = c(1, 1))plot(ego_grm_odd, type = c("IIC"))
Or individual IIF – ghost plots?
?
par(mfrow = c(2, 3))plot(ego_grm_odd, type = c("OCCu"))
par(mfrow = c(2, 3))plot(ego_grm_odd, type = c("OCCl"))
Compare IRF’s across items
[Mplus] EGO: GRM (2)
DATA: File is "C:\work\IRT experimenting\ego_ghq12_id.dta.dat" ;VARIABLE: Names are ghq01 ghq02 ghq03 ghq04 ghq05 ghq06 ghq07 ghq08 ghq09 ghq10 ghq11 ghq12 f1 id; Missing are all (-9999) ; usevariables = ghq01 ghq03 ghq05 ghq07 ghq09 ghq11; categorical = ghq01 ghq03 ghq05 ghq07 ghq09 ghq11; ANALYSIS: ESTIMATOR = MLR;
LINK = logit;
MODEL: f BY ghq01* ghq03 ghq05 ghq07 ghq09 ghq11 (1); f@1;
PLOT: TYPE = PLOT3;
All items have same loading First item’s loading is freely estimatedTrait variance fixed to one
Is equivalent to R’sego_grm_odd<-grm(ego[,c(1,3,5,7,9,11)], constrained = TRUE, IRT.param = FALSE)
Mplus: alternative IRT models
• Two similar models can be fitted in Mplus
Model A
• Estimation = MLR• Uses full information• Logit = default link function• Non-linear relationship between trait and items• Conditional probability method
Model B
• Estimation = Least squares• Uses limited information• Probit = default link function• Linear relationship between trait and items• Underlying variable (UV) method
There are 2*2*2*2*2 = 32 different models defined by these options, and most canbe fitted in some software or other.some models are equivalent, and some are good approximations for each otherWe will focus on two – because Mplus does
Comparison
• Model A– Models the categorical items as a multivariate set of ordinal
responses (here using the GRM)– Here we’ll use the (non-default) probit-link to aid comparison
• Model B– Uses the one/two-way margins present in the observed categorical
data to estimate a (polychoric) correlation matrix for a set of underlying latent continuous variables
– Uses this correlation matrix and standard CFA to estimate a trait which is linearly related to these latent continuous variables
– Throws away information, but often a good approximation + estimation is much simpler (no need for integration)
Item 1 – Information function
A
B
Trait distribution
A
B
TIFs
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
-6 -4.8 -3.6 -2.4 -1.2 0 1.2 2.4 3.6 4.8
A
B