The IRT Procedure

Example 66.1 Unidimensional IRT Models

(View the complete code for this example.)

This example shows you the features that PROC IRT provides for unidimensional analysis. The data set comes from the 1978 Quality of American Life Survey. The survey was administered to a sample of all US residents aged 18 years and older in 1978. In this survey, subjects were asked to rate their satisfaction with many different aspects of their lives. This example selects eight items. These items are designed to measure people’s satisfaction in the following areas on a seven-point scale: community, neighborhood, dwelling unit, life in the United States, amount of education received, own health, job, and how spare time is spent. For illustration purposes, the first five items are dichotomized and the last three items are collapsed into three levels.

The following DATA step creates the data set IrtUni.

data IrtUni;
   input item1-item8 @@;
   datalines;
1 0 0 0 1 1 2 1 1 1 1 1 1 3 3 3 0 1 0 0 1 1 1 1 1 0 0 1 0 1 2 3 0 0 0
0 0 1 1 1 1 0 0 1 0 1 3 3 0 0 0 0 0 1 1 3 0 0 1 0 0 1 2 2 0 1 0 0 1 1

   ... more lines ...   

3 3 0 1 0 0 1 2 2 1
;

Because all the items are designed to measure subjects’ satisfaction in different aspects of their lives, it is reasonable to start with a unidimensional IRT model. The following statements fit such a model by using several user-specified options:

ods graphics on;
proc irt data=IrtUni link=probit pinitial itemstat polychoric
   itemfit plots=(icc polychoric);
   var item1-item8;
   model item1-item4/resfunc=twop, item5-item8/resfunc=graded;
run;

The ODS GRAPHICS ON statement invokes the ODS Graphics environment and displays the plots, such as the item characteristic curve plot. For more information about ODS Graphics, see Chapter 21: Statistical Graphics Using ODS.

The first option is the LINK= option, which specifies that the link function be the probit link. Next, you request initial parameter estimates by using the PINITIAL option. Item fit statistics are displayed using the ITEMFIT option. In the PROC IRT statement, you can use the PLOTS option to request different plots. In this example, you request item characteristic curves by using the PLOTS=ICC option.

In this example, you use the MODEL statement to specify different response models for different items. The specifications in the MODEL statement suggest that the first four items, item1 to item4, are fit using the two-parameter model, whereas the last four items, item5 to item8, are fit using the graded response model.

Output 66.1.1 displays two tables. From the "Modeling Information" table, you can observe that the link function has changed from the default LOGIT link to the specified PROBIT link. The "Item Information" table shows that item1 to item5 each have two levels and item6 to item8 each have three levels. The last column shows the raw values of these different levels.

Output 66.1.1: Basic Information

The IRT Procedure

Modeling Information
Data SetWORK.IRTUNI
Link FunctionProbit
Number of Items8
Number of Factors1
Number of Observations Read500
Number of Observations Used500
Estimation MethodMarginal Maximum Likelihood

Item Information
Response
Model
ItemLevelsValues
TwoPitem120 1
 item220 1
 item320 1
 item420 1
Gradeditem520 1
 item631 2 3
 item731 2 3
 item831 2 3


Output 66.1.2 displays the classical item statistics table, which include the item means, item-total correlations, adjusted item-total correlations, and item means for i ordered groups of observations or individuals. You can produce this table by specifying the ITEMSTAT option in the PROC IRT statement.

Output 66.1.2: Classical Item Statistics

The IRT Procedure

Item Statistics
ItemMean Item-Total Correlations Means
UnadjustedAdjustedG1
(N=132)
G2
(N=139)
G3
(N=119)
G4
(N=110)
item10.424000.575950.432910.113640.266190.537820.87273
item20.344000.538370.394800.068180.194240.453780.74545
item30.388000.513350.361320.090910.302160.478990.75455
item40.410000.445590.281970.166670.309350.478990.75455
item50.630000.435910.274360.325760.640290.714290.89091
item61.828000.509550.240401.348481.661871.983192.44545
item72.042000.651630.418221.303031.978422.352942.67273
item82.186000.661190.432541.409092.158272.504202.80909
Total N=500, Cronbach Alpha=0.6482


PROC IRT produces the "Eigenvalues of the Polychoric Correlation Matrix" table in Output 66.1.3 by default. You can use these eigenvalues to assess the dimension of latent factors. For this example, the fact that only the first eigenvalue is greater than 1 suggests that a one-factor model for the items is reasonable.

