-
Notifications
You must be signed in to change notification settings - Fork 0
/
NyagaArbyn2022ArchPubHealth.do
315 lines (249 loc) · 12.1 KB
/
NyagaArbyn2022ArchPubHealth.do
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
315
/*
Updates:
16.01.2024 - version 3.0.0 options
*/
cd "C:\DATA\WIV\Projects\Stata\Metadta\Graphs\" //Change this
set more off
use "http://fmwww.bc.edu/repec/bocode/t/telomerase.dta", clear
list, noobs clean
/*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*/
*Example 1
/*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*/
*1 - Figure 1
*1 cov(unstructured)
*===================================================================
*Version 2.0.0
set more off
metadta tp fp fn tn, ///
studyid(study) model(random) dp(2) sumtable(all) ///
soptions(xtitle("False positive rate") ciopt(lpattern(dash_dot)) ///
xlabel(0(0.2)1) xscale(range(0 1)) ///
ytitle("Sensitivity") yscale(range(0 1)) ///
ylabel(0(0.2)1, nogrid) ///
graphregion(color(white)) plotregion(margin(medium)) ///
xsize(15) ysize(15) ///
legend(order(1 "Summary" 5 "Observed data" 2 "SROC" 3 ///
"Confidence region" 4 "Prediction region") ///
cols(1) ring(0) bplacement(6)) graphsave("s1.gph")) ///
foptions(xline(1) graphregion(color(white)) texts(2.5) ///
xlabel(0, 0.5, 1) diamopt(color(red)) ///
olineopt(color(red) lpattern(dash)))
estimates restore metadta_modest
estimates store unstructured
*Version 3.0.0
set more off
metadta tp fp fn tn, ///
studyid(study) smooth sumtable(all) ///
soptions(xtitle("False positive rate") ciopt(lpattern(dash_dot)) graphsave("s1.gph")) ///
foptions(xline(1) graphregion(color(white)) texts(2) xlabel(0, 0.5, 1) ysize(10) xsize(20) astext(70))
estimates restore metadta_modest
estimates store unstructured
*2 cov(independent)
*===================================================================
set more off
metadta tp fp fn tn, ///
studyid(study) model(random) cov(independe) dp(2) sumtable(all) ///
soptions(xtitle("False positive rate") ciopt(lpattern(dash_dot)) ///
xlabel(0(0.2)1) xscale(range(0 1)) ///
ytitle("Sensitivity") yscale(range(0 1)) ///
ylabel(0(0.2)1, nogrid) ///
graphregion(color(white)) plotregion(margin(medium)) ///
xsize(15) ysize(15) ///
legend(order(1 "Summary" 5 "Observed data" 2 "SROC" 3 ///
"Confidence region" 4 "Prediction region") ///
cols(1) ring(0) bplacement(6)) graphsave("s2.gph")) ///
foptions(graphregion(color(white)) texts(2.5) ///
xlabel(0, 0.5, 1) diamopt(color(red)) ///
olineopt(color(red) lpattern(dash)))
estimates restore metadta_modest
estimates store reduced
lrtest unstructured reduced, stats
*====Version 3.0.0
set more off
metadta tp fp fn tn, ///
studyid(study) smooth cov(independe) sumtable(all) ///
soptions(xtitle("False positive rate") graphsave("s2.gph")) ///
foptions(xline(1) graphregion(color(white)) texts(2) xlabel(0, 0.5, 1) ysize(10) xsize(20) astext(70))
estimates restore metadta_modest
estimates store reduced
lrtest unstructured reduced, stats
//Figure 2
gr combine s1.gph s2.gph, cols(2) graphregion(color(white)) xsize(8) ysize(4) iscale(1)
/*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*/
*Example 2
/*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*//*\*/
use "https://github.com/VNyaga/Metadta/blob/master/clinselfdemo.dta?raw=true", clear
list in 1/10, noobs clean
*1.
*===================================================================
gsort sample
*Version 2.0.0
set more off
metadta tp fp fn tn sample if ta=="SA" & setting=="follow-up", ///
studyid(study) sortby(year study) nooverall ///
noitable sumtable(abs rr) nosroc ///
foptions( subline pointopt(msize(1.5)) diamopt(color(red)) olineopt(color(red) ///
lpattern(dash)) outplot(abs) fysize(35) ///
graphregion(color(white)) texts(2) tit("SA, follow-up, by sample, CIN2+") ///
graphsave("f1.gph") ///
xlabel(0, .2, .4, .6, .8, 1) arrowopt(msize(1)))
*Version 3.0.0
set more off
metadta tp fp fn tn sample if ta=="SA" & setting=="follow-up", ///
studyid(study) sortby(year study) nooverall nowt ///
noitable sumtable(abs rr) nosroc ///
foptions( subline pointopt(msize(1.5)) fysize(35) ///
graphregion(color(white)) texts(2) tit("SA, follow-up, by sample, CIN2+") ///
graphsave("f1.gph") ///
xlabel(0, .2, .4, .6, .8, 1) arrowopt(msize(1)))
*2.
*===================================================================
*Version 2.0.0
metadta tp fp fn tn sample if ta=="SA" & setting=="screening" , ///
studyid(study) sortby(year study) nooverall ///
noitable sumtable(abs rr) nosroc nomc ///
foptions(subline pointopt(msize(1.5)) diamopt(color(red)) olineopt(color(red) ///
lpattern(dash)) outplot(abs) ///
graphregion(color(white)) texts(2) tit("SA, screening, by sample, CIN2+") graphsave("f2.gph") ///
xlabel(0, .2, .4, .6, .8, 1) arrowopt(msize(1)))
*Version 3.0.0
set more off
metadta tp fp fn tn sample if ta=="SA" & setting=="screening" , ///
studyid(study) sortby(year study) nooverall ///
noitable sumtable(abs rr) nosroc nomc nowt ///
foptions(subline ///
texts(2) tit("SA, screening, by sample, CIN2+") graphsave("f2.gph") ///
xlabel(0, .2, .4, .6, .8, 1))
gr combine f1.gph f2.gph, graphregion(color(white))
*graph save sa.gph, replace
*3.
gsort sample
*Version 2.0.0
set more off
metadta tp fp fn tn sample if ta=="TA" & setting=="follow-up", ///
studyid(study) sortby(year study) nooverall nomc ///
noitable sumtable(abs rr) nosroc ///
foptions(subline pointopt(msize(1.5)) diamopt(color(red)) olineopt(color(red) ///
lpattern(dash)) outplot(abs) ///
graphregion(color(white)) texts(2) tit("TA, follow-up, by sample, CIN2+") graphsave("f3.gph") ///
xlabel(0, .2, .4, .6, .8, 1) arrowopt(msize(1)))
*Version 3.0.0
set more off
metadta tp fp fn tn sample if ta=="TA" & setting=="follow-up", ///
studyid(study) sortby(year study) nooverall nomc ///
noitable sumtable(abs rr) nosroc nowt ///
foptions(subline texts(2) tit("TA, follow-up, by sample, CIN2+") graphsave("f3.gph") ///
xlabel(0, .2, .4, .6, .8, 1) )
*4.
*Version 2.0.0
metadta tp fp fn tn sample if ta=="TA" & setting=="screening", ///
studyid(study) sortby(year study) nooverall nomc ///
noitable sumtable(abs rr) nosroc ///
foptions(subline pointopt(msize(1.5)) diamopt(color(red)) olineopt(color(red) ///
lpattern(dash)) outplot(abs) fysize(35) ///
graphregion(color(white)) texts(2) tit("TA, screening, by sample, CIN2+") graphsave("f4.gph") ///
xlabel(0, .2, .4, .6, .8, 1) arrowopt(msize(1)))
*Version 3.0.0
set more off
set trace off
metadta tp fp fn tn sample if ta=="TA" & setting=="screening", ///
studyid(study) sortby(year study) nooverall nomc ///
noitable sumtable(abs rr) nosroc nowt ///
foptions(subline fysize(35) ///
texts(2) tit("TA, screening, by sample, CIN2+") graphsave("f4.gph") ///
xlabel(0, .2, .4, .6, .8, 1) )
gr combine f1.gph f3.gph, graphregion(color(white)) cols(1) imargin(0 0 0 0)
graph save 13.gph, replace
gr combine f2.gph f4.gph, graphregion(color(white)) cols(1) imargin(0 0 0 0)
graph save 24.gph, replace
//Figure 3
gr combine 13.gph 24.gph, cols(2) graphregion(color(white)) xsize(8) ysize(4) iscale(1)
*RELATIVE ACCURACY SELF VS CLIN BY SETTING WITH SA
set more off
gsort ta -setting study sample
*Version 2.0.0
metadta tp fp fn tn sample setting if ta=="SA", ///
studyid(study) nomc ///
comparative noitable sumtable(rr) ///
foptions(pointopt(msize(1.5)) diamopt(color(red)) olineopt(color(red) ///
lpattern(dash)) outplot(rr) tit("SA, self- vs clin-samples, by setting, CIN2+") graphsave("f5.gph") ///
graphregion(color(white)) texts(1.75) ///
xlabel(0.3, 0.5, 1, 2, 3) logscale arrowopt(msize(1)))
*Version 3.0.0
set more off
gsort ta -setting study sample
metadta tp fp fn tn sample setting if ta=="SA", ///
studyid(study) nomc ///
comparative noitable sumtable(rr) ///
foptions(outplot(rr) tit("SA, self- vs clin-samples, by setting, CIN2+") graphsave("f5.gph") ///
texts(1.75) ///
xlabel(0.3, 0.5, 1, 2, 3) logscale )
*RELATIVE ACCURACY SELF VS CLIN BY SETTING WITH TA
*Version 2.0.0
set more off
sort ta setting study sample
metadta tp fp fn tn sample setting if ta=="TA", ///
studyid(study) nomc ///
comparative noitable sumtable(rr) ///
foptions(pointopt(msize(1.5)) diamopt(color(red)) olineopt(color(red) ///
lpattern(dash)) outplot(rr) tit("TA, self- vs clin-samples, by setting, CIN2+") graphsave("f6.gph") ///
graphregion(color(white)) texts(1.75) ///
xlabel(0.3, 0.5, 1, 2, 3) logscale arrowopt(msize(1)))
*Version 3.0.0
set more off
sort ta setting study sample
metadta tp fp fn tn sample setting if ta=="TA", progress ///
studyid(study) nomc cov(unstructured, independent) ///
comparative noitable sumtable(rr) smooth ///
foptions( outplot(rr) tit("TA, self- vs clin-samples, by setting, CIN2+") graphsave("f6.gph") ///
texts(1.75) ///
xlabel(0.3, 0.5, 1, 2, 3) logscale arrowopt(msize(1)) astext(70) xsize(20) ysize(10))
//Figure 4
gr combine f5.gph f6.gph, col(1) graphregion(color(white))
*RELATIVE ACCURACY SELF VS CLIN interaction(sesp)
set more off
sort ta setting study sample
*Version 2.0.0
metadta tp fp fn tn sample ta setting, ///
studyid(study) interaction(sesp) nomc ///
comparative noitable sumtable(rr) nooverall ///
foptions(subline pointopt(msize(1.3)) diamopt(color(red)) olineopt(color(red) ///
lpattern(dash)) outplot(rr) tit("self- vs clin-samples - interaction(sesp)") ///
graphregion(color(white)) texts(1.7) lcol(setting) graphsave("f7.gph") ///
xlabel(0.3, 0.5, 1, 2, 3) logscale arrowopt(msize(1)))
sort ta setting study sample
set more off
*Version 3.0.0
metadta tp fp fn tn sample ta setting, ///
studyid(study) interaction(sesp) nomc smooth ///
comparative noitable sumtable(rr) nooverall ///
foptions(subline outplot(rr) tit("self- vs clin-samples - interaction(sesp)") ///
texts(1.7) lcol(setting) graphsave("f7.gph") ///
xlabel(0.3, 0.5, 1, 2, 3) logscale astext(70) xsize(20) ysize(10))
estimates restore metadta_modest
estimates store full
*RELATIVE ACCURACY SELF VS CLIN interaction(sesp)
set more off
sort ta setting study sample
*Version 2.0.0
metadta tp fp fn tn sample ta setting, ///
studyid(study) interaction(se) ///
comparative noitable sumtable(rr) nooverall ///
foptions(subline pointopt(msize(1.3)) diamopt(color(red)) olineopt(color(red) ///
lpattern(dash)) outplot(rr) tit("self- vs clin-samples - interaction(se)") ///
graphregion(color(white)) texts(1.7) lcol(setting) graphsave("f8.gph") ///
xlabel(0.3, 0.5, 1, 2, 3) logscale arrowopt(msize(1)))
set more off
sort ta setting study sample
*Version 3.0.0
metadta tp fp fn tn sample ta setting, ///
studyid(study) interaction(se) ///
comparative noitable sumtable(rr) nooverall smooth gof ///
foptions(subline pointopt(msize(1.3)) outplot(rr) tit("self- vs clin-samples - interaction(se)") ///
texts(1.7) lcol(setting) graphsave("f8.gph") ///
xlabel(0.3, 0.5, 1, 2, 3) logscale astext(70) xsize(20) ysize(10))
//Figure 5
gr combine f7.gph f8.gph, row(1) graphregion(color(white)) xsize(8)
estimates restore metadta_modest
estimates store reduced
lrtest full reduced, stats