-
Notifications
You must be signed in to change notification settings - Fork 1
/
T1_ST1_2_4_6_8_10_antico.sas
315 lines (255 loc) · 9.14 KB
/
T1_ST1_2_4_6_8_10_antico.sas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
/*********************************************************************************************
Program: T1_ST1_2_4_6_8_10_antico (anticoagulant medications)
Study name: Pancreatic cancer is associated with multiple medication changes prior to clinical diagnosis
Study baseline: 1996 (NHS) and 1998 (HPFS)
Study endpoint: June 2012 (NHS) and Jan 2012 (HPFS)
Prupose: generate tables/figures for risk analyses conducted in the pooled cohorts by anticoagulant medications
************************************************************************************************/
/***********************NHS************************/
libname NHS '.';
data NHS;
set NHS.nhsone;
/************EXCLUSIONS**************/
%beginex();
if i=5 then do;
%exclude(exrec eq 1);
%exclude(0 lt dtdxca le irt96);
%exclude(0 lt dtdth lt irt96);
%exclude(dtdxca eq 9999);
%exclude(mqx eq 1);
%exclude(can7696 eq 1);
%exclude(coumachngc eq .);
%exclude(id gt 0, nodelete=t);
%output();
end;
if i>5 then do;
%exclude(irt{i-1} lt dtdxca le irt{i});
%exclude(irt{i-1} le dtdth lt irt{i});
%exclude(id gt 0, nodelete=t);
%output();
end;
end;
%endex();
keep id bdt race &race_
t_start interval
t88 t90 t92 t94 t96 t98 t00 t02 t04 t06 t08 t10 cutoff
irt:
agemo ageyr agec
db: dbmonth: type prob supp
wtlosspt &wtlosspt505c_
mvt
ht76 bmi: wt:
act:
alcocum alc5cum &alc5cum_
pckyr pckgrp &pckgrp_
dt_pancreas t_pancreas dt_dead dtdth dt_digestive t_digestive dtdxca dtdxca2 dtdx_digestive
stage
antidepi antidep1 antidepchng antidepchngc &antidepchngc_ antidepchngcc &antidepchngcc_
anyni anyn1 anynchng anynchngc &anynchngc_ anynchngcc &anynchngcc_
anyi any1 anychng anychngc &anychngc_ anychngcc &anychngcc_
coumai couma1 coumachng coumachngc &coumachngc_ coumachngcc &coumachngcc_
ohypoi ohypo1 ohypochng ohypochngc &ohypochngc_ ohypochngcc &ohypochngcc_
insuli insul1 insulchng insulchngc &insulchngc_ insulchngcc &insulchngcc_
insuohchngc &insuohchngc_ insuohchngcc &insuohchngcc_
h2i h21 h2chng h2chngc &h2chngc_
ppii ppi1 ppichng ppichngc &ppichngc_
h2ppichngc &h2ppichngc_ h2ppichngcc &h2ppichngcc_
comboc &comboc_ combinec &combinec_
;
run;
data NHS;
set NHS end=_end_;
sex=0;
id=id+10000000;
irt86=0;
t86=0;
interval=interval+1;
run;
/***********************HPFS************************/
libname HPFS '.';
data HPFS;
set HPFS.hpfsone;
/************EXCLUSIONS**************/
%beginex();
if i=7 then do;
%exclude(exrec eq 1);
%exclude(0 lt dtdxca le irt98);
%exclude(0 lt dtdth lt irt98);
%exclude(dtdxca eq 9999);
%exclude(can8698 eq 1);
%exclude(mqx eq 1);
%exclude(coumachngc eq .);
%exclude(id gt 0, nodelete=t);
%output();
end;
if i>7 then do;
%exclude(irt{i-1} lt dtdxca le irt{i});
%exclude(irt{i-1} le dtdth lt irt{i});
%exclude(id gt 0, nodelete=t);
%output();
end;
end;
%endex();
keep id dbmy09 race &race_
t_start interval t86 t88 t90 t92 t94 t96 t98 t00 t02 t04 t06 t08 t10 cutoff
irt:
agemo ageyr agec
db: dbmonth: type supp
wtlosspt &wtlosspt505c_
mvt
bmi: wt:
act:
pckyr pckgrp &pckgrp_
alcocum alc5cum &alc5cum_
dt_pancreas t_pancreas dt_dead dtdth dt_digestive t_digestive dtdxca dtdxca2 dtdx_digestive
stage
antidepi antidep1 antidepchng antidepchngc &antidepchngc_ antidepchngcc &antidepchngcc_
anyni anyn1 anynchng anynchngc &anynchngc_ anynchngcc &anynchngcc_
anyi any1 anychng anychngc &anychngc_ anychngcc &anychngcc_
coumai couma1 coumachng coumachngc &coumachngc_ coumachngcc &coumachngcc_
h2i h21 h2chng h2chngc &h2chngc_
ppii ppi1 ppichng ppichngc &ppichngc_
h2ppichngc &h2ppichngc_ h2ppichngcc &h2ppichngcc_
;
run;
data HPFS;
set HPFS end=_end_;
sex=1;
run;
/****combine the two cohorts***/
data ALL;
set NHS HPFS end=_end_;
run;
data ALL;
set ALL;
if race=1 then white=1; else white=0;
if wtlosspt505c=1 then wtlosspt505c1=1; else wtlosspt505c1=0;
label
ageyr = 'Age, years'
sex='Male, %'
white ='Caucasians vs not'
bmicum = 'Body mass index, kg/mBYTE(178)'
wtlosspt505c='Weight loss'
pckyr= 'pack-years'
db='Type 2 diabetes'
actcum = 'Physical activity, MET-h/week'
alcocum='Alcohol, drinks/day'
mvt='Multivitamin use'
;
run;
/**STable 2 anticoagulant medications**/
%table1(data=ALL, exposure=coumai, agegroup=agec,
varlist=ageyr sex white bmicum wtlosspt505c1 &wtlosspt505c_ pckyr db actcum alcocum mvt,
cat=sex white wtlosspt505c1 &wtlosspt505c_ db mvt,
noadj=ageyr, landscape=F,
fn=@bmi Body mass index was calculated as weight in kilograms divided by the square of height in meters.
@act Hours of metabolic equivalent tasks.,
file=ALL_coumai.table1, uselbl=F,dec=1);
run;
/**STable 1 summary of study populations by anticoagulant medications**/
/**NHS person years**/
%pre_pm (
data=NHS,
out=pmNHS,
case=dt_pancreas,
var=coumachngc coumachngcc,
timevar=interval,
irt=irt96 irt98 irt00 irt02 irt04 irt06 irt08 irt10,
cutoff=cutoff,
dtdx=dtdxca,
dtdth=dtdth);
%pm (data=pmNHS,
case=dt_pancreas,
exposure=coumachngc coumachngcc,
ref=1 1);
run;
/**HPFS person years**/
%pre_pm (
data=HPFS,
out=pmHPFS,
timevar=interval,
irt=irt98 irt00 irt02 irt04 irt06 irt08 irt10,
cutoff=cutoff,
dtdx=dtdxca,
dtdth=dtdth,
case=dt_pancreas,
var=coumachngc coumachngcc);
%pm (data=pmHPFS,
case=dt_pancreas,
exposure=coumachngc coumachngcc,
ref=1 1);
run;
/**Pooled person years**/
data pmALL;
set pmNHS(in=n) pmHPFS(in=h) end=_end_;
if n then coh=1;
if h then coh=2;
%pm(data=pmALL, case=dt_pancreas, exposure=coumachngc coumachngcc, ref=1 1);
run;
/**Table 1 & STable 4_6_8_10 anticoagulant medications**/
%mphreg9(
data =NHS,
event =dt_pancreas,
id =id,
qret =irt96 irt98 irt00 irt02 irt04 irt06 irt08 irt10,
cutoff =cutoff,
dtdth =dtdth,
dtdx =dtdxca,
timevar =t96 t98 t00 t02 t04 t06 t08 t10,
tvar =interval,
agevar =agemo,
strata =agemo interval,
labels =T,
outdat =allpacNHS,
model1 =&coumachngc_ ,
model2 =&coumachngcc_ ,
model3 =&coumachngc_ race bmicum actcum pckyr alcocum mvt db couma1,
model4 =&coumachngcc_ race bmicum actcum pckyr alcocum mvt db /*couma1*/,
model5 =&coumachngc_ race &wtlosspt505c_ actcum pckyr alcocum mvt db couma1,
model6 =&coumachngcc_ race &wtlosspt505c_ actcum pckyr alcocum mvt db /*couma1*/
);
run;
%mphreg9(
data =HPFS,
event =dt_pancreas,
id =id,
qret =irt98 irt00 irt02 irt04 irt06 irt08 irt10,
cutoff =cutoff,
dtdth =dtdth,
dtdx =dtdxca,
timevar =t98 t00 t02 t04 t06 t08 t10,
tvar =interval,
agevar =agemo,
strata =agemo interval,
labels =T,
outdat =allpacHPFS,
model1 =&coumachngc_ ,
model2 =&coumachngcc_ ,
model3 =&coumachngc_ race bmicum actcum pckyr alcocum mvt db couma1,
model4 =&coumachngcc_ race bmicum actcum pckyr alcocum mvt db /*couma1*/,
model5 =&coumachngc_ race &wtlosspt505c_ actcum pckyr alcocum mvt db couma1,
model6 =&coumachngcc_ race &wtlosspt505c_ actcum pckyr alcocum mvt db /*couma1*/
);
run;
%mphreg9(
data =ALL,
event =dt_pancreas,
id =id,
qret =irt96 irt98 irt00 irt02 irt04 irt06 irt08 irt10,
cutoff =cutoff,
dtdth =dtdth,
dtdx =dtdxca,
timevar =t96 t98 t00 t02 t04 t06 t08 t10,
tvar =interval,
agevar =agemo,
strata =agemo interval sex,
labels =T,
outdat =allpacALL,
model1 =&coumachngc_ ,
model2 =&coumachngcc_ ,
model3 =&coumachngc_ race bmicum actcum pckyr alcocum mvt db couma1,
model4 =&coumachngcc_ race bmicum actcum pckyr alcocum mvt db /*couma1*/,
model5 =&coumachngc_ race &wtlosspt505c_ actcum pckyr alcocum mvt db couma1,
model6 =&coumachngcc_ race &wtlosspt505c_ actcum pckyr alcocum mvt db /*couma1*/
);
run;