Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Patterson and Jones 2006 Example 4.1 (Cmax)
/*** SAS code for examples in Chapter 4 of ***/
/*** Bioequivalence and Statistics in Clinical Pharmacology, ***/
/*** by Scott Patterson and Byron Jones,***/
/*** Chapman and Hall/CRC Press: Boca Raton, London and New York, 2005.***/
/*** WARNING : PROGRAM OFFERED FOR USE WITHOUT ANY GUARANTEES ***/
/*** NO LIABILITY IS ACCEPTED FOR ANY LOSS RESULTING FROM USE OF ***/
/*** THIS SET OF SAS INTRUCTIONS ***/
/*EXAMPLE 4.1 */
data three;
input index subject sequence$ period formula$ AUC CMAX;
datalines;
1 101 TRR 1 T 12.26 0.511
2 101 TRR 2 R 16.19 0.688
3 101 TRR 3 R 11.34 0.533
4 102 TRR 1 T 397.98 13.270
5 102 TRR 2 R 267.63 7.933
6 102 TRR 3 R 487.55 12.952
7 103 TRR 1 T 243.81 16.771
8 103 TRR 2 R 141.70 6.926
9 103 TRR 3 R 198.44 9.257
10 109 TRR 1 T 182.52 8.816
11 109 TRR 2 R 112.34 4.921
12 109 TRR 3 R 225.94 6.911
13 110 TRR 1 T 559.64 21.398
14 110 TRR 2 R 533.98 19.728
15 110 TRR 3 R 867.75 19.909
16 112 TRR 1 T 40.02 2.568
17 112 TRR 2 R 89.49 5.222
18 112 TRR 3 R 20.35 0.992
19 114 TRR 1 T . 0.872
20 114 TRR 2 R . 0.337
21 114 TRR 3 R 34.81 1.558
22 116 TRR 1 T 69.38 3.543
23 116 TRR 2 R 214.20 8.911
24 116 TRR 3 R 193.62 5.900
25 119 TRR 1 T 68.08 2.673
26 119 TRR 2 R 47.19 1.501
27 119 TRR 3 R 84.59 4.187
28 122 TRR 1 T 181.95 5.841
29 122 TRR 2 R 259.40 10.642
30 122 TRR 3 R 396.26 19.245
31 124 TRR 1 T 5.82 0.347
32 124 TRR 2 R 17.26 1.241
33 124 TRR 3 R 25.72 1.175
34 125 TRR 1 T 39.31 2.288
35 125 TRR 2 R 35.66 1.786
36 125 TRR 3 R 40.43 2.589
37 127 TRR 1 T 146.87 5.772
38 127 TRR 2 R 319.91 10.780
39 127 TRR 3 R 141.86 6.768
40 129 TRR 1 T 712.11 16.116
41 129 TRR 2 R 549.52 13.171
42 129 TRR 3 R 459.26 10.648
43 131 TRR 1 T 2277.52 18.448
44 131 TRR 2 R 3726.58 34.145
45 131 TRR 3 R 3808.79 41.876
46 132 TRR 1 T 1278.06 18.779
47 132 TRR 2 R 1103.46 17.086
48 132 TRR 3 R 1012.04 13.170
49 134 TRR 1 T 103.32 4.974
50 134 TRR 2 R 138.78 5.349
51 134 TRR 3 R 170.44 8.128
52 135 TRR 1 T 21.93 1.622
53 135 TRR 2 R 75.29 4.791
54 135 TRR 3 R 42.30 3.228
55 140 TRR 1 T 77.99 3.043
56 140 TRR 2 R 104.08 5.210
57 140 TRR 3 R 66.86 2.625
58 143 TRR 1 T 27.21 1.170
59 143 TRR 2 R 47.19 2.405
60 143 TRR 3 R 25.34 1.698
61 144 TRR 1 T 296.09 10.730
62 144 TRR 2 R 163.31 6.443
63 144 TRR 3 R 387.49 13.790
64 145 TRR 1 T 82.60 3.363
65 145 TRR 2 R 247.71 9.128
66 145 TRR 3 R 92.94 5.311
67 146 TRR 1 T 18.01 1.011
68 146 TRR 2 R 241.70 10.183
69 146 TRR 3 R 205.39 9.865
70 148 TRR 1 T 123.27 4.985
71 148 TRR 2 R 268.09 8.893
72 148 TRR 3 R 128.17 5.880
73 149 TRR 1 T 52.46 2.457
74 149 TRR 2 R 201.68 6.945
75 149 TRR 3 R 421.55 32.983
76 151 TRR 1 T 29.83 1.691
77 151 TRR 2 R 20.66 1.186
78 151 TRR 3 R 24.55 1.313
79 152 TRR 1 T 414.99 14.735
80 152 TRR 2 R 247.58 9.851
81 152 TRR 3 R 419.53 12.724
82 156 TRR 1 T 213.24 7.510
83 156 TRR 2 R 87.55 2.793
84 156 TRR 3 R 178.66 5.323
85 157 TRR 1 T 13.58 0.496
86 157 TRR 2 R 7.16 0.459
87 157 TRR 3 R 10.94 0.756
88 158 TRR 1 T 172.25 7.330
89 158 TRR 2 R 211.29 5.667
90 158 TRR 3 R 206.99 9.804
91 159 TRR 1 T 1161.73 27.604
92 159 TRR 2 R 2280.79 45.495
93 159 TRR 3 R 1552.49 27.220
94 163 TRR 1 T 57.26 2.691
95 163 TRR 2 R 48.65 2.877
96 163 TRR 3 R 89.01 6.631
97 165 TRR 1 T 350.95 7.034
98 165 TRR 2 R 755.27 13.040
99 165 TRR 3 R 711.18 11.002
100 166 TRR 1 T 36.79 1.861
101 166 TRR 2 R 41.75 2.750
102 166 TRR 3 R 35.39 2.784
103 167 TRR 1 T 11.57 1.055
104 167 TRR 2 R 3.31 0.326
105 167 TRR 3 R . 0.296
106 171 TRR 1 T 28.44 1.246
107 171 TRR 2 R 61.40 3.146
108 171 TRR 3 R 25.50 1.016
109 172 TRR 1 T 1150.28 15.677
110 172 TRR 2 R 759.03 15.215
111 172 TRR 3 R 1105.08 20.192
112 176 TRR 1 T 69.63 3.971
113 176 TRR 2 R 24.02 1.234
114 176 TRR 3 R 26.11 0.948
115 178 TRR 1 T 179.76 4.909
116 178 TRR 2 R 190.89 5.374
117 178 TRR 3 R 299.50 10.014
118 180 TRR 1 T 14.23 1.088
119 180 TRR 2 R 22.44 1.783
120 180 TRR 3 R 23.70 1.733
121 183 TRR 1 T 295.69 11.125
122 183 TRR 2 R 304.03 9.916
123 183 TRR 3 R 277.67 10.649
124 187 TRR 1 T 34.18 1.870
125 187 TRR 2 R 45.14 3.055
126 187 TRR 3 R 58.67 4.654
127 188 TRR 1 T 50.38 2.317
128 188 TRR 2 R 87.62 4.658
129 188 TRR 3 R 16.46 0.719
130 189 TRR 1 T 104.08 3.730
131 189 TRR 2 R 123.08 4.109
132 189 TRR 3 R 129.00 6.018
133 192 TRR 1 T 17.19 1.994
134 192 TRR 2 R 40.01 2.786
135 192 TRR 3 R 55.36 3.716
136 193 TRR 1 T 131.57 7.191
137 193 TRR 2 R 156.12 12.207
138 193 TRR 3 R 130.48 7.532
139 195 TRR 1 T 1323.07 12.897
140 195 TRR 2 R 1305.50 24.767
141 195 TRR 3 R 2464.82 27.650
142 196 TRR 1 T 654.32 12.347
143 196 TRR 2 R 783.53 26.041
144 196 TRR 3 R 444.44 18.975
145 104 RTT 1 R 37.27 2.207
146 104 RTT 2 T 62.18 2.901
147 104 RTT 3 T 44.09 2.073
148 105 RTT 1 R 82.87 6.123
149 105 RTT 2 T 24.78 1.462
150 105 RTT 3 T 24.70 1.468
151 106 RTT 1 R 47.80 2.586
152 106 RTT 2 T 32.88 1.203
153 106 RTT 3 T 124.31 6.972
154 107 RTT 1 R 88.39 4.326
155 107 RTT 2 T 30.85 1.589
156 107 RTT 3 T 192.45 8.687
157 108 RTT 1 R 180.50 8.459
158 108 RTT 2 T 108.71 5.011
159 108 RTT 3 T 200.57 9.104
160 111 RTT 1 R 50.59 3.133
161 111 RTT 2 T 33.53 1.814
162 111 RTT 3 T 100.58 7.159
163 113 RTT 1 R 634.14 7.154
164 113 RTT 2 T 914.90 12.354
165 113 RTT 3 T . 8.207
166 115 RTT 1 R 420.30 20.221
167 115 RTT 2 T 205.74 11.746
168 115 RTT 3 T . .
169 117 RTT 1 R 582.26 9.819
170 117 RTT 2 T 736.82 12.035
171 117 RTT 3 T 784.96 17.973
172 118 RTT 1 R 45.42 1.636
173 118 RTT 2 T . 0.852
174 118 RTT 3 T 70.69 1.895
175 120 RTT 1 R 437.61 9.111
176 120 RTT 2 T 586.47 11.708
177 120 RTT 3 T 405.95 10.539
178 121 RTT 1 R 22.83 1.167
179 121 RTT 2 T 13.72 0.506
180 121 RTT 3 T 15.75 0.756
181 123 RTT 1 R 64.58 2.949
182 123 RTT 2 T 35.54 1.831
183 123 RTT 3 T 65.11 2.989
184 126 RTT 1 R 15.15 0.902
185 126 RTT 2 T 22.35 1.234
186 126 RTT 3 T 21.71 1.495
187 128 RTT 1 R 30.22 1.632
188 128 RTT 2 T 27.40 0.921
189 128 RTT 3 T 33.19 1.221
190 130 RTT 1 R 12.42 0.636
191 130 RTT 2 T 71.38 4.433
192 130 RTT 3 T 62.27 4.408
193 133 RTT 1 R 39.01 1.854
194 133 RTT 2 T 89.41 4.091
195 133 RTT 3 T 59.89 2.235
196 136 RTT 1 R 24.47 1.441
197 136 RTT 2 T 42.66 2.997
198 136 RTT 3 T 42.39 3.070
199 137 RTT 1 R 13.84 0.846
200 137 RTT 2 T 21.73 1.202
201 137 RTT 3 T 41.69 2.380
202 138 RTT 1 R 28.04 1.045
203 138 RTT 2 T 10.97 0.629
204 138 RTT 3 T 42.72 2.337
205 139 RTT 1 R 264.89 13.913
206 139 RTT 2 T 243.66 9.160
207 139 RTT 3 T 276.54 10.632
208 141 RTT 1 R . 0.355
209 141 RTT 2 T . 0.237
210 141 RTT 3 T . 0.444
211 142 RTT 1 R 227.01 11.638
212 142 RTT 2 T 8.08 0.655
213 142 RTT 3 T 521.64 23.115
214 147 RTT 1 R 71.10 3.489
215 147 RTT 2 T 16.77 1.013
216 147 RTT 3 T 44.08 2.434
217 150 RTT 1 R 29.66 1.439
218 150 RTT 2 T 76.03 5.327
219 150 RTT 3 T 60.12 4.626
220 153 RTT 1 R 1737.43 21.715
221 153 RTT 2 T 1416.78 22.405
222 153 RTT 3 T 1336.79 16.726
223 154 RTT 1 R 440.83 25.232
224 154 RTT 2 T 163.92 6.205
225 154 RTT 3 T 282.29 11.416
226 155 RTT 1 R 53.83 1.715
227 155 RTT 2 T 48.09 1.239
228 155 RTT 3 T 78.28 2.470
229 160 RTT 1 R 41.58 2.087
230 160 RTT 2 T 259.55 11.067
231 160 RTT 3 T 113.84 4.379
232 161 RTT 1 R 327.53 6.741
233 161 RTT 2 T 210.82 3.742
234 161 RTT 3 T 453.23 10.083
235 162 RTT 1 R 45.57 1.876
236 162 RTT 2 T 30.13 1.230
237 162 RTT 3 T 83.96 6.274
238 164 RTT 1 R 142.00 5.982
239 164 RTT 2 T 146.63 5.288
240 164 RTT 3 T 124.38 5.456
241 168 RTT 1 R 15.23 1.020
242 168 RTT 2 T 31.89 1.459
243 168 RTT 3 T 71.68 4.637
244 170 RTT 1 R 76.49 4.224
245 170 RTT 2 T 82.70 4.131
246 170 RTT 3 T 114.29 6.619
247 173 RTT 1 R 87.33 5.726
248 173 RTT 2 T 51.37 2.431
249 173 RTT 3 T 96.46 4.939
250 174 RTT 1 R 787.89 31.224
251 174 RTT 2 T 737.74 23.271
252 174 RTT 3 T 338.52 12.711
253 175 RTT 1 R 1239.48 24.013
254 175 RTT 2 T 1819.44 30.484
255 175 RTT 3 T 2232.29 43.224
256 177 RTT 1 R 29.19 1.971
257 177 RTT 2 T 36.58 2.296
258 177 RTT 3 T 79.59 4.243
259 179 RTT 1 R 10.13 1.029
260 179 RTT 2 T 16.99 1.371
261 179 RTT 3 T 9.82 0.718
262 181 RTT 1 R 257.59 9.964
263 181 RTT 2 T 423.89 15.005
264 181 RTT 3 T 224.07 6.776
265 182 RTT 1 R 51.77 3.797
266 182 RTT 2 T 27.63 2.312
267 182 RTT 3 T 26.09 1.741
268 184 RTT 1 R 73.75 2.555
269 184 RTT 2 T 90.81 3.242
270 184 RTT 3 T . .
271 185 RTT 1 R 49.32 1.471
272 185 RTT 2 T 124.00 4.079
273 185 RTT 3 T 85.71 4.743
274 186 RTT 1 R 6.06 0.311
275 186 RTT 2 T 28.82 1.651
276 186 RTT 3 T 87.63 4.870
277 190 RTT 1 R 82.78 3.889
278 190 RTT 2 T 164.56 7.376
279 190 RTT 3 T 213.98 7.012
280 191 RTT 1 R 98.86 4.599
281 191 RTT 2 T 99.02 2.969
282 191 RTT 3 T 75.48 2.388
283 194 RTT 1 R 21.29 1.513
284 194 RTT 2 T 46.30 2.741
285 194 RTT 3 T 15.41 1.411
;
run;
proc sort data=three;
by sequence subject period formula;run;
data three;
set three;
*if period = 1 or period = 2 or period = 3;
ln_cmax=log(CMAX);
run;
*proc print data=three;
*var subject sequence period formula AUC CMAX ln_auc ln_cmax;run;
proc sort data=three;
by sequence subject period formula;run;
proc mixed data=three method=ml;
class sequence subject period formula;
model ln_cmax=sequence period formula/outp=out;
random subject(sequence);
lsmeans formula;
estimate 'T-R' formula -1 1/cl alpha=0.10;
run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment