# The IRT Procedure

### Example 65.3 Multiple-Group Analysis

This example shows how to use the IRT procedure to do multiple-group analysis. The following DATA step creates the data set `IrtGroup`:

```data IrtGroup;
input item1-item8 GroupVar @@;
datalines;
1 0 0 0 1 1 2 1 2 1 1 1 1 1 3 3 3 1 0 1 0 0 1 1 1 1 1 1 0 0 1 0 1 2 3
2 0 0 0 0 0 1 1 1 1 1 0 0 1 0 1 3 3 1 0 0 0 0 0 1 1 3 2 0 0 1 0 0 1 2
2 1 0 1 0 0 1 1 1 2 1 0 0 0 0 0 2 2 3 1 0 1 0 1 0 2 3 3 2 0 0 1 0 1 1
2 3 1 1 1 1 1 1 2 2 3 2 0 0 0 0 1 1 2 2 1 1 0 1 1 1 2 3 3 2 0 1 0 0 1
1 2 3 2 1 0 1 1 1 2 3 3 2 0 1 0 1 1 3 2 3 2 1 1 1 0 0 1 3 3 1 1 1 0 0
1 2 3 3 2 0 1 1 1 1 1 2 1 2 1 0 0 1 1 3 1 1 2 1 0 0 0 1 1 1 3 2 0 0 0
0 1 1 3 3 1 0 0 0 0 0 1 1 1 2 1 0 0 0 0 1 3 3 2 1 1 0 1 1 3 1 1 1 1 0
1 1 1 1 3 1 2 1 1 1 1 1 2 3 2 2 0 0 1 0 0 2 2 2 1 0 0 1 0 1 1 2 3 2 1

... more lines ...

1 0 0 2 1 3 2 1 1 1 1 1 1 3 2 1 1 1 1 0 0 3 3 1 2 1 0 0 1 1 3 3 3 2 0
0 1 0 0 1 1 1 2 0 0 0 0 1 3 1 1 2 1 0 0 1 0 1 3 3 2 0 0 1 1 0 2 2 3 2
1 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 2 0 0 1 1 0 1 1 3 2 0 0 0 0 1 1 1 1
2 0 0 1 0 0 1 1 1 1
;
```

To set up a multiple-group IRT model, you need to specify the grouping variable by using the GROUP statement. Very often you also want to specify cross-group equality constraints for different parameters. You can accomplish this by using the EQUALITY statement.

The model that is specified in the following statements is an extension of the model in Example 65.1. The group variable, `GroupVar`, is specified in the GROUP statement. It has two values, 1 and 2, to indicate group membership. Equality constraints are specified in the EQUALITY statement.

```proc irt data=IrtGroup;
var item1-item8;
group GroupVar;
model item1-item4/resfunc=twop,
equality item1-item4/parm=[intercept] between_gp=[1 2],
_allgr_/parm=[slope] within_gp=[1];
run;
```

Two different sets of equality constraints have been specified. The first entry specifies equality constraints on the intercept parameters for `item1` to `item4` between group 1 and group 2:

```item1-item4/parm=[intercept] between_gp=[1 2]
```

Notice that 1 and 2 are the actual values for the group variable `GroupVar`. The second entry specifies equality constraints on the slope parameters for all the graded response items within group 1:

```_allgr_/parm=[slope] within_gp=[1]
```

Output 65.3.1 shows the "Modeling Information" table and the "Group Information" table for this example. For multiple-group analysis, the "Modeling Information" table contains two extra pieces of information: the group variable and the number of groups. The "Group Information" table contains information about the data for each group. There are 272 observations that have been read and used for group 1; this number for group 2 is 328.

Output 65.3.1: Modeling and Group Information

The IRT Procedure

Modeling Information
Data Set WORK.IRTGROUP
Group Variable GroupVar
Number of Items 8
Number of Factors 1
Number of Groups 2
Number of Observations Read 600
Number of Observations Used 600
Estimation Method Marginal Maximum Likelihood