Output 66.1.3: Eigenvalues of Polychoric Correlations

Eigenvalues of the Polychoric Correlation Matrix
 EigenvalueDifferenceProportionCumulative
13.118704862.124976770.38980.3898
20.993728090.100259860.12420.5141
30.893468230.031169980.11170.6257
40.862298260.106701850.10780.7335
50.755596400.177957130.09440.8280
60.577639280.100800170.07220.9002
70.476839110.155113330.05960.9598
80.32172578 0.04021.0000


To get an overall idea of the correlations among all the items in the analysis, you can request the polychoric correlation matrix and the corresponding heat map. When you have a large number of items in the analysis, the heat map is especially useful to help you find patterns among these items. To produce the polychoric correlation matrix, specify the POLYCHORIC option in the PROC IRT statement. Specify PLOTS=POLYCHORIC to get the heat map for the polychoric correlation matrix. Output 66.1.4 includes the polychoric correlation table for this example, and Output 66.1.5 includes the heat map.

Output 66.1.4: Polychoric Correlation Matrix

Polychoric Correlation Matrix
 item1item2item3item4item5item6item7item8
item11.00000.53330.46630.41810.26260.25120.30030.3723
item20.53331.00000.51830.25310.15430.25450.37570.2910
item30.46630.51831.00000.23080.24670.14550.25610.3771
item40.41810.25310.23081.00000.17550.16070.31810.1825
item50.26260.15430.24670.17551.00000.17250.31560.2846
item60.25120.25450.14550.16070.17251.00000.15130.2404
item70.30030.37570.25610.31810.31560.15131.00000.4856
item80.37230.29100.37710.18250.28460.24040.48561.0000


Output 66.1.5: Polychoric Correlation Heat Map

 Polychoric Correlation Heat Map


The PINITIAL option in the PROC IRT statement displays the "Initial Item Parameter Estimates" table, shown in Output 66.1.6.

Output 66.1.6: Initial Parameter Estimates

The IRT Procedure

Initial Item Parameter Estimates
Response
Model
ItemParameterEstimate
TwoPitem1Difficulty0.26723
  Slope1.02931
 item2Difficulty0.60728
  Slope0.88149
 item3Difficulty0.46029
  Slope0.78642
 item4Difficulty0.50623
  Slope0.50318
Gradeditem5Threshold 1-0.83011
  Slope0.43614
 item6Threshold 1-0.59130
  Threshold 21.99390
  Slope0.36327
 item7Threshold 1-0.86053
  Threshold 20.65752
  Slope0.69307
 item8Threshold 1-1.13423
  Threshold 20.25868
  Slope0.71871


Output 66.1.7 includes tables that are related to the optimization. The "Optimization Information" table shows that the log likelihood is approximated by using seven adaptive Gauss-Hermite quadrature points and then maximized by using the quasi-Newton algorithm. The number of free parameters in this example is 19. The "Iteration History" table shows the number of function evaluations, the objective function (– likelihood divided by number of subjects) values, the objective function change, and the maximum gradient for each iteration. This information is very useful in monitoring the optimization status. Output 66.1.7 shows the convergence status at the bottom. The optimization converges according to the GCONV=0.00000001 criterion.

Output 66.1.7: Optimization Information

The IRT Procedure

Optimization Information
Optimization TechniqueQuasi-Newton
Likelihood ApproximationAdaptive Gauss-Hermite Quadrature
Number of Quadrature Points21
Number of Free Parameters19

Iteration History
CyclesIterationEvaluationsObjective
Function
Function
Change
Max Abs
Gradient
0026.19289629 0.008696
0156.19253485-0.000361440.004212
0286.19246549-0.000069360.002424
03116.19244193-0.000023560.001333
04136.19243242-0.000009510.001446
05166.19242952-0.000002900.000422
06196.19242860-0.000000920.00015
07226.19242847-0.000000130.000072
08256.19242842-0.000000040.000033
09286.19242841-0.000000010.000023

Convergence criterion (GCONV=.000000010) satisfied.


Output 66.1.8 displays the model fit and item fit statistics. Note that the item fit statistics apply only to the binary items. That is why these fit statistics are missing for item6 to item8.

Output 66.1.8: Fit Statistics

The IRT Procedure

