data step1;
ls=80;
input patient treat period response;
datalines;
1 1
1 1
1 2
2 1
2 1
1 1
2 2
2 1
3 1
1 1
3 2
2 2
4 1
1 1
4 2
2 2
5 1
1 1
5 2
2 2
6 1
1 1
6 2
2 2
7 1
1 1
7 2
2 2
8 1
1 1
8 2
2 2
9 1
1 1
9 2
2 2
10 1
1 1
10 2
2 2
11 1
1 1
11 2
2 2
12 1
1 1
12 2
2 3
13 1
1 1
13 2
2 3
14 1
1 2
14 2
2 2
15 1 1
2
15 2
2 2
16 1
1 1
16 3
2 1
17 1
1 1
17 3
2 1
18 1
1 1
18 3
2 2
19 1 1
1
19 3
2 2
20 1
1 1
20 3
2 2
21 1
1 1
21 3
2 3
22 1
1 1
22 3
2 3
23 1 1
1
23 3
2 3
24 1
1 1
24 3
2 3
25 1
1 1
25 3
2 3
26 1
1 1
26 3
2 3
27 1 1
2
27 3
2 1
28 1
1 2
28 3
2 2
29 1
1 2
29 3
2 2
30 1
1 2
30 3
2 3
31 1 1
2
31 3
2 3
32 2
1 1
32 1
2 1
33 2
1 1
33 1
2 2
34 2
1 1
34 1
2 2
35 2 1
1
35 1
2 3
36 2
1 1
36 1
2 3
37 2
1 2
37 1
2 1
38 2
1 2
38 1
2 1
39 2 1
2
39 1
2 1
40 2
1 2
40 1
2 1
41 2
1 2
41 1
2 2
42 2
1 3
42 1
2 1
43 2 1
3
43 1
2 1
44 2
1 3
44 1
2 1
45 2
1 3
45 1
2 1
46 2
1 3
46 1
2 1
47 2 1
1
47 3
2 1
48 2
1 1
48 3
2 3
49 2
1 2
49 3
2 2
50 2
1 2
50 3
2 2
51 2 1
2
51 3
2 2
52 2
1 2
52 3
2 2
53 2
1 2
53 3
2 2
54 2
1 2
54 3
2 2
55 2 1
2
55 3
2 3
56 2
1 3
56 3
2 1
57 2
1 3
57 3
2 2
58 2
1 3
58 3
2 2
59 3 1
1
59 1
2 1
60 3
1 1
60 1
2 1
61 3
1 1
61 1
2 1
62 3
1 1
62 1
2 2
63 3 1
1
63 1
2 2
64 3
1 2
64 1
2 1
65 3
1 2
65 1
2 2
66 3
1 2
66 1
2 3
67 3 1
3
67 1
2 1
68 3
1 3
68 1
2 1
69 3
1 3
69 1
2 1
70 3
1 3
70 1
2 1
71 3 1
3
71 1
2 1
72 3
1 3
72 1
2 1
73 3
1 1
73 2
2 1
74 3
1 1
74 2
2 3
75 3 1
2
75 2
2 1
76 3
1 2
76 2
2 1
77 3
1 2
77 2
2 1
78 3
1 2
78 2
2 1
79 3 1
2
79 2
2 2
80 3
1 2
80 2
2 3
81 3
1 2
81 2
2 3
82 3
1 3
82 2
2 1
83 3 1
3
83 2
2 1
84 3
1 3
84 2
2 1
85 3
1 3
85 2
2 1
86 3
1 3
86 2
2 3
;;;;;
proc glimmix;
ls=80;
class patient
treat period;
model
response= treat period/ solution dist=multinomial
link=cumlogit;
random
intercept /subject=patient;
estimate
'treatment 3 versus treatment 1' treat
-1 0 1;
estimate
'treatment 2 versus treatment 1' treat
-1 1 0;
estimate
'treatment 3 versus treatment 2' treat 0
-1 1;
run;