Group Information
GroupVar Nobs
Nobs
Used
1 272 272
2 328 328

Because there are two groups in this example, the IRT procedure produces two "Item Information" tables. For this example, these two tables contain the same information. That means that all the items have the same levels for the two groups. It is possible that the same item might have different numbers of levels, or maybe the same number of levels but different values. For example, an item has four levels, from 1 to 4, but one group might observe only levels 1 and 2, and the other group might observe only levels 3 and 4.

Output 65.3.2: Item Information

The IRT Procedure

Item Information
GroupVar = 1
Response
Model
Item Levels Values
TwoP item1 2 0 1
item2 2 0 1
item3 2 0 1
item4 2 0 1
Graded item5 2 0 1
item6 3 1 2 3
item7 3 1 2 3
item8 3 1 2 3

Item Information
GroupVar = 2
Response
Model
Item Levels Values
TwoP item1 2 0 1
item2 2 0 1
item3 2 0 1
item4 2 0 1
Graded item5 2 0 1
item6 3 1 2 3
item7 3 1 2 3
item8 3 1 2 3

Output 65.3.3 includes "Item Parameter Estimates" tables for both groups. You can see that the intercept parameters for `item1` are the same for both groups. The same applies to `item2` to `item4`. You can also see that the slope parameters have the same value for `item5` to `item8` in group 1. These results suggest that equality constraints that are specified in the EQUALITY statement have been fulfilled.

Output 65.3.3: Parameter Estimates

The IRT Procedure

Item Parameter Estimates
GroupVar = 1
Response
Model
Item Parameter Estimate Standard
Error
Pr > |t|
TwoP item1 Difficulty 0.24626 0.07816 0.0008
Slope 1.89140 0.37441 <.0001
item2 Difficulty 0.49593 0.10121 <.0001
Slope 2.00194 0.37933 <.0001
item3 Difficulty 0.41604 0.10697 <.0001
Slope 1.40286 0.26914 <.0001
item4 Difficulty 0.57879 0.16207 0.0002
Slope 0.90518 0.20196 <.0001
Graded item5 Threshold -0.71305 0.16161 <.0001
Slope 0.96028 0.10851 <.0001
item6 Threshold 1 -0.15736 0.14693 0.1421
Threshold 2 1.42604 0.21479 <.0001
Slope 0.96028 0.10851 <.0001
item7 Threshold 1 -0.86488 0.16877 <.0001
Threshold 2 0.81548 0.17161 <.0001
Slope 0.96028 0.10851 <.0001
item8 Threshold 1 -1.24146 0.19173 <.0001
Threshold 2 0.37687 0.15211 0.0066
Slope 0.96028 0.10851 <.0001

Item Parameter Estimates
GroupVar = 2
Response
Model
Item Parameter Estimate Standard
Error
Pr > |t|
TwoP item1 Difficulty 0.32086 0.09339 0.0003
Slope 1.45165 0.28558 <.0001
item2 Difficulty 0.68892 0.12795 <.0001
Slope 1.44111 0.28559 <.0001
item3 Difficulty 0.51533 0.12286 <.0001
Slope 1.13255 0.22767 <.0001
item4 Difficulty 0.61813 0.16239 <.0001
Slope 0.84758 0.18933 <.0001
Graded item5 Threshold -0.90713 0.27389 0.0005
Slope 0.68620 0.17589 <.0001
item6 Threshold 1 -0.77963 0.29946 0.0046
Threshold 2 2.21438 0.57523 <.0001
Slope 0.53993 0.14313 <.0001
item7 Threshold 1 -0.84385 0.18252 <.0001
Threshold 2 0.80750 0.16759 <.0001
Slope 1.03837 0.18991 <.0001
item8 Threshold 1 -1.18593 0.20728 <.0001
Threshold 2 0.20024 0.12032 0.0480
Slope 1.15474 0.21093 <.0001