Model Fit Statistics
Log Likelihood-3096.214206
AIC (Smaller is Better)6230.4284121
BIC (Smaller is Better)6310.505966
LR Chi-Square825.73118212
LR Chi-Square DF844

Item Fit Statistics
Response
Model
ItemDFPearson
Chi-Square
Pr > P ChiSqLR
Chi-Square
Pr > LR ChiSq
TwoPitem1834.16298<.000149.39389<.0001
 item2830.342000.000237.52299<.0001
 item3827.547200.000636.34739<.0001
 item4822.759490.003726.133550.0010
Gradeditem5818.320180.019019.680970.0116
 item60....
 item70....
 item80....


The last table for this example is the "Item Parameter Estimates " table in Output 66.1.9. This table contains parameter estimates, standard errors, and p-values. These p-values suggest that all the parameters are significantly different from zero.

Output 66.1.9: Parameter Estimates

The IRT Procedure

Item Parameter Estimates
Response
Model
ItemParameterEstimateStandard
Error
Pr > |t|
TwoPitem1Difficulty0.273390.083010.0005
  Slope0.983840.14145<.0001
 item2Difficulty0.602650.10047<.0001
  Slope0.900140.13113<.0001
 item3Difficulty0.461120.10062<.0001
  Slope0.795180.11392<.0001
 item4Difficulty0.506880.144100.0002
  Slope0.504320.08567<.0001
Gradeditem5Threshold-0.797470.18706<.0001
  Slope0.453910.08239<.0001
 item6Threshold 1-0.591240.198550.0015
  Threshold 22.027110.39593<.0001
  Slope0.357720.06777<.0001
 item7Threshold 1-0.821300.12753<.0001
  Threshold 20.644360.11431<.0001
  Slope0.726730.09312<.0001
 item8Threshold 1-1.081360.14134<.0001
  Threshold 20.251670.095360.0042
  Slope0.763770.09753<.0001


Item characteristic curves (ICC) are also produced in this example. By default, these ICC plots are displayed in panels. To display an individual ICC plot for each item, use the UNPACK suboption in the PLOTS= option in the PROC IRT statement.

Output 66.1.10: ICC Plots

 ICC Plots
External File:images/ex1_outicc1.png


Now, suppose your research hypothesis includes some equality constraints on the model parameters—for example, the slopes for the first four items are equal. Such equality constraints can be specified easily by using the EQUALITY statement. In the following example, the slope parameters of the first four items are equal:

proc irt data=IrtUni;
   var item1-item8;
   model item1-item4/resfunc=twop, item5-item8/resfunc=graded;
   equality item1-item4/parm=[slope];
run;

To estimate the factor score for each subject and add these scores to the original data set, you can use the OUT= option in the PROC IRT statement. PROC IRT provides three factor score estimation methods: maximum likelihood (ML), maximum a posteriori (MAP), and expected a posteriori (EAP). You can choose an estimation method by using the SCOREMETHOD= option in the PROC IRT statement. The default method is maximum a posteriori. In the following, factor scores along with the original data are saved to a SAS data set called IrtUniFscore:

proc irt data=IrtUni out=IrtUniFscore;
   var item1-item8;
   model item1-item4/resfunc=twop,
         item5-item8/resfunc=graded;
   equality item1-item4/parm=[slope];
run;

Sometimes you might find it useful to sort the items based on the estimated difficulty or slope parameters. You can do this by outputting the ODS tables for the estimates into data sets and then sorting the items by using PROC SORT. A simulated data set is used to show the steps.

The following DATA step creates the data set IrtSimu:

data IrtSimu;
   input item1-item25 @@;
   datalines;
1 1 1 0 1 1 0 0 1 1 0 0 0 0 1 0 1 1 1 0 0 0 1 0 1 1 1 1 1 1 0 1 1 0 0
0 0 0 0 0 1 1 0 0 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 0 1 1 0 0 0 0 0 0
0 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 0 0 0 1 0 1 1 0 1 1 0 0 1 1 0
1 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 1 0 1 0 1 1

   ... more lines ...   

1 1 0 1 1 1 1 1 1 1 0 1 1 0 0 0 1 1 0 1 1 1 1 1 1 0 0 1 0 1 0 1 0 0 0
0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 1
;

First, you build the model and output the parameter estimates table into a SAS data set by using the ODS OUTPUT statement:

