-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBMC_Medicine_analysis.do
706 lines (443 loc) · 30.1 KB
/
BMC_Medicine_analysis.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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
*************************************************************************************************************************
*** MAIN STATISTICAL ANALYSIS OF THE STUDY ENTITLED :
*** Prof Francisco J. de Abajo, MD, PhD, MPH, Antonio Rodríguez-Miguel, PhD, Sara Rodríguez-Martín, PhD, Victoria Lerma, RN, Alberto García-Lledó, MD, PhD,
*** on behalf of MED-ACE2-COVID19 Study Group:
*** "IMPACT OF IN-HOSPITAL DISCONTINUATION WITH ANGIOTENSIN RECEPTOR BLOCKERS AND ANGIOTENSIN CONVERTING ENZYME INHIBITORS
*** ON THE MORTALITY OF COVID-19 PATIENTS. A RETROSPECTIVE COHORT STUDY"
*** AUTHOR: Antonio Rodríguez-Miguel, PhD
*** DATASET: ......csv
*** COMMENTS: Main analysis considering the 3-days time window for RASI discontinuation
*** PACKAGES NEEDED TO INSTALL:
** Install table1_mc package:
* ssc install table1_mc
** Install stddiff package:
* ssc install stddiff
*************************************************************************************************************************
*************************************************************************************************************************
********************************************************************************
*** 1. MEDIATION ANALYSIS ***
********************************************************************************
** 1.1. Outcome = Death
************************
* Consider only descendants of the exposure, that is, in-hospital treatments after discontinuaton of RASIs:
foreach var in oac pac antipla stat ogld insulin azithro other_antivir macrolid other_antibiotic steroid tocilizumab other_immuno immunomod anticoag {
display "-----------------------------------------------------"
display "`var'"
* First, assess the association between the potential mediator and the exposure:
logistic `var' raas_cont_itt_3d_rev if raas_cont_itt_3d_rev<2
* Then assess the association between the potential mediator and the outcome, adjusted by the exposure:
logistic exitus `var' raas_cont_itt_3d_rev if raas_cont_itt_3d_rev<2
display "------------------------------------------------------"
}
display " Potential mediators observed: oac, immunomod and steroids"
* For each potential mediator, must assess the presence of mediator-outcome confounders:
* oac
foreach var in pac antipla stat ogld insulin azithro other_antivir macrolid other_antibiotic anticoag {
display "-----------------------------------------------------"
display "`var'"
logistic `var' oac
logistic exitus `var' oac
display "------------------------------------------------------"
}
display "antipla is a M-O confounder of oac"
* immunomod
foreach var in pac antipla stat ogld insulin azithro other_antivir macrolid other_antibiotic anticoag {
display "-----------------------------------------------------"
display "`var'"
logistic `var' immunomod
logistic exitus `var' immunomod
display "------------------------------------------------------"
}
display "no M-O confounders of immunomod observed"
* steroids
foreach var in pac antipla stat ogld insulin azithro other_antivir macrolid other_antibiotic anticoag {
display "-----------------------------------------------------"
display "`var'"
logistic `var' steroid
logistic exitus `var' steroid
display "------------------------------------------------------"
}
display "no M-O confounders of steroids observed"
display "The final model when the outcome is death must include anticoagulants, immunomodulators and corticosteroids as mediators as well as antiplatelet drugs as mediator-outcome confounder"
** 1.2. Outcome = Death + ICU admission
*****************************************
* Consider only descendants of the exposure, thus in-hospital treatments after discontinuaton of RASIs:
foreach var in oac pac antipla stat ogld insulin azithro other_antivir macrolid other_antibiotic steroid tocilizumab other_immuno immunomod anticoag {
display "-----------------------------------------------------"
display "`var'"
logistic `var' raas_cont_itt_3d_rev if raas_cont_itt_3d_rev<2
logistic uci_muerte `var' raas_cont_itt_3d_rev if raas_cont_itt_3d_rev<2
display "------------------------------------------------------"
}
display " Potential mediators: oac, tocilizumab, other_immuno,steroids and immunomod"
* For each potential mediator, must assess the presence of mediator-outcome confounders:
* oac:
foreach var in pac antipla stat ogld insulin azithro other_antivir macrolid other_antibiotic tozilizumab other_immuno steroid immunomod anticoag {
display "-----------------"
display "`var'"
logistic oac `var'
logistic uci_muerte `var' oac
display "------------------"
}
display "Possible M-O confounder: other_immuno"
* tocilizumab:
foreach var in pac antipla stat ogld insulin azithro other_antivir macrolid other_antibiotic other_immuno steroid immunomod anticoag {
display "-----------------"
display "`var'"
logistic tozilizumab `var'
logistic uci_muerte `var' tozilizumab
display "------------------"
}
display "Possible M-O confounder: other_immuno, steroids"
* other_immuno:
foreach var in pac antipla stat ogld insulin azithro other_antivir macrolid other_antibiotic tozilizumab steroid immunomod anticoag {
display "-----------------"
display "`var'"
logistic other_immuno `var'
logistic uci_muerte `var' other_immuno
display "------------------"
}
display "Possible M-O confounder: steroids"
* immunomod:
foreach var in pac antipla stat ogld insulin azithro other_antivir macrolid other_antibiotic steroid anticoag {
display "-----------------"
display "`var'"
logistic immunomod `var'
logistic uci_muerte `var' immunomod
display "------------------"
}
display "Possible M-O confounder: steroids"
* steroids:
foreach var in pac antipla stat ogld insulin azithro other_antivir macrolid other_antibiotic immunomod anticoag {
display "-----------------"
display "`var'"
logistic steroid `var'
logistic uci_muerte `var' steroid
display "------------------"
}
display "Possible M-O confounder: immunomod"
display "The final model when the outcome is death+ICU must include anticoagulants and immunomodulators as mediators as well as corticosteroids as mediator-outcome confounder"
********************************************************************************************
*** TABLE 1. Baseline characteristics and disease severity markers at admission
*** of renin-angiotensin system inhibitors users in discontinuation and continuation cohorts
********************************************************************************************
* Table
table1_mc if raas_cont_itt_3d_rev<2, by(raas_cont_itt_3d_rev) vars(sexo cat \ edad conts \ obesidad cat\ smoking cat\ hta cat \ diabetes_2 cat \ dislipemia_2 cat\ iam cat\ insuf cat \ fa cat \tep_tvp cat\ ictus cat\ epoc cat \ asma cat \ cancer_prev cat\ cancer_act cat\ irc cat\ ieca cat \ araii cat \ antiald cat \ aca cat \ diur cat\ beta_bloq cat\ alfa_bloq cat\ aco cat\ antiag cat\ aine cat\ cortic cat\ para cat \ meta cat \ estat cat\ ezet cat\ ado cat \ insulina cat\ hospital_cat cat \ semana_ingreso_3cat2 cat \ pneumonia cat\ hipoxemia_cat cat\ crp_cat2 cat\ troponin_cat2 cat\ d_dimer_cat2 cat\ procalcitonin_cat2 cat\ probnp_cat2 cat\ lympho_cat cat\ severscore_cat cat\ severscore contn)
* Standardized difference
stddiff sexo edad obesidad smoking hta diabetes_2 dislipemia_2 iam insuf fa tep_tvp ictus epoc asma cancer_prev cancer_act irc ieca araii antiald aca diur beta_bloq alfa_bloq aco antiag aine cortic para meta estat ezet ado insulina hospital_cat semana_ingreso_3cat2 pneumonia hipoxemia_cat crp_cat2 troponin_cat2 d_dimer_cat2 procalcitonin_cat2 probnp_cat2 lympho_cat severscore_cat severscore if raas_cont_itt_3d_rev<2, by(raas_cont_itt_3d_rev)
**********************************************************************************************************
*** TABLE 2. In-hospital stay and treatment received according to discontinuation or continuation of RASIs.
**********************************************************************************************************
* Table
table1_mc if raas_cont_itt_3d_rev<2, by(raas_cont_itt_3d_rev) vars(tiempo2 conts\ uci cat\ oac cat\ pac cat\ antipla cat\ stat cat\ ogld cat\ insulin cat\ chloroq cat\ lopi_daru cat\ azithro cat\ macrolid cat\ other_antivir cat\ other_antibiotic cat\ tozilizumab cat\ other_immuno cat\ steroid cat\ aca_3d_ing_2cat cat\ bb_3d_ing_rev cat\ alpha_3d_ing_rev cat\ diur_hc_3d_ing_rev cat\ diur_lc_3d_ing_rev cat)
* Standardized difference
stddiff tiempo2 uci oac pac antipla stat ogld insulin chloroq lopi_daru azithro macrolid other_antivir other_antibiotic tozilizumab other_immuno steroid aca_3d_ing_2cat bb_3d_ing_rev alpha_3d_ing_rev diur_hc_3d_ing_rev diur_lc_3d_ing_rev if raas_cont_itt_3d_rev<2, by(raas_cont_itt_3d_rev)
************************************************************************************************************************************************************************
*** TABLE 3. Crude and adjusted hazard ratios of in-hospital death or a composite of death and ICU admission, according to the discontinuation or continuation of
*** in-hospital of ACEIs and ARBs, either pooling as a group (RASIs) or disaggregated. The category of reference is the continuation of RASIs, ARBs and ACEIs, respectively.
************************************************************************************************************************************************************************
** RASIs **
***********
** Outcome = Death:
*******************
* Mortality rate
tab exitus raas_cont_itt_3d_rev if raas_cont_itt_3d_rev<2, col
* Propensity score (PS) model
logit raas_cont_itt_3d_rev sexo i.edad_cat ib4.hospital_cat##ib1.semana_ingreso2cat i.diabetes_2 obesidad i.dislipemia_2 i.iam i.insuf i.fa i.tep_tvp i.ictus i.epoc i.asma i.cancer i.irc i.aca i.diur i.beta_bloq i.alfa_bloq i.aco i.antiag i.aine i.cortic i.smoking i.severscore_cat i.pneumonia2 i.aca_3d_ing_2cat i.bb_3d_ing_rev i.diur_hc_3d_ing_rev i.diur_lc_3d_ing_rev i.chloroq i.lopi_daru if raas_cont_itt_3d_rev<2
* Predict PS
predict ps_raas3d_cox2 if e(sample)
* Imputation of missing PS
sum ps_raas3d_cox2 if hospital_cat==1 & edad_cat == 5 & sexo == 1
replace ps_raas3d_cox2 = r(mean) if raas_cont_itt_3d_rev <2 & hospital_cat==1 & ps_raas3d_cox2 == .
sum ps_raas3d_cox2 if hospital_cat==5 & edad_cat == 1 & sexo == 1
replace ps_raas3d_cox2 = r(mean) if raas_cont_itt_3d_rev <2 & hospital_cat==5 & ps_raas3d_cox2 == .
* Restricted cubic splines with 5 knots accounting for 5th,25th,50th,75th and 95th percentiles of the PS:
* Get percentiles
sum ps_raas3d_cox2, d
* Build the smooth function
mkspline rcs_raas3d_cox2 = ps_raas3d_cox2, cubic knots(0.11,0.31,0.52,0.82,0.95) displayknots
* Survival analysis:
* Set time-to-event and failure variable
stset tiempo2 if raas_cont_itt_3d_rev<2, fail(exitus)
* Unadjusted Cox regression
stcox raas_cont_itt_3d_rev
* PS-adjusted (using restricted cubic splines) Cox regression
stcox raas_cont_itt_3d_rev rcs_raas3d_cox21-rcs_raas3d_cox24
* PS-adjusted, mediators and mediator-outcome confounders adjusted Cox regression
stcox raas_cont_itt_3d_rev oac antipla immunomod steroid rcs_raas3d_cox21-rcs_raas3d_cox24
* Test proportional hazards assumption (Schoenfeld residuals test)
estat phtest, detail
** Outcome = death + ICU:
*************************
* Mortality rate
tab uci_muerte raas_cont_itt_3d_rev if raas_cont_itt_3d_rev<2, col
* PS are the same as before
* Survival analysis:
* Set time-to-event and failure variable
stset tiempo3 if raas_cont_itt_3d_rev<2, fail(uci_muerte)
* Unadjusted Cox regression
stcox raas_cont_itt_3d_rev
* PS- adjusted (Resctricted cubic splines) Cox regression
stcox raas_cont_itt_3d_rev rcs_raas3d_cox21-rcs_raas3d_cox24
* PS, mediators and mediator-outcome confounders adjusted Cox regression
stcox raas_cont_itt_3d_rev oac immunomod steroid pac rcs_raas3d_cox21-rcs_raas3d_cox24
* Test proportional hazards assumption (Schoenfeld residuals test)
estat phtest, detail
** ARBs** (switchers to ACEI excluded)
*********
** Outcome = Death:
*******************
* Mortality rate
tab exitus araii_cont_itt_3d_rev if ieca==0 & araii_cont_itt_3d_rev <2 & ieca_cont_itt_3d_rev ==1, col
* PS model
logit araii_cont_itt_3d_rev sexo i.edad_cat ib4.hospital_cat##ib1.semana_ingreso2cat i.diabetes_2 obesidad i.dislipemia_2 i.iam i.insuf i.fa i.tep_tvp i.ictus i.epoc i.asma i.cancer i.irc i.aca i.diur i.beta_bloq i.alfa_bloq i.aco i.antiag i.aine i.cortic i.smoking i.severscore_cat i.pneumonia2 i.aca_3d_ing_2cat i.bb_3d_ing_rev i.diur_hc_3d_ing_rev i.diur_lc_3d_ing_rev i.chloroq i.lopi_daru if araii_cont_itt_3d_rev<2 & ieca ==0 & ieca_cont_itt_3d_rev ==1
* Predict PS
predict ps_ara3d_cox2 if e(sample)
* Imputation of missing PS
sum ps_ara3d_cox2 if hospital_cat==1 & edad_cat ==5 & sexo == 1 & ieca==0
replace ps_ara3d_cox2 = r(mean) if araii_cont_itt_3d_rev <2 & hospital_cat==1 & edad_cat ==5 & sexo == 1 & ieca==0 & ps_ara3d_cox2 == .
replace ps_ara3d_cox2 = 0.99 if araii_cont_itt_3d_rev <2 & hospital_cat==6 & edad_cat ==3 & sexo == 2 & ieca==0 & ps_ara3d_cox2 == .
replace ps_ara3d_cox2 = 0.99 if araii_cont_itt_3d_rev <2 & hospital_cat==6 & edad_cat ==3 & sexo == 1 & ieca==0 & ps_ara3d_cox2 == .
replace ps_ara3d_cox2 = 0.99 if araii_cont_itt_3d_rev <2 & hospital_cat==6 & edad_cat ==4 & sexo == 2 & ieca==0 & ps_ara3d_cox2 == .
replace ps_ara3d_cox2 = 0.99 if araii_cont_itt_3d_rev <2 & hospital_cat==6 & edad_cat ==1 & sexo == 2 & ieca==0 & ps_ara3d_cox2 == .
replace ps_ara3d_cox2 = 0.99 if araii_cont_itt_3d_rev <2 & hospital_cat==6 & edad_cat ==1 & sexo == 1 & ieca==0 & ps_ara3d_cox2 == .
* Restricted cubic splines with 5 knots accounting for 5th,25th,50th,75th and 95th percentiles of the PS:
* Get percentiles
sum ps_ara3d_cox2, d
* Build the smooth function
mkspline rcs_ara3d_cox2 = ps_ara3d_cox2, cubic knots(0.07,0.31,0.60,0.90,0.99) displayknots
* Survival analysis:
* Set time-to-event and failure variable
stset tiempo2 if ieca==0 & araii_cont_itt_3d_rev <2 & ieca_cont_itt_3d_rev ==1, fail(exitus)
* Unadjusted Cox regression
stcox araii_cont_itt_3d_rev
* PS adjusted (using restricted cubic splines) Cox regression
stcox araii_cont_itt_3d_rev rcs_ara3d_cox21-rcs_ara3d_cox24
* PS-adjusted, mediators and mediator-outcome confounders adjusted Cox regression
stcox araii_cont_itt_3d_rev oac antipla steroid immunomod rcs_ara3d_cox21-rcs_ara3d_cox24
* Test proportional hazards assumption (Schoenfeld residuals test)
estat phtest, detail
** Outcome = Death+ICU
**********************
* Mortality rate
tab uci_muerte araii_cont_itt_3d_rev if ieca==0 & araii_cont_itt_3d_rev <2 & ieca_cont_itt_3d_rev ==1, col
* PS are the same as before
* Survival analysis:
* Set time-to-event and failure variable
stset tiempo3 if ieca==0 & araii_cont_itt_3d_rev <2 & ieca_cont_itt_3d_rev ==1, fail(uci_muerte)
* Unadjusted Cox regression
stcox araii_cont_itt_3d_rev
* PS- adjusted (Resctricted cubic splines) Cox regression
stcox araii_cont_itt_3d_rev rcs_ara3d_cox21-rcs_ara3d_cox24
* PS, mediators and mediator-outcome confounders adjusted Cox regression
stcox araii_cont_itt_3d_rev oac immunomod steroid pac rcs_ara3d_cox21-rcs_ara3d_cox24
* Test proportional hazards assumption (Schoenfeld residuals test)
estat phtest, detail
** ACEIs** (switchers to ARBs excluded)
*********
** Outcome = Death:
*******************
* Mortality rate
tab exitus ieca_cont_itt_3d_rev if araii==0 & ieca_cont_itt_3d_rev <2 & araii_cont_itt_3d_rev==1, col
* PS model
logit ieca_cont_itt_3d_rev sexo i.edad_cat ib4.hospital_cat##ib1.semana_ingreso2cat i.diabetes_2 obesidad i.dislipemia_2 i.iam i.insuf i.fa i.tep_tvp i.ictus i.epoc i.asma i.cancer i.irc i.aca i.diur i.beta_bloq i.alfa_bloq i.aco i.antiag i.aine i.cortic i.smoking i.severscore_cat i.pneumonia2 i.aca_3d_ing_2cat i.bb_3d_ing_rev i.diur_hc_3d_ing_rev i.diur_lc_3d_ing_rev i.chloroq i.lopi_daru if araii==0 & ieca_cont_itt_3d_rev <2 & araii_cont_itt_3d_rev==1
* Predict PS
predict ps_ieca3d_cox2 if e(sample)
* Imputation of missing PS
sum ps_ieca3d_cox2 if hospital_cat==5 & edad_cat ==1 & sexo == 1 & araii==0
replace ps_ieca3d_cox2 = r(mean) if ieca_cont_itt_3d_rev <2 & hospital_cat==5 & edad_cat ==1 & ps_ieca3d_cox2 == . & araii==0
* Restricted cubic splines with 5 knots accounting for 5th,25th,50th,75th and 95th percentiles of the PS:
* Get percentiles
sum ps_ieca3d_cox2, d
* Build the smooth function
mkspline rcs_ieca3d_cox2 = ps_ieca3d_cox2, cubic knots(0.08,0.28,0.60,0.87,0.98) displayknots
* Survival analysis:
* Set time-to-event and failure variable
stset tiempo2 if araii==0 & ieca_cont_itt_3d_rev <2 & araii_cont_itt_3d_rev==1, fail(exitus)
* Unadjusted Cox regression
stcox ieca_cont_itt_3d_rev
* PS adjusted (using restricted cubic splines) Cox regression
stcox ieca_cont_itt_3d_rev rcs_ieca3d_cox21-rcs_ieca3d_cox24
* PS-adjusted, mediators and mediator-outcome confounders adjusted Cox regression
stcox ieca_cont_itt_3d_rev oac antipla steroid immunomod rcs_ieca3d_cox21-rcs_ieca3d_cox24
* Test proportional hazards assumption (Schoenfeld residuals test)
estat phtest, detail
** Outcome = Death+ICU
**********************
* Mortality rate
tab uci_muerte ieca_cont_itt_3d_rev if araii==0 & ieca_cont_itt_3d_rev <2 & araii_cont_itt_3d_rev==1, col
* PS are the same as before
* Survival analysis:
* Set time-to-event and failure variable
stset tiempo3 if araii==0 & ieca_cont_itt_3d_rev <2 & araii_cont_itt_3d_rev==1, fail(uci_muerte)
* Unadjusted Cox regression
stcox ieca_cont_itt_3d_rev
* PS- adjusted (Resctricted cubic splines) Cox regression
stcox ieca_cont_itt_3d_rev rcs_ieca3d_cox21-rcs_ieca3d_cox24
* PS, mediators and mediator-outcome confounders adjusted Cox regression
stcox ieca_cont_itt_3d_rev oac immunomod steroid pac rcs_ieca3d_cox21-rcs_ieca3d_cox24
* Test proportional hazards assumption (Schoenfeld residuals test)
estat phtest, detail
************************************************************************************************************************************************************************
*** TABLE 4. Head-to-head comparison of patients who continued treatment with angiotensin receptor blockers with patients who
*** continued treatment with angiotensin converting enzyme inhibitors.
************************************************************************************************************************************************************************
** Outcome = Death:
*******************
* Generate a new variable to include ARBs continuers and ACEIs continuers, excluding switchers
gen ieca_ara_cont3d_2 = 0 if ieca==0 & araii_cont_itt_3d_rev==0 & ieca_cont_itt_3d_rev==1
recode ieca_ara_cont3d_2 .=1 if araii==0 & ieca_cont_itt_3d_rev==0 & araii_cont_itt_3d_rev==1
label var ieca_ara_cont3d_2 "0:ARBcont, 1:ACEIcont"
label define ieca_ara_cont3d_2 0"ARBcont"1"ACEIcont"
label values ieca_ara_cont3d_2 ieca_ara_cont3d_2
* Mortality rate
tab exitus ieca_ara_cont3d_2 if ieca_ara_cont3d_2 <., col chi exact
* PS model
logit ieca_ara_cont3d sexo i.edad_cat ib4.hospital_cat##ib1.semana_ingreso2cat i.diabetes_2 obesidad i.dislipemia_2 i.iam i.insuf i.fa i.tep_tvp i.ictus i.epoc i.asma i.cancer i.irc i.aca i.diur i.beta_bloq i.alfa_bloq i.aco i.antiag i.aine i.cortic i.smoking i.severscore_cat i.pneumonia2 i.aca_3d_ing_2cat i.bb_3d_ing_rev i.diur_hc_3d_ing_rev i.diur_lc_3d_ing_rev i.chloroq i.lopi_daru if ieca_ara_cont3d <.
* Predict PS
predict ps_ieca_ara_cont3d_cox2 if e(sample)
* Imputation of missing PS
sum ps_ieca_ara_cont3d_cox2 if hospital_cat==1 & edad_cat ==5 & sexo == 1 & ieca_ara_cont3d <.
replace ps_ieca_ara_cont3d_cox2 = r(mean) if hospital_cat==1 & edad_cat ==5 & sexo == 1 & ieca_ara_cont3d <. & ps_ieca_ara_cont3d_cox2 == .
sum ps_ieca_ara_cont3d_cox2 if hospital_cat==5 & edad_cat ==1 & sexo == 1 & ieca_ara_cont3d <.
replace ps_ieca_ara_cont3d_cox2 = r(mean) if hospital_cat==5 & edad_cat ==1 & sexo == 1 & ieca_ara_cont3d <. & ps_ieca_ara_cont3d_cox2 == .
sum ps_ieca_ara_cont3d_cox2 if hospital_cat==6 & edad_cat ==3 & sexo == 1 & ieca_ara_cont3d <.
replace ps_ieca_ara_cont3d_cox2 = r(mean) if hospital_cat==6 & edad_cat ==3 & sexo == 1 & ieca_ara_cont3d <. & ps_ieca_ara_cont3d_cox2 == .
* Restricted cubic splines with 5 knots accounting for 5th,25th,50th,75th and 95th percentiles of the PS:
* Get percentiles
sum ps_ieca_ara_cont3d_cox2, d
* Build the smooth function
mkspline rcs_ieca_ara_cont3d_cox2 = ps_ieca_ara_cont3d_cox2, cubic knots(0.06,0.21,0.47,0.72,0.95) displayknots
* Survival analysis:
* Set time-to-event and failure variable
stset tiempo2 if ieca_ara_cont3d_2 <., fail(exitus)
* Unadjusted Cox regression
stcox ib1.ieca_ara_cont3d_2
* PS- adjusted (Resctricted cubic splines) Cox regression
stcox ib1.ieca_ara_cont3d_2 rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24
* PS, mediators and mediator-outcome confounders adjusted Cox regression
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24
* Test proportional hazards assumption (Schoenfeld residuals test)
estat phtest, detail
** Outcome = Death+ICU
**********************
* Mortality rate
tab uci_muerte ieca_ara_cont3d_2 if ieca_ara_cont3d_2 <., col
* PS are the same as before
* Survival analysis:
* Set time-to-event and failure variable
stset tiempo3 if ieca_ara_cont3d_2 <., fail(uci_muerte)
* Unadjusted Cox regression
stcox ib1.ieca_ara_cont3d_2
* PS- adjusted (Resctricted cubic splines) Cox regression
stcox ib1.ieca_ara_cont3d_2 rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24
* PS, mediators and mediator-outcome confounders adjusted Cox regression
stcox ib1.ieca_ara_cont3d_2 oac pac steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24
* Test proportional hazards assumption (Schoenfeld residuals test)
estat phtest, detail
*****************************************************************************************************************************************
*** FIGURE 2. Switching from RASIs to CCBs, other antihypertensive drugs (OADs) or no antihypertensive treatment during the first 3 days
*** since hospital admission (patients with uncertain discontinuation were excluded).
*****************************************************************************************************************************************
* Generate new indicator variable
gen rasi_at_admission = 1 if raas_inh==1 & (aca==0 & diur==0 & beta_bloq==0 & alfa_bloq ==0)
recode rasi_at_admission .= 0
recode rasi_at_admission 0=2 if aca==1
recode rasi_at_admission 0=3 if aca==0
label define rasi_at_admission 1"RASI alone"2"RASI+aca(+others)"3"RASI+others"
label values rasi_at_admission rasi_at_admission
* Switch from RASI alone to RASI alone (n=65)
keep if rasi_at_admission==1
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==0 & other_anti_hta3d_nodiurhc==0 & rasi_at_admission==1 & raas_cont_itt_3d_rev<2
* Switch from RASI alone to RASi+CCB (n=5)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==1 & rasi_at_admission==1 & raas_cont_itt_3d_rev<2
* Switch from RASI alone to RASi+OADs (n=2)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==0 & other_anti_hta3d_nodiurhc==1 & rasi_at_admission==1 & raas_cont_itt_3d_rev<2
* Switch from RASI alone to CCB (+OADs) (n=33)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==1 & rasi_at_admission==1 & raas_cont_itt_3d_rev<2
* Switch from RASI alone to OADs alone (n=2)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==0 & other_anti_hta3d_nodiurhc==1 & rasi_at_admission==1 & raas_cont_itt_3d_rev<2
* Switch from RASI alone to no treatment (n=62)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==0 & other_anti_hta3d_nodiurhc==0 & rasi_at_admission==1 & raas_cont_itt_3d_rev<2
* Switch from RASI+CCB (+OADs) to RASI alone (n=22)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==0 & other_anti_hta3d_nodiurhc==0 & rasi_at_admission==2 & raas_cont_itt_3d_rev<2
* Switch from RASI+CCB (+OADs) to RASI+CCB (n=51)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==1 & rasi_at_admission==2 & raas_cont_itt_3d_rev<2
* Switch from RASI+CCB (+OADs) to RASI+OADs (n=8)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==0 & other_anti_hta3d_nodiurhc==1 & rasi_at_admission==2 & raas_cont_itt_3d_rev<2
* Switch from RASI+CCB (+OADs) to CCB (+OADs) (n=71)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==1 & rasi_at_admission==2 & raas_cont_itt_3d_rev<2
* Switch from RASI+CCB (+OADs) to OADs alone (n=8)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==0 & other_anti_hta3d_nodiurhc==1 & rasi_at_admission==2 & raas_cont_itt_3d_rev<2
* Switch from RASI+CCB (+OADs) to no treatment (n=36)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==0 & other_anti_hta3d_nodiurhc==0 & rasi_at_admission==2 & raas_cont_itt_3d_rev<2
* Switch from RASI+OADs to RASI alone (n=43)
keep if rasi_at_admission==3
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==0 & other_anti_hta3d_nodiurhc==0 & rasi_at_admission==3 & raas_cont_itt_3d_rev<2
* Switch from RASI+OADs to RASI+CCB (n=14)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==1 & rasi_at_admission==3 & raas_cont_itt_3d_rev<2
* Switch from RASI+OADs to RASI+OADs (n=75)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==0 & other_anti_hta3d_nodiurhc==1 & rasi_at_admission==3 & raas_cont_itt_3d_rev<2
* Switch from RASI+OADs to CCB (+OADs) (n=27)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==1 & rasi_at_admission==3 & raas_cont_itt_3d_rev<2
* Switch from RASI+OADs to OADs alone (n=41)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==0 & other_anti_hta3d_nodiurhc==1 & rasi_at_admission==3 & raas_cont_itt_3d_rev<2
* Switch from RASI+OADs to no treatment (n=60)
tab raas_cont_itt_3d_rev rasi_at_admission if aca_3d_ing_2cat ==0 & other_anti_hta3d_nodiurhc==0 & rasi_at_admission==3 & raas_cont_itt_3d_rev<2
* Excel graph data file: "Figure_2_Sankey.xlsx"
*****************************************************************************************************************************************
*** FIGURE 3. Kaplan-Meier survival curves of in-hospital death among patients in whom treatment with ARBs was continued as compared
*** to those in whom ACEIs was continued (defined in the first 3-days window).
*****************************************************************************************************************************************
* Generate new indicator variable
gen rasi_ieca_ara_km = ieca_ara_cont3d
recode rasi_ieca_ara_km 0=1 1=2
recode rasi_ieca_ara_km . = 0 if raas_cont_itt_3d_rev ==1
label var rasi_ieca_ara_km "0:rasi disc, 1:ieca_cont,2:ara_cont"
* Kaplan-Meier
stset tiempo2 if ieca_ara_cont3d_2 <., fail(exitus)
sts graph, by(ieca_ara_cont3d_2) tmax(30) risktable
* Graph File: "km_ieca_ara_cont_f.gph"
*****************************************************************************************************************************************
*** FIGURE 4 Head-to-head comparison of continuation with angiotensin receptor blockers vs. continuation with angiotensin
*** converting enzyme inhibitors, by different subgroups.
*****************************************************************************************************************************************
** File: "figura_ACEIcon_ARBcont_sin_switch.csv"
** R-Studio code file: "Figure_4_Foresplot.R"
* By gender
bysort sexo: tab exitus ieca_ara_cont3d_2 if ieca_ara_cont3d_2<., col
stset tiempo2 if ieca_ara_cont3d <., fail(exitus)
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if sexo==1
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if sexo==2
* By age
bysort edad_cat4: tab exitus ieca_ara_cont3d_2 if ieca_ara_cont3d_2<., col
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if edad_cat4==1
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if edad_cat4==2
* By obesity
bysort obesidad: tab exitus ieca_ara_cont3d_2 if ieca_ara_cont3d_2<., col
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if obesidad==0
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if obesidad==1
* By diabetes:
bysort diabetes_2: tab exitus ieca_ara_cont3d_2 if ieca_ara_cont3d_2<., col
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if diabetes_2==0
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if diabetes_2==1
* By heart failure
bysort insuf: tab exitus ieca_ara_cont3d_2 if ieca_ara_cont3d_2<., col
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if insuf==0
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if insuf==1
* By CV_risk
bysort cv_risk: tab exitus ieca_ara_cont3d_2 if ieca_ara_cont3d_2<., col
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if cv_risk==2
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if cv_risk==3
* By severity score
bysort severscore_2cat: tab exitus ieca_ara_cont3d_2 if ieca_ara_cont3d_2<., col
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if severscore_2cat==0
stcox ib1.ieca_ara_cont3d_2 oac antipla steroid immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if severscore_2cat==1
* In-hospital use of corticosteroids
bysort steroid: tab exitus ieca_ara_cont3d_2 if ieca_ara_cont3d_2<., col
stcox ib1.ieca_ara_cont3d_2 oac antipla immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if steroid==0
stcox ib1.ieca_ara_cont3d_2 oac antipla immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if steroid==1
* In-hospital use of beta blockers:
bysort bb_3d_ing_rev: tab exitus ieca_ara_cont3d_2 if ieca_ara_cont3d_2<., col
stcox ib1.ieca_ara_cont3d_2 oac steroid antipla immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if bb_3d_ing_rev==0
stcox ib1.ieca_ara_cont3d_2 oac steroid antipla immunomod rcs_ieca_ara_cont3d_cox21-rcs_ieca_ara_cont3d_cox24 if bb_3d_ing_rev==1