proc irt data=IrtSimu link=probit;
   var item1-item25;
   ods output ParameterEstimates=ParmEst;
run;

Output 66.1.11 shows the "Item Parameter Estimates" table. Notice that the difficulty and slope parameters are in the same column. The reason for this is to avoid having an extremely wide table when each item has a lot of parameters.

Output 66.1.11: Basic Information

The IRT Procedure

Item Parameter Estimates
ItemParameterEstimateStandard
Error
Pr > |t|
item1Difficulty-1.326100.09788<.0001
 Slope1.441040.16074<.0001
item2Difficulty-0.997370.07454<.0001
 Slope1.820220.18986<.0001
item3Difficulty-1.250240.08981<.0001
 Slope1.585900.17476<.0001
item4Difficulty-1.096190.07748<.0001
 Slope1.866290.20429<.0001
item5Difficulty-1.079060.07806<.0001
 Slope1.781930.19059<.0001
item6Difficulty-0.950760.09401<.0001
 Slope1.040830.10267<.0001
item7Difficulty-0.650780.06949<.0001
 Slope1.452130.13449<.0001
item8Difficulty-0.763830.07611<.0001
 Slope1.302730.12209<.0001
item9Difficulty-0.722860.07058<.0001
 Slope1.505490.14221<.0001
item10Difficulty-0.507320.06125<.0001
 Slope1.821430.17133<.0001
item11Difficulty-0.012640.064700.4226
 Slope1.260720.11259<.0001
item12Difficulty0.041130.055840.2307
 Slope2.018140.19993<.0001
item13Difficulty0.161390.068780.0095
 Slope1.129950.10180<.0001
item14Difficulty0.011630.056710.4187
 Slope1.887070.18046<.0001
item15Difficulty0.072560.073600.1621
 Slope0.962810.09035<.0001
item16Difficulty-0.814280.07932<.0001
 Slope1.252130.11865<.0001
item17Difficulty-0.920850.09315<.0001
 Slope1.028000.10107<.0001
item18Difficulty-0.593980.06638<.0001
 Slope1.582340.14844<.0001
item19Difficulty-0.976190.09767<.0001
 Slope0.978630.09745<.0001
item20Difficulty-0.488450.05994<.0001
 Slope1.954530.18808<.0001
item21Difficulty-0.606440.06851<.0001
 Slope1.451340.13403<.0001
item22Difficulty-0.512450.06222<.0001
 Slope1.742310.16226<.0001
item23Difficulty-0.909570.08476<.0001
 Slope1.201300.11604<.0001
item24Difficulty-0.565010.06327<.0001
 Slope1.741990.16360<.0001
item25Difficulty-0.588950.06750<.0001
 Slope1.487510.13759<.0001


Output 66.1.12: The Difficulty Parameter SAS Data Set

ObsItemDifficulty
1item1-1.32610
2item2-0.99737
3item3-1.25024
4item4-1.09619
5item5-1.07906
6item6-0.95076
7item7-0.65078
8item8-0.76383
9item9-0.72286
10item10-0.50732
11item11-0.01264
12item120.04113
13item130.16139
14item140.01163
15item150.07256
16item16-0.81428
17item17-0.92085
18item18-0.59398
19item19-0.97619
20item20-0.48845
21item21-0.60644
22item22-0.51245
23item23-0.90957
24item24-0.56501
25item25-0.58895


Then you save the estimates of slopes and difficulties in the data set ParmEst and create two separate data sets to store the difficulty and slope parameters:

data Diffs(keep=Item Difficulty);
   set ParmEst;
   Difficulty = Estimate;
   if (Parameter = "Difficulty") then output;
run;
proc print data=Diffs;
run;
data Slopes(keep=Item Slope);
   set ParmEst;
   Slope = Estimate;
   if (Parameter = "Slope") then output;
run;
proc print data=Slopes;
run;

The two SAS data sets are shown in Output 66.1.12 and Output 66.1.13.

Output 66.1.13: The Slope Parameter SAS Data Set

ObsItemSlope
1item11.44104
2item21.82022
3item31.58590
4item41.86629
5item51.78193
6item61.04083
7item71.45213
8item81.30273
9item91.50549
10item101.82143
11item111.26072
12item122.01814
13item131.12995
14item141.88707
15item150.96281
16item161.25213
17item171.02800
18item181.58234
19item190.97863
20item201.95453
21item211.45134
22item221.74231
23item231.20130
24item241.74199
25item251.48751


Now you can use PROC SORT to sort the items by either difficulty or slope as follows:

proc sort data=Diffs;
   by Difficulty;
run;
proc print data=Diffs;
run;
proc sort data=Slopes;
   by Slope;
run;
proc print data=Slopes;
run;

Output 66.1.14 and Output 66.1.15 show the sorted data sets.

Output 66.1.14: Items Sorted by Difficulty

ObsItemDifficulty
1item1-1.32610
2item3-1.25024
3item4-1.09619
4item5-1.07906
5item2-0.99737
6item19-0.97619
7item6-0.95076
8item17-0.92085
9item23-0.90957
10item16-0.81428
11item8-0.76383
12item9-0.72286
13item7-0.65078
14item21-0.60644
15item18-0.59398
16item25-0.58895
17item24-0.56501
18item22-0.51245
19item10-0.50732
20item20-0.48845
21item11-0.01264
22item140.01163
23item120.04113
24item150.07256
25item130.16139


Output 66.1.15: Items Sorted by Slope

ObsItemSlope
1item150.96281
2item190.97863
3item171.02800
4item61.04083
5item131.12995
6item231.20130
7item161.25213
8item111.26072
9item81.30273
10item11.44104
11item211.45134
12item71.45213
13item251.48751
14item91.50549
15item181.58234
16item31.58590
17item241.74199
18item221.74231
19item51.78193
20item21.82022
21item101.82143
22item41.86629
23item141.88707
24item201.95453
25item122.01814


Notice that the sorting does not work correctly if any of the items have more than one threshold (ordinal response) or slope (multidimensional model).

Now, suppose you want to group the items into subgroups based on their difficulty parameters and then sort the items in each subgroup by their slope parameters. First, you need to merge the two data sets, Diffs and Slopes, into one data set. Then, you add another variable, called DiffLevel, to indicate the subgroups. The following statements show these steps:

proc sort data=Slopes;
   by Item;
run;
proc sort data=Diffs;
   by Item;
run;
data ItemEst;
   merge Diffs Slopes;
   by Item;
   if Difficulty < -1.0 then DiffLevel = 1;
   else if Difficulty < 0 then DiffLevel = 2;
   else if Difficulty < 1 then DiffLevel = 3;
   else DiffLevel = 4;
run;
proc print data=ItemEst;
run;

Output 66.1.16 shows the merged data set.

Output 66.1.16: The Merged SAS Data Set

ObsItemDifficultySlopeDiffLevel
1item1-1.326101.441041
2item10-0.507321.821432
3item11-0.012641.260722
4item120.041132.018143
5item130.161391.129953
6item140.011631.887073
7item150.072560.962813
8item16-0.814281.252132
9item17-0.920851.028002
10item18-0.593981.582342
11item19-0.976190.978632
12item2-0.997371.820222
13item20-0.488451.954532
14item21-0.606441.451342
15item22-0.512451.742312
16item23-0.909571.201302
17item24-0.565011.741992
18item25-0.588951.487512
19item3-1.250241.585901
20item4-1.096191.866291
21item5-1.079061.781931
22item6-0.950761.040832
23item7-0.650781.452132
24item8-0.763831.302732
25item9-0.722861.505492


Then, you can sort the items by slope within each difficulty group as follows:

proc sort data=ItemEst;
   by difflevel slope;
run;
proc print data=ItemEst;
run;

Output 66.1.17 shows the data set after sorting.

Output 66.1.17: Item Sorted by Slope within Each Difficulty Group

ObsItemDifficultySlopeDiffLevel
1item1-1.326101.441041
2item3-1.250241.585901
3item5-1.079061.781931
4item4-1.096191.866291
5item19-0.976190.978632
6item17-0.920851.028002
7item6-0.950761.040832
8item23-0.909571.201302
9item16-0.814281.252132
10item11-0.012641.260722
11item8-0.763831.302732
12item21-0.606441.451342
13item7-0.650781.452132
14item25-0.588951.487512
15item9-0.722861.505492
16item18-0.593981.582342
17item24-0.565011.741992
18item22-0.512451.742312
19item2-0.997371.820222
20item10-0.507321.821432
21item20-0.488451.954532
22item150.072560.962813
23item130.161391.129953
24item140.011631.887073
25item120.041132.018143