-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmrdatachallenge.Rmd
1441 lines (1123 loc) · 75.1 KB
/
mrdatachallenge.Rmd
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
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: "MR Data Challenge 2019: Investigating the Causal Effect of LDL and HDL on Ischemic Stroke"
# author:
# - name: "Okezie Uche-Ikonne"
# affiliation: "Department of Mathematics and Statistics, Lancaster University, Lancaster, UK"
# email: o.uche-ikonne@lancaster.ac.uk
# - name: "Michael Holmes"
# affiliation: "Medical Research Council Population Health Research Unit at the University of Oxford, Oxford, UK."
# email: michael.holmes@ndph.ox.ac.uk
# - name: "Frank Dondelinger"
# affiliation: "Faculty of Health and Medicine, Lancaster University, Lancaster, UK"
# email: f.dondelinger@lancaster.ac.uk
# - name: "Tom Palmer"
# affiliation: "Department of Mathematics and Statistics, Lancaster University, Lancaster, UK"
# email: tom.palmer@lancaster.ac.uk
date: "`r format(Sys.time(), '%d %B %Y')`"
output:
bookdown::html_document2:
toc: yes
toc_depth: 3
toc_float:
collapsed: false
code_download: true
bibliography: reference.bib
link-citations: TRUE
---
```{r setup, include=FALSE, warning=FALSE, message=FALSE}
knitr::opts_chunk$set(include = FALSE)
library(MRChallenge2019)
library(ggplot2)
library(MendelianRandomization)
require(knitr)
require(rmarkdown)
require(bookdown)
require(styler)
library(ggpubr)
library(mvmeta)
library(meta)
library(dplyr)
library(diagram)
library(MVMR)
library(kableExtra)
source("mvmr2.R")
```
```{r}
data(Challenge_dat)
beta_mat <- Challenge_dat[32:149]
p_mat <- Challenge_dat[150:267]
### Outcomes
out_ybeta<- cbind(Challenge_dat$beta_amd,Challenge_dat$beta_alz,Challenge_dat$beta_t2d,Challenge_dat$beta_isch,Challenge_dat$beta_las,Challenge_dat$beta_ces,Challenge_dat$beta_svs)
out_yse<- cbind(Challenge_dat$se_amd,Challenge_dat$se_alz,Challenge_dat$se_t2d,Challenge_dat$se_isch,Challenge_dat$se_las,Challenge_dat$se_ces,Challenge_dat$se_svs)
## exposures (LDLs)
ldl_xbeta<- cbind(beta_mat[30],beta_mat[32],beta_mat[33],beta_mat[42],beta_mat[43],beta_mat[45],beta_mat[46],beta_mat[66],beta_mat[68],beta_mat[69],beta_mat[86])
ldl_pval<- cbind(p_mat[30],p_mat[32],p_mat[33],p_mat[42],p_mat[43],p_mat[45],p_mat[46],p_mat[66],p_mat[68],p_mat[69],p_mat[86])
## exposures (HDLs)
hdl_xbeta <- cbind(beta_mat[37],beta_mat[39],beta_mat[40],beta_mat[60],beta_mat[61],beta_mat[63],beta_mat[64],beta_mat[82],beta_mat[83],beta_mat[103],beta_mat[104],beta_mat[106],beta_mat[107],beta_mat[108])
hdl_pval <- cbind(p_mat[37],p_mat[39],p_mat[40],p_mat[60],p_mat[61],p_mat[63],p_mat[64],p_mat[82],p_mat[83],p_mat[103],p_mat[104],p_mat[106],p_mat[107],p_mat[108])
```
# Participants
- Okezie Uche-Ikonne, Department of Mathematics and Statistics, Lancaster University, Lancaster, UK, o.uche-ikonne@lancaster.ac.uk
- Michael Holmes, Medical Research Council Population Health Research Unit at the University of Oxford, Oxford, UK.
- Frank Dondelinger, Faculty of Health and Medicine, Lancaster University, Lancaster, UK.
- Tom Palmer, Department of Mathematics and Statistics, Lancaster University, Lancaster, UK.
# Motivation
There has been considerable research on the role of blood lipids and their associations with various cardiovascular traits [@holmesajkd2018]. While observational analyses have led to naïve classifications of "good" (higher density lipoprotein, HDL) and "bad" (lower density lipoprotein, LDL) blood lipids, the underlying causal relationships suggest that while LDL and triglycerides may have atherogenic characteristics, HDL-cholesterol is unlikely to play an important role in atherogenesis.
The [MRDataChallenge](https://www.mendelianrandomization.org.uk/the-mr-data-challenge-2019/) provides a summary level dataset by which contains the associations of genotypes (comprising 148 SNPs) with lipid traits and the associations of genotypes with 7 outcomes [@mrchallenge2019]. Of the seven outcomes, we selected ischemic stroke to investigate the casual relationship of LDL and HDL lipid traits using the Mendelian randomization (MR) approach [@daveysmith]. Figures \@ref(fig:dag1) and \@ref(fig:dag2) represent the DAGs for the proposed analysis.
```{r dag1, include=TRUE, echo=FALSE, fig.align='center', fig.cap="Directed acyclic graph (DAG) of the MR analysis to investigate the effect of LDL to ischemic stroke."}
DiagrammeR::grViz("
digraph mrdag {
graph [rankdir=TB, layout=neato]
node [shape=box,eight=0.3, width=0.3]
U [label='Confounders', pos='3,1!']
node [shape=box, height=0.5, width=0.5]
Y1 [label='Ischemic Stroke', pos='4,0!']
node [shape=box, height=0.3, width=0.3]
G1 [label='G@_{1}', pos='0,1!']
G2 [label='G@_{2}', pos='0,0!']
G3 [label='G@_{3}', pos='0,-1!']
X1 [label='LDL', pos='2,0!']
{ rank = same; Y1 }
G1 -> {X1}
G2 -> {X1}
G3 -> {X1}
U -> X1
U -> Y1
X1 -> {Y1}
}
", height = 300)
```
```{r dag2, include=TRUE, echo=FALSE, fig.align='center', fig.cap="DAG representing the MR analysis for the effect of HDL on ischemic stroke."}
DiagrammeR::grViz("
digraph mrdag {
graph [rankdir=TB, layout=neato]
node [shape=box,eight=0.3, width=0.3]
U [label='Confounders', pos='3,1!']
node [shape=box, height=0.5, width=0.5]
Y1 [label='Ischemic Stroke', pos='4,0!']
node [shape=box, height=0.3, width=0.3]
G1 [label='G@_{1}', pos='0,1!']
G2 [label='G@_{2}', pos='0,0!']
G3 [label='G@_{3}', pos='0,-1!']
X1 [label='HDL', pos='2,0!']
{ rank = same; Y1 }
G1 -> {X1}
G2 -> {X1}
G3 -> {X1}
U -> X1
U -> Y1
X1 -> {Y1}
}
", height = 300)
```
One cause of ischaemic stroke is the development of atherosclerosis, in which build-up of fatty deposits in the arterial wall leads to development of a plaque, which can disrupt the supply of oxygenated blood flow to the brain. There is strong evidence that LDL-related lipid phenotypes are causally implicated in the aetiology of atherosclerosis and coronary heart disease.
In a recent comment piece, @holmes2019ldl discussed that there is a size dependent threshold whereby lipid species that are bigger than small VLDLs, are too large to enter the arterial intima, as shown in Figure \@ref(fig:holmes2019fig1). Therefore, in our analysis we focused our investigation on those lipid species smaller than small VLDL: i.e. IDL and LDL. In addition, we wished to assess the causal relevance of HDL species.
```{r, holmes2019fig1, fig.cap='Figure 1 of @holmes2019ldl showing which sizes of lipid trait enter the arterial intima.', include=TRUE, echo=FALSE, fig.align='center'}
knitr::include_graphics("holmes-nrc-2019-fig1.png")
```
# Data
The MR Challenge data consists of summary data of the association of 148 genotypes with 118 lipid traits and 7 outcomes. We have trimmed the number of exposures used. Our low-density lipoprotein (LDL) analysis consists of 11 exposures whilst we have used 14 lipid traits associated with high-density lipoproteins (HDL).
The atherogenic lipid traits we investigated are;
* Concentration of IDL particles
* Free cholesterol in IDL
* Cholesterol esters in large LDL
* Free cholesterol in large LDL
* Phospholipids in IDL
* Concentration of Large LDL particles
* Phospholipids in large LDL
* Cholesterol esters in medium LDL
* Concentration of medium LDL particles
* Phospholipids in medium LDL
* Concentration of small LDL particles.
The lipid traits related to HDL that we investigated are;
* Cholesterol esters in large HDL
* Concentration of large HDL particles
* Phospholipids in large HDL
* Cholesterol esters in medium HDL
* Free cholesterol in medium HDL
* Concentration of medium HDL particles
* Phospholipids in medium HDL
* Concentration of small HDL particles
* Triglycerides in small HDL
* Cholesterol esters in very large HDL
* Free cholesterol in very large HDL
* Concentration of very large HDL particles
* Phospholipids in very large HDL
* Triglycerides in very large HDL.
# Analysis Methods
We used the inverse variance weighted (IVW) method to estimate the causal effect in summary-level data [@burgess2013mendelian]. The IVW model is denoted in equation \@ref(eq:IVW) where for a genotype $j$, $\widehat\Gamma_j$ represents the estimated genotype-outcome associations, $\widehat\gamma_j$ represents the estimated genotype-phenotype associations, and $\sigma_{yj}$ represents the estimated standard errors of the genotype-outcome associations.
$$
\frac{\hat{\Gamma}_{j}}{\sigma_{y_j}} = \frac{\beta\gamma_j}{\sigma_{y_j}} + \varepsilon_j, \quad \varepsilon_j \sim N(0,1)
(\#eq:IVW)
$$
We perform sensitivity analysis for our IVW estimates using the MR-Egger model [@bowden2015mendelian]. The MR-Egger model is an extension of the IVW model \@ref(eq:IVW) which includes the average pleiotropic effect as an intercept. By convention the residual variance is constrained to be greater than 1, which usually means that the MR-Egger model gives larger standard errors on its estimated causal effect than the IVW model. Equation \@ref(eq:egger) denotes the MR-Egger model.
$$
\frac{\hat{\Gamma}_{j}}{\sigma_{y_j}} = \frac{\beta_0}{\sigma_{y_j}} + \frac{\beta\gamma_j}{\sigma_{y_j}} + \varepsilon_j, \quad \varepsilon_j \sim N(0,\sigma^2)
(\#eq:egger)
$$
We also investigated causal effects of lipid traits adjusted for other traits using the multivariable MR (MVMR) method [@burgess2015re] as shown in equation \@ref(eq:mvmrr).
$$
\hat{\Gamma}_j = \beta_1\hat{\gamma}_{1,j} + \beta_2\hat{\gamma}_{2,j} + \varepsilon_j, \quad \varepsilon_j \sim N(0,\sigma^2).
(\#eq:mvmrr)
$$
To select which of the 148 genotypes to include in our analysis we took two approaches:
i. We selected genotypes with genome-wide significant p-values ($p < 5 \times 10^{-8}$) with the specific lipid trait of interest. These results are in [Section 4](#section4);
ii. We also selected genotypes based upon their individual contribution towards the Q-statistic, for either the IVW or MR-Egger model [@bowden2018improving]. Therefore, in this case we selected genotypes with Q-statistic p-values $\geq 0.05$. These results are in [Section 5](#section5).
We investigated the causal effect of each selected lipid trait and we then perform a meta-analysis our causal effect estimates according to their size and their specific trait.
```{r}
########## Functions ##########
#Function for GWAS significant snps
sieve <- function(xbeta,pval,ybeta,yse){
df = cbind(xbeta,pval,ybeta,yse)
dat = subset(df, pval < 5e-8, select = c(xbeta,pval,ybeta,yse))
dat2 = na.exclude(dat)
return(dat2)
}
#Function for IVW
ivw <- function(x, xse, y, yse) {
dat = mr_input(x, xse, y, yse)
mrivw = MendelianRandomization::mr_ivw(dat)
est = mrivw@Estimate
se = mrivw@StdError
LCI = mrivw@CILower
UCI = mrivw@CIUpper
Pval = mrivw@Pvalue
snps = mrivw@SNPs
ans = c(est, se, LCI, UCI, Pval, snps)
ans = round(ans, digits = 4)
return(ans)
}
#Function for MR-Egger
mregger <- function(x, xse, y, yse) {
dat = mr_input(x, xse, y, yse)
mregger = MendelianRandomization::mr_egger(dat)
int = mregger@Intercept
int_se = mregger@StdError.Int
int_LI = mregger@CILower.Int
int_UI = mregger@CIUpper.Int
int_pval = mregger@Pvalue.Int
est = mregger@Estimate
se = mregger@StdError.Est
LCI = mregger@CILower.Est
UCI = mregger@CIUpper.Est
est_pval = mregger@Pvalue.Est
AvgPleio = c(int, int_se,int_LI,int_UI,int_pval)
Causal = c(est, se, LCI, UCI, est_pval)
ans = rbind(AvgPleio,Causal)
return(ans)
}
## Selecting genetic variants based on their individual contribution to Q-statistics
selectsnp<- function(rsid,xbeta,ybeta,yse){
dat = data.frame(rsid,xbeta,ybeta,yse)
#dat = na.exclude(dat)
# ratio estimate
ratio = ybeta/xbeta
# first order weights
weight = (xbeta/yse)^2
# Multiplication of weights and ratio estimate
ratweight = ratio * sqrt(weight)
# Estimating causality using IVW
causal = summary(lm(ratweight ~ 0 + sqrt(weight)))$coef[1]
# Calculating individual Q-statistics
Qj = weight * (ratio - causal)^2
# Define chi-square test
chi_Qj = 0
# Chi-squared test for each Q-stats
for( i in 1:length(Qj)){
chi_Qj[i] = pchisq(Qj[i],1,lower.tail = FALSE)
}
# indicating outlier for each Q-stats
# outlier <- rep(0,length(dat[,2]))
dat$Qj <- Qj
dat$chi_Qj <- chi_Qj
dat$outlier <- rep(0,length(dat[,1]))
dat = na.exclude(dat)
alpha = 0.05
for (i in 1:length(dat[,1])){
if(dat$chi_Qj[i]<alpha) {
dat$outlier[i] <- 1
}
}
# Extracting non-outliers based on their Q contribution
dat$Outlier<-factor(dat$outlier)
levels(dat$Outlier)[levels(dat$Outlier)=="0"] <- "Variant"
levels(dat$Outlier)[levels(dat$Outlier)=="1"] <- "Outlier"
dat_out = subset(dat, Outlier == "Variant")
return(dat_out)
}
## sieving snps with GWAS signficant values
ldl_mat1<-sieve(ldl_xbeta[,1],ldl_pval[,1],out_ybeta[,4],out_yse[,4])
ldl_mat2<-sieve(ldl_xbeta[,2],ldl_pval[,2],out_ybeta[,4],out_yse[,4])
ldl_mat3<-sieve(ldl_xbeta[,3],ldl_pval[,3],out_ybeta[,4],out_yse[,4])
ldl_mat4<-sieve(ldl_xbeta[,4],ldl_pval[,4],out_ybeta[,4],out_yse[,4])
ldl_mat5<-sieve(ldl_xbeta[,5],ldl_pval[,5],out_ybeta[,4],out_yse[,4])
ldl_mat6<-sieve(ldl_xbeta[,6],ldl_pval[,6],out_ybeta[,4],out_yse[,4])
ldl_mat7<-sieve(ldl_xbeta[,7],ldl_pval[,7],out_ybeta[,4],out_yse[,4])
ldl_mat8<-sieve(ldl_xbeta[,8],ldl_pval[,8],out_ybeta[,4],out_yse[,4])
ldl_mat9<-sieve(ldl_xbeta[,9],ldl_pval[,9],out_ybeta[,4],out_yse[,4])
ldl_mat10<-sieve(ldl_xbeta[,10],ldl_pval[,10],out_ybeta[,4],out_yse[,4])
ldl_mat11<-sieve(ldl_xbeta[,11],ldl_pval[,11],out_ybeta[,4],out_yse[,4])
hdl_mat1<-sieve(hdl_xbeta[,1],hdl_pval[,1],out_ybeta[,4],out_yse[,4])
hdl_mat2<-sieve(hdl_xbeta[,2],hdl_pval[,2],out_ybeta[,4],out_yse[,4])
hdl_mat3<-sieve(hdl_xbeta[,3],hdl_pval[,3],out_ybeta[,4],out_yse[,4])
hdl_mat4<-sieve(hdl_xbeta[,4],hdl_pval[,4],out_ybeta[,4],out_yse[,4])
hdl_mat5<-sieve(hdl_xbeta[,5],hdl_pval[,5],out_ybeta[,4],out_yse[,4])
hdl_mat6<-sieve(hdl_xbeta[,6],hdl_pval[,6],out_ybeta[,4],out_yse[,4])
hdl_mat7<-sieve(hdl_xbeta[,7],hdl_pval[,7],out_ybeta[,4],out_yse[,4])
hdl_mat8<-sieve(hdl_xbeta[,8],hdl_pval[,8],out_ybeta[,4],out_yse[,4])
hdl_mat9<-sieve(hdl_xbeta[,9],hdl_pval[,9],out_ybeta[,4],out_yse[,4])
hdl_mat10<-sieve(hdl_xbeta[,10],hdl_pval[,10],out_ybeta[,4],out_yse[,4])
hdl_mat11<-sieve(hdl_xbeta[,11],hdl_pval[,11],out_ybeta[,4],out_yse[,4])
hdl_mat12<-sieve(hdl_xbeta[,12],hdl_pval[,12],out_ybeta[,4],out_yse[,4])
hdl_mat13<-sieve(hdl_xbeta[,13],hdl_pval[,13],out_ybeta[,4],out_yse[,4])
hdl_mat14<-sieve(hdl_xbeta[,14],hdl_pval[,14],out_ybeta[,4],out_yse[,4])
# Selecting instruments using their individual Q-statistics LDLs
ldlsnps_Q<-selectsnp(Challenge_dat$rsid,ldl_xbeta[,1],out_ybeta[,4],out_yse[,4])
ldlsnps_Q1<-selectsnp(Challenge_dat$rsid,ldl_xbeta[,2],out_ybeta[,4],out_yse[,4])
ldlsnps_Q2<-selectsnp(Challenge_dat$rsid,ldl_xbeta[,3],out_ybeta[,4],out_yse[,4])
ldlsnps_Q3<-selectsnp(Challenge_dat$rsid,ldl_xbeta[,4],out_ybeta[,4],out_yse[,4])
ldlsnps_Q4<-selectsnp(Challenge_dat$rsid,ldl_xbeta[,5],out_ybeta[,4],out_yse[,4])
ldlsnps_Q5<-selectsnp(Challenge_dat$rsid,ldl_xbeta[,6],out_ybeta[,4],out_yse[,4])
ldlsnps_Q6<-selectsnp(Challenge_dat$rsid,ldl_xbeta[,7],out_ybeta[,4],out_yse[,4])
ldlsnps_Q7<-selectsnp(Challenge_dat$rsid,ldl_xbeta[,8],out_ybeta[,4],out_yse[,4])
ldlsnps_Q8<-selectsnp(Challenge_dat$rsid,ldl_xbeta[,9],out_ybeta[,4],out_yse[,4])
ldlsnps_Q9<-selectsnp(Challenge_dat$rsid,ldl_xbeta[,10],out_ybeta[,4],out_yse[,4])
ldlsnps_Q10<-selectsnp(Challenge_dat$rsid,ldl_xbeta[,11],out_ybeta[,4],out_yse[,4])
#HDLs
hdlsnps_Q<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,1],out_ybeta[,4],out_yse[,4])
hdlsnps_Q1<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,2],out_ybeta[,4],out_yse[,4])
hdlsnps_Q2<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,3],out_ybeta[,4],out_yse[,4])
hdlsnps_Q3<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,4],out_ybeta[,4],out_yse[,4])
hdlsnps_Q4<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,5],out_ybeta[,4],out_yse[,4])
hdlsnps_Q5<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,6],out_ybeta[,4],out_yse[,4])
hdlsnps_Q6<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,7],out_ybeta[,4],out_yse[,4])
hdlsnps_Q7<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,8],out_ybeta[,4],out_yse[,4])
hdlsnps_Q8<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,9],out_ybeta[,4],out_yse[,4])
hdlsnps_Q9<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,10],out_ybeta[,4],out_yse[,4])
hdlsnps_Q10<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,11],out_ybeta[,4],out_yse[,4])
hdlsnps_Q11<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,12],out_ybeta[,4],out_yse[,4])
hdlsnps_Q12<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,13],out_ybeta[,4],out_yse[,4])
hdlsnps_Q13<-selectsnp(Challenge_dat$rsid,hdl_xbeta[,14],out_ybeta[,4],out_yse[,4])
```
# Results
## GWAS-significant genotype-phenotype associations {#section4}
### IVW estimates
```{r}
### IVW for LDL
ldl_ivw1<-ivw(ldl_mat1[,1],ldl_mat1[,1],ldl_mat1[,3],ldl_mat1[,4])
ldl_ivw2<-ivw(ldl_mat2[,1],ldl_mat2[,2],ldl_mat2[,3],ldl_mat2[,4])
ldl_ivw3<-ivw(ldl_mat3[,1],ldl_mat3[,2],ldl_mat3[,3],ldl_mat3[,4])
ldl_ivw4<-ivw(ldl_mat4[,1],ldl_mat4[,2],ldl_mat4[,3],ldl_mat4[,4])
ldl_ivw5<-ivw(ldl_mat5[,1],ldl_mat5[,2],ldl_mat5[,3],ldl_mat5[,4])
ldl_ivw6<-ivw(ldl_mat6[,1],ldl_mat6[,2],ldl_mat6[,3],ldl_mat6[,4])
ldl_ivw7<-ivw(ldl_mat7[,1],ldl_mat7[,2],ldl_mat7[,3],ldl_mat7[,4])
ldl_ivw8<-ivw(ldl_mat8[,1],ldl_mat8[,2],ldl_mat8[,3],ldl_mat8[,4])
ldl_ivw9<-ivw(ldl_mat9[,1],ldl_mat9[,2],ldl_mat9[,3],ldl_mat9[,4])
ldl_ivw10<-ivw(ldl_mat10[,1],ldl_mat10[,2],ldl_mat10[,3],ldl_mat10[,4])
ldl_ivw11<-ivw(ldl_mat11[,1],ldl_mat11[,2],ldl_mat11[,3],ldl_mat11[,4])
tab <- rbind(ldl_ivw1,ldl_ivw2,ldl_ivw3,ldl_ivw4,ldl_ivw5,ldl_ivw6,ldl_ivw7,ldl_ivw8,ldl_ivw9,ldl_ivw10,ldl_ivw11)
lipid_traits <- c(
"Free cholesterol in IDL",
"Concentration of IDL particles",
"Phospholipids in IDL",
"Cholesterol esters in large LDL",
"Free cholesterol in large LDL",
"Concentration of large LDL particles",
"Phospholipids in large LDL",
"Cholesterol esters in medium LDL",
"Concentration of medium LDL particles",
"Phospholipids in medium LDL",
"Concentration of small LDL particles"
)
tab <- cbind (lipid_traits,unname(tab))
colnames(tab) <- c("Exposures","Estimate", "SE","LI","UI", "Pval","SNPs")
### HDLs##
hdl_ivw1<-ivw(hdl_mat1[,1],hdl_mat1[,2],hdl_mat1[,3],hdl_mat1[,4])
hdl_ivw2<-ivw(hdl_mat2[,1],hdl_mat2[,2],hdl_mat2[,3],hdl_mat2[,4])
hdl_ivw3<-ivw(hdl_mat3[,1],hdl_mat3[,2],hdl_mat3[,3],hdl_mat3[,4])
hdl_ivw4<-ivw(hdl_mat4[,1],hdl_mat4[,2],hdl_mat4[,3],hdl_mat4[,4])
hdl_ivw5<-ivw(hdl_mat5[,1],hdl_mat5[,2],hdl_mat5[,3],hdl_mat5[,4])
hdl_ivw6<-ivw(hdl_mat6[,1],hdl_mat6[,2],hdl_mat6[,3],hdl_mat6[,4])
hdl_ivw7<-ivw(hdl_mat7[,1],hdl_mat7[,2],hdl_mat7[,3],hdl_mat7[,4])
hdl_ivw8<-ivw(hdl_mat8[,1],hdl_mat8[,2],hdl_mat8[,3],hdl_mat8[,4])
hdl_ivw9<-ivw(hdl_mat9[,1],hdl_mat9[,2],hdl_mat9[,3],hdl_mat9[,4])
hdl_ivw10<-ivw(hdl_mat10[,1],hdl_mat10[,2],hdl_mat10[,3],hdl_mat10[,4])
hdl_ivw11<-ivw(hdl_mat11[,1],hdl_mat11[,2],hdl_mat11[,3],hdl_mat11[,4])
hdl_ivw12<-ivw(hdl_mat12[,1],hdl_mat12[,2],hdl_mat12[,3],hdl_mat12[,4])
hdl_ivw13<-ivw(hdl_mat13[,1],hdl_mat13[,2],hdl_mat13[,3],hdl_mat13[,4])
hdl_ivw14<-ivw(hdl_mat14[,1],hdl_mat14[,2],hdl_mat14[,3],hdl_mat14[,4])
tab1 <- rbind(hdl_ivw1,hdl_ivw2,hdl_ivw3,hdl_ivw4,hdl_ivw5,hdl_ivw6,hdl_ivw7,hdl_ivw8,hdl_ivw9,hdl_ivw10,hdl_ivw11,hdl_ivw12,hdl_ivw13,hdl_ivw14)
traits <- c(
"Cholesterol esters in large HDL",
"Concentration of large HDL particles",
"Phospholipids in large HDL",
"Cholesterol esters in medium HDL",
"Free cholesterol in medium HDL",
"Concentration of medium HDL particles",
"Phospholipids in medium HDL",
"Concentration of small HDL particles",
"Triglycerides in small HDL",
"Cholesterol esters in very large HDL",
"Free cholesterol in very large HDL",
"Concentration of very large HDL particles",
"Phospholipids in very large HDL",
"Triglycerides in very large HDL"
)
tab1 <- cbind(traits, unname(tab1))
colnames(tab1) <- c("Exposures","Estimate", "SE","LI","UI", "Pval", "SNPs")
```
IVW estimates of the causal effect of lipid fractions related to LDLs are shown in Table \@ref(tab:tab) and Figure \@ref(fig:pl1). We can see from the SNPs column that the number of selected SNPs is small for all the traits. The MR point estimates are positive which means that on average a higher level of LDL related lipid is related to a higher risk of ischemic stroke (since the associations are risk estimates on the log scale). However, the estimates all report confidence intervals spanning the null. The positive point estimates concur with our scientific expectations as the atherogenic characteristic increase the risk of ischemic stroke. However, more instruments would be needed to increase the statistical power of these estimates.
```{r tab, include=TRUE, echo=FALSE}
tab <- as.data.frame(tab)
tab %>%
mutate(SNPs = ifelse (
as.numeric(as.character(SNPs)) < 2,
cell_spec(as.numeric(as.character(SNPs)), color = "white", background = "grey"),
cell_spec(as.numeric(as.character(SNPs)), color = "black", background = "white")
))%>%
mutate(Estimate = ifelse (
as.numeric(as.character(Estimate)) < 0,
cell_spec(as.numeric(as.character(Estimate)), color = "black", background = "grey"),
cell_spec(as.numeric(as.character(Estimate)), color = "black", background = "white")
))%>%
kable("html",escape = F, caption = "IVW estimates for exposures related LDLs", digits = 4)%>%
kable_styling("striped", full_width = TRUE)
```
```{r}
tabx <-
rbind(
ldl_ivw1,
ldl_ivw2,
ldl_ivw3,
ldl_ivw4,
ldl_ivw5,
ldl_ivw6,
ldl_ivw7,
ldl_ivw8,
ldl_ivw9,
ldl_ivw10,
ldl_ivw11
)
tabg <-
data.frame(
Estimates = tabx[, 1],
SE = tabx[, 2],
LI = tabx[, 3],
UI = tabx[, 4],
exposures = lipid_traits
)
pl1 <-
ggplot() + geom_pointrange(data = tabg, aes(
x = exposures,
y = Estimates,
ymin = LI,
ymax = UI
)) + xlab("Exposures") + ylab("Estimates") + ggtitle("LDLs") + coord_flip() + geom_hline(yintercept =
0, lty = 2)
```
```{r, pl1, include=TRUE, echo=FALSE, fig.align='center', fig.cap="IVW Estimates for LDLs"}
pl1
```
Table \@ref(tab:tab1) and Figure \@ref(fig:pl2) show causal estimates of lipid fractions related to the HDLs. These point estimates are generally negative with confidence intervals spanning the null. In the Table shaded cells indicate a small number of genotypes, which is of interest because the MR-Egger estimator cannot be performed with these lipid traits due to the low number of instruments.
```{r tab1, include=TRUE, echo=FALSE}
tab1 <- as.data.frame(tab1)
tab1 %>%
mutate(SNPs = ifelse (
as.numeric(SNPs) < 3,
cell_spec(SNPs, color = "white", background = "grey"),
cell_spec(SNPs, color = "black", background = "white")
))%>%
mutate(Estimate = ifelse (
as.numeric(as.character(Estimate)) > 0.01,
cell_spec(as.numeric(as.character(Estimate)), color = "white", background = "grey"),
cell_spec(as.numeric(as.character(Estimate)), color = "black", background = "white")
))%>%
kable("html",escape = F, caption = "IVW estimates for exposures related HDLs", digits = 4)%>%
kable_styling("striped", full_width = TRUE)
```
```{r}
tabx1 <- rbind(hdl_ivw1,hdl_ivw2,hdl_ivw3,hdl_ivw4,hdl_ivw5,hdl_ivw6,hdl_ivw7,hdl_ivw8,hdl_ivw9,hdl_ivw10,hdl_ivw11,hdl_ivw12,hdl_ivw13,hdl_ivw14)
tabg1 <- data.frame(Estimates = tabx1[,1], SE = tabx1[,2], LI = tabx1[,3], UI = tabx1[,4], exposures = traits)
pl2 <- ggplot(data=tabg1, aes(x=exposures,y=Estimates, ymin=LI, ymax=UI)) + geom_pointrange() +xlab("Exposures")+ ylab("Estimates") + ggtitle("HDLs") + coord_flip() + geom_hline(yintercept=0, lty=2)
```
```{r, pl2, include=TRUE, echo=FALSE, fig.align='center', fig.cap="IVW Estimates for HDLs"}
pl2
```
### MR-Egger estimates
```{r}
ldl_mregger1<-mregger(ldl_mat1[,1],ldl_mat1[,2],ldl_mat1[,3],ldl_mat1[,4])
ldl_mregger2<-mregger(ldl_mat2[,1],ldl_mat2[,2],ldl_mat2[,3],ldl_mat2[,4])
ldl_mregger3<-mregger(ldl_mat3[,1],ldl_mat3[,2],ldl_mat3[,3],ldl_mat3[,4])
ldl_mregger4<-mregger(ldl_mat4[,1],ldl_mat4[,2],ldl_mat4[,3],ldl_mat4[,4])
ldl_mregger5<-mregger(ldl_mat5[,1],ldl_mat5[,2],ldl_mat5[,3],ldl_mat5[,4])
ldl_mregger6<-mregger(ldl_mat6[,1],ldl_mat6[,2],ldl_mat6[,3],ldl_mat6[,4])
ldl_mregger7<-mregger(ldl_mat7[,1],ldl_mat7[,2],ldl_mat7[,3],ldl_mat7[,4])
ldl_mregger8<-mregger(ldl_mat8[,1],ldl_mat8[,2],ldl_mat8[,3],ldl_mat8[,4])
ldl_mregger9<-mregger(ldl_mat9[,1],ldl_mat9[,2],ldl_mat9[,3],ldl_mat9[,4])
ldl_mregger10<-mregger(ldl_mat10[,1],ldl_mat10[,2],ldl_mat10[,3],ldl_mat10[,4])
ldl_mregger11<-mregger(ldl_mat11[,1],ldl_mat11[,2],ldl_mat11[,3],ldl_mat11[,4])
tabk <- rbind(ldl_mregger1,ldl_mregger2,ldl_mregger3,ldl_mregger4,ldl_mregger5,ldl_mregger6,ldl_mregger7,ldl_mregger8,ldl_mregger9,ldl_mregger10,ldl_mregger11)
colnames(tabk) <- c("Estimate", "SE","LI","UI", "Pval")
### HDLs##
hdl_mregger1<-mregger(hdl_mat1[,1],hdl_mat1[,2],hdl_mat1[,3],hdl_mat1[,4])
hdl_mregger2<-mregger(hdl_mat2[,1],hdl_mat2[,2],hdl_mat2[,3],hdl_mat2[,4])
hdl_mregger3<-mregger(hdl_mat3[,1],hdl_mat3[,2],hdl_mat3[,3],hdl_mat3[,4])
hdl_mregger4<-mregger(hdl_mat11[,1],hdl_mat11[,2],hdl_mat11[,3],hdl_mat11[,4])
hdl_mregger5<-mregger(hdl_mat13[,1],hdl_mat13[,2],hdl_mat13[,3],hdl_mat13[,4])
tabk1 <- rbind(hdl_mregger1,hdl_mregger2,hdl_mregger3,hdl_mregger4,hdl_mregger5)
colnames(tabk1) <- c("Estimate", "SE","LI","UI", "Pval")
```
In this section, we use the MR-Egger model to perform sensitivity analysis for the IVW estimates. Table \@ref(tab:tabk) shows estimates from the MR-Egger model for lipid fractions related to LDLs. In general the point estimates are positive and larger in magnitude than the IVW estimates. The one exception is the point estimate for phospholipids in medium LDL, which shows a negative causal estimate with a confidence interval spanning the null. We find no strong evidence against the null hypothesis of no pleiotropy, since the estimates of the intercepts (`AvgPleio`) are all close to the null with large p-values.
```{r tabk, include=TRUE, echo=FALSE, fig.align='center'}
# tabe1 <- kable(tab1, digits = 3)
# kable_styling(tabe1, "striped", position = "center")
kable(tabk, caption = "MR-Egger estimates for LDL related phenotypes", digits = 4) %>%
kable_styling("striped", full_width = T) %>%
pack_rows("Free cholesterol in IDL", 1, 2) %>%
pack_rows("Concentration of IDL particles", 3, 4) %>%
pack_rows("Phospholipids in IDL", 5, 6) %>%
pack_rows("Concentration of IDL particles", 7, 8) %>%
pack_rows("Free cholesterol in large LDL", 9, 10) %>%
pack_rows("Concentration of large LDL particles", 11, 12) %>%
pack_rows("Phospholipids in large LDL", 13, 14) %>%
pack_rows("Cholesterol esters in medium LDL", 15, 16) %>%
pack_rows("Concentration of medium LDL particles", 17, 18) %>%
pack_rows("Phospholipids in medium LDL", 19, 20) %>%
pack_rows("Concentration of small LDL particles", 21, 22)
```
Sensitivity analysis of the lipid traits related to HDLs in Table \@ref(tab:tabk1) show negative point estimates with confidence intervals spanning the null. This would fit with a narrative of HDL either being protective or having a null effect on the risk of ischemic stroke, however the evidence against the null hypothesis is very weak.
```{r tabk1, include=TRUE, echo=FALSE, fig.align='center'}
kable(tabk1, caption = "MR-Egger estimates for HDL related phenotypes", digits = 4) %>%
kable_styling("striped", full_width = T) %>%
pack_rows("Cholesterol esters in large HDL", 1, 2) %>%
pack_rows("Concentration of large HDL particles", 3, 4) %>%
pack_rows("Phospholipids in large HDL", 5, 6) %>%
pack_rows("Free cholesterol in very large HDL", 7, 8) %>%
pack_rows("Phospholipids in very large HDL", 9, 10)
```
### Meta-analysis of exposure traits
In an attempt to increase statistical power, we performed a meta-analysis of the results by lipid category and molecular size.
#### Risk factor categories
```{r}
### LDL groups
###
con_ldl<- rbind(tabg[2,],tabg[6,],tabg[9,],tabg[11,])
ldlmetan2 <- metagen(Estimates,SE, data = con_ldl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Concentration")
###
pho_ldl <- rbind(tabg[3,],tabg[7,],tabg[10,])
ldlmetan3 <- metagen(Estimates,SE, data = pho_ldl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Phospholipids")
###
freechol_ldl <- rbind(tabg[1,],tabg[5,])
ldlmetan4 <- metagen(Estimates,SE, data = freechol_ldl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Free Cholesterol")
#plotmetan4<-meta::forest(ldlmetan4)
###
cholest_ldl <- rbind(tabg[4,],tabg[8,])
ldlmetan5 <- metagen(Estimates,SE, data = cholest_ldl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Cholesterol Esters")
#plotmetan5<-meta::forest(ldlmetan5)
resldlest2<-c(ldlmetan2$k,ldlmetan2$TE.random,ldlmetan2$seTE.random,ldlmetan2$lower.random,ldlmetan2$upper.random,round(ldlmetan2$pval.random, digits = 4))
resldlest3<-c(ldlmetan3$k,ldlmetan3$TE.random,ldlmetan3$seTE.random,ldlmetan3$lower.random,ldlmetan3$upper.random,round(ldlmetan3$pval.random, digits = 4))
resldlest4<-c(ldlmetan4$k,ldlmetan4$TE.random,ldlmetan4$seTE.random,ldlmetan4$lower.random,ldlmetan4$upper.random,round(ldlmetan4$pval.random, digits = 4))
resldlest5<-c(ldlmetan5$k,ldlmetan5$TE.random,ldlmetan5$seTE.random,ldlmetan5$lower.random,ldlmetan5$upper.random,round(ldlmetan5$pval.random, digits = 4))
tabff<- rbind(resldlest2,resldlest3,resldlest4,resldlest5)
colnames(tabff)<- c("N","Estimate", "SE","LI","UI","Pval")
rownames(tabff)<- c("Concentration", "Phospholipids","Free Cholesterol","Cholesterol esters")
```
Table \@ref(tab:tabff) shows results from the meta-analysis of the IVW estimates. The point estimates show null or positive estimates with confidence intervals spanning the null, however given the number of instruments the estimates show how despite the meta-analysis, the analyses yield imprecise causal estimates. Results in Table \@ref(tab:tabff1) are similar to the risk factor categories of LDLs. The point estimates show null or negative estimates with confidence intervals spanning the null.
```{r tabff, include=TRUE, echo=FALSE}
tabff <- as.data.frame(tabff)
tabff %>%
kable("html",escape = F, caption = "Meta-analysis of IVW estimates from LDL related phenotypes", digits = 4)%>%
kable_styling("striped", full_width = TRUE)
```
```{r}
### HDL groups
metatabg1<- cbind(tabg1,as.character(traits))
hdlmetan<-metagen(Estimates,SE, data = metatabg1, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Total Cholesterol")
###
cholest_hdl<- rbind(tabg1[1,],tabg1[4,],tabg1[10,])
hdlmeta1<-metagen(Estimates,SE, data = cholest_hdl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Cholesterol esters")
###
freechol_hdl<- rbind(tabg1[5,], tabg1[11,])
hdlmeta2<-metagen(Estimates,SE, data = freechol_hdl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Free Cholesterol")
###
con_hdl<- rbind(tabg1[2,],tabg1[6,],tabg1[8,],tabg1[12,])
hdlmeta3<-metagen(Estimates,SE, data = con_hdl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Concentration")
###
pho_hdl<- rbind(tabg1[3,],tabg1[7,],tabg1[14,])
hdlmeta4<-metagen(Estimates,SE, data = pho_hdl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Phospholipids")
###
trig_hdl<- rbind(tabg1[9,],tabg1[14,])
hdlmeta5<-metagen(Estimates,SE, data = trig_hdl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Triglycerides")
reshdlest1<-c(hdlmeta1$k,hdlmeta1$TE.random,hdlmeta1$seTE.random,hdlmeta1$lower.random,hdlmeta1$upper.random,hdlmeta1$pval.random)
reshdlest2<-c(hdlmeta2$k,hdlmeta2$TE.random,hdlmeta2$seTE.random,hdlmeta2$lower.random,hdlmeta2$upper.random,hdlmeta2$pval.random)
reshdlest3<-c(hdlmeta3$k,hdlmeta3$TE.random,hdlmeta3$seTE.random,hdlmeta3$lower.random,hdlmeta3$upper.random,hdlmeta3$pval.random)
reshdlest4<-c(hdlmeta4$k,hdlmeta4$TE.random,hdlmeta4$seTE.random,hdlmeta4$lower.random,hdlmeta4$upper.random,hdlmeta4$pval.random)
reshdlest5<-c(hdlmeta5$k,hdlmeta5$TE.random,hdlmeta5$seTE.random,hdlmeta5$lower.random,hdlmeta5$upper.random,hdlmeta5$pval.random)
tabff1<- rbind(reshdlest1,reshdlest2,reshdlest3,reshdlest4,reshdlest5)
colnames(tabff1)<- c("N","Mean", "SE","LI","UI","Pval")
rownames(tabff1)<- c("Cholesterol Esters","Free Cholesterol",
"Concentration","phospholipids","Triglycerides")
```
```{r tabff1, include=TRUE, echo=FALSE}
tabff1 <- as.data.frame(tabff1)
tabff1 %>%
kable("html",escape = F, caption = "Meta-analysis of IVW estimates for HDL related phenotypes", digits = 4)%>%
kable_styling("striped", full_width = TRUE)
```
#### Sizes
```{r}
### LDL sizes
intermediate_ldl<- rbind(tabg[1,],tabg[2,],tabg[3,])
ldlsize1<- metagen(Estimates,SE, data = intermediate_ldl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Intermediate LDLs")
med_ldl<- rbind(tabg[8,],tabg[9,],tabg[10,])
ldlsize2<- metagen(Estimates,SE, data = med_ldl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Medium LDLs")
lar_ldl<- rbind(tabg[4,],tabg[5,],tabg[6,],tabg[7,])
ldlsize3<- metagen(Estimates,SE, data = lar_ldl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Large LDLs")
ldlsizes1<- c(ldlsize1$k,ldlsize1$TE.random,ldlsize1$seTE.random,ldlsize1$lower.random,ldlsize1$upper.random,round(ldlsize1$pval.random,digits = 4))
ldlsizes2<- c(ldlsize2$k,ldlsize2$TE.random,ldlsize2$seTE.random,ldlsize2$lower.random,ldlsize2$upper.random,round(ldlsize2$pval.random,digits = 4))
ldlsizes3<- c(ldlsize3$k,ldlsize3$TE.random,ldlsize3$seTE.random,ldlsize3$lower.random,ldlsize3$upper.random,round(ldlsize3$pval.random,digits = 4))
tabbf<- rbind(ldlsizes1,ldlsizes2,ldlsizes3)
colnames(tabbf)<- c("N","Mean", "SE","LI","UI","P-val")
rownames(tabbf)<- c("Intermediate","Medium","Large")
```
In this section we present result meta-analysing over the lipid traits for each size of molecule. LDL results are shown in Table \@ref(tab:tabbf). Similar to the risk factor categories in \@ref(tab:tabff) the sizes have null or positive causal estimate with no strong evidence against the null. Table \@ref(tab:tabbf) shows that the medium and large sized LDLs have a greater magnitude of effect than the intermediates sizes which matches our scientific rationale.
```{r, tabbf, include=TRUE, echo=FALSE}
tabbf <- as.data.frame(tabbf)
tabbf %>%
kable("html",escape = F, caption = "Meta-analysis of IVW estimates for LDL sizes", digits = 4)%>%
kable_styling("striped", full_width = TRUE)
```
```{r}
### HDL sizes
small_hdl<- rbind(tabg1[8,],tabg1[9,])
hdlsize1<- metagen(Estimates,SE, data = small_hdl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Small hdls")
med_hdl<- rbind(tabg1[4,],tabg1[5,],tabg1[6,],tabg1[7,])
hdlsize2<- metagen(Estimates,SE, data = med_hdl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Medium hdls")
lar_hdl<- rbind(tabg1[1,],tabg1[2,],tabg1[3,])
hdlsize3<- metagen(Estimates,SE, data = lar_hdl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Large hdls")
vlar_hdl<- rbind(tabg1[10,],tabg1[11,],tabg1[12,],tabg1[13,],tabg1[14,])
hdlsize4<- metagen(Estimates,SE, data = vlar_hdl, studlab = paste(exposures), comb.fixed = FALSE, comb.random = TRUE,hakn = FALSE,prediction=TRUE,sm="SMD", method.tau = "REML", title = "Very large hdls")
hdlsizes1<- c(hdlsize1$k,hdlsize1$TE.random,hdlsize1$seTE.random,hdlsize1$lower.random,hdlsize1$upper.random,round(hdlsize1$pval.random,digits = 4))
hdlsizes2<- c(hdlsize2$k,hdlsize2$TE.random,hdlsize2$seTE.random,hdlsize2$lower.random,hdlsize2$upper.random,round(hdlsize2$pval.random,digits = 4))
hdlsizes3<- c(hdlsize3$k,hdlsize3$TE.random,hdlsize3$seTE.random,hdlsize3$lower.random,hdlsize3$upper.random,round(hdlsize3$pval.random,digits = 4))
hdlsizes4<- c(hdlsize4$k,hdlsize4$TE.random,hdlsize4$seTE.random,hdlsize4$lower.random,hdlsize4$upper.random,round(hdlsize4$pval.random,digits = 4))
tabbf1<- rbind(hdlsizes1,hdlsizes2,hdlsizes3,hdlsizes4)
colnames(tabbf1)<- c("N","Mean", "SE","LI","UI","P-val")
rownames(tabbf1)<- c("Small","Medium","Large","Very Large")
```
For the HDL sizes in Table \@ref(tab:tabbf1) the point estimates show negative point estimates close to the null however none of the estimates are statistically significant. We find that the pooled point estimated for the very large HDL molecules is closest to the null.
```{r, tabbf1, include=TRUE, echo=FALSE, fig.align='center'}
tabbf1 <- as.data.frame(tabbf1)
tabbf1 %>%
kable("html",escape = F, caption = "Meta-analysis of IVW estimates for HDL Sizes", digits = 4)%>%
kable_styling("striped", full_width = TRUE)
```
### Multivariate Meta-analysis of MR-Egger estimates
```{r}
#### Free Cholesterol
betaldl1<- matrix(nrow = 2, ncol = 2, NA)
betaldl1[1,] <- c(tabk[1,1],tabk[2,1])
betaldl1[2,] <- c(tabk[9,1],tabk[10,1])
ldl1cov<- matrix(c((tabk[1,2])^2,0,0,(tabk[2,2])^2), byrow = T,ncol = 2)
ldl2cov<- matrix(c((tabk[9,2])^2,0,0,(tabk[10,2])^2), byrow = T,ncol = 2)
smatlist1<- list(ldl1cov, ldl2cov)
ldl1mvmeta<- mvmeta(betaldl1, smatlist1)
#### Concentration
betaldl3<- matrix(nrow = 4, ncol = 2, NA)
betaldl3[1,] <- c(tabk[3,1],tabk[4,1])
betaldl3[2,] <- c(tabk[11,1],tabk[12,1])
betaldl3[3,] <- c(tabk[17,1],tabk[18,1])
betaldl3[4,] <- c(tabk[21,1],tabk[22,1])
ldlvcoov<- matrix(c((tabk[3,2])^2,0,0,(tabk[4,2])^2), byrow = T,ncol = 2)
ldlvcoov1<- matrix(c((tabk[11,2])^2,0,0,(tabk[12,2])^2), byrow = T,ncol = 2)
ldlvcoov2<- matrix(c((tabk[17,2])^2,0,0,(tabk[18,2])^2), byrow = T,ncol = 2)
ldlvcoov3<- matrix(c((tabk[21,2])^2,0,0,(tabk[22,2])^2), byrow = T,ncol = 2)
smatlist3<- list(ldlvcoov, ldlvcoov1, ldlvcoov2, ldlvcoov3)
ldl3mvmeta<- mvmeta(betaldl3, smatlist3)
#### phospholipids
betaldl4<- matrix(nrow = 3, ncol = 2, NA)
betaldl4[1,] <- c(tabk[5,1],tabk[6,1])
betaldl4[2,] <- c(tabk[13,1],tabk[14,1])
betaldl4[3,] <- c(tabk[19,1],tabk[20,1])
ldl1coov<- matrix(c((tabk[5,2])^2,0,0,(tabk[6,2])^2), byrow = T,ncol = 2)
ldl2coov<- matrix(c((tabk[13,2])^2,0,0,(tabk[14,2])^2), byrow = T,ncol = 2)
ldl3coov<- matrix(c((tabk[19,2])^2,0,0,(tabk[20,2])^2), byrow = T,ncol = 2)
smatlist4<- list(ldl1coov, ldl2coov, ldl3coov)
ldl4mvmeta<- mvmeta(betaldl4, smatlist4)
#### Cholesterol esters
betaldl5<- matrix(nrow = 2, ncol = 2, NA)
betaldl5[1,] <- c(tabk[7,1],tabk[8,1])
betaldl5[2,] <- c(tabk[15,1],tabk[16,1])
lddl1cov<- matrix(c((tabk[7,2])^2,0,0,(tabk[8,2])^2), byrow = T,ncol = 2)
lddl2cov<- matrix(c((tabk[15,2])^2,0,0,(tabk[16,2])^2), byrow = T,ncol = 2)
smatlist5<- list(lddl1cov, lddl2cov)
ldl5mvmeta<- mvmeta(betaldl5, smatlist5)
#### collate results
traits_ldlmvmeta <-
rbind(
c(ldlmetan2$k,unname(ldl1mvmeta$coefficients),summary(ldl1mvmeta)$coef[1, 4],summary(ldl1mvmeta)$coef[2, 4]),
c(ldlmetan3$k,unname(ldl3mvmeta$coefficients),summary(ldl3mvmeta)$coef[1, 4],summary(ldl3mvmeta)$coef[2, 4]),
c(ldlmetan4$k,unname(ldl4mvmeta$coefficients),summary(ldl4mvmeta)$coef[1, 4],summary(ldl4mvmeta)$coef[2, 4]),
c(ldlmetan5$k,unname(ldl5mvmeta$coefficients),summary(ldl5mvmeta)$coef[1, 4],summary(ldl5mvmeta)$coef[2, 4])
)
rownames(traits_ldlmvmeta)<- c("Free Cholesterol","Concentration","Phospholipids","Cholesterol esters")
colnames(traits_ldlmvmeta)<- c("N","AVg Pleio", "Slope", "Pval(Pleio)", "Pval(Est)")
```
We also present equivalent meta-analysis estimates for our MR-Egger results, the difference being that we use multivariate meta-analysis since the MR-Egger model returns 2 parameters (slope and intercept). The low number of MR-Egger estimates from the exposure traits related to HDL-related phenotypes meant that we could not report any estimates. The results of the risk factor categories in Table \@ref(tab:ldlmvmeta1) show no strong evidence against the null of no pleiotropy. Cholesterol esters show a greater effect on ischemic stroke within the different LDL traits. Table \@ref(tab:ldlmvmeta2) shows no strong evidence against the null hypothesis of no pleiotropy. The summary point estimates are bigger in magnitude than the IVW estimates in Table \@ref(tab:tabbf). The intermediate sized traits returned a positive estimate suggesting an increased risk of ischemic stroke.
```{r, ldlmvmeta1, include=TRUE, echo=FALSE}
traits_ldlmvmeta <- as.data.frame(traits_ldlmvmeta)
traits_ldlmvmeta %>%
kable("html",escape = F, caption = "Results from Multivariate Meta-analysis of LDL related phenotypes", digits = 4)%>%
kable_styling("striped", full_width = TRUE)
```
```{r}
## intermediate
ibetaldl<- matrix(nrow = 3, ncol = 2, NA)
ibetaldl[1,] <- c(tabk[1,1],tabk[2,1])
ibetaldl[2,] <- c(tabk[3,1],tabk[4,1])
ibetaldl[3,] <- c(tabk[5,1],tabk[6,1])
ildlcov1<- matrix(c((tabk[1,2])^2,0,0,(tabk[1,2])^2), byrow = T,ncol = 2)
ildlcov2<- matrix(c((tabk[3,2])^2,0,0,(tabk[4,2])^2), byrow = T,ncol = 2)
ildlcov3<- matrix(c((tabk[5,2])^2,0,0,(tabk[6,2])^2), byrow = T,ncol = 2)
smmatlist<- list(ildlcov1, ildlcov2, ildlcov3)
ildlmvmeta<- mvmeta(ibetaldl, smmatlist)
### Medium
mbetaldl<- matrix(nrow = 3, ncol = 2, NA)
mbetaldl[1,] <- c(tabk[15,1],tabk[16,1])
mbetaldl[2,] <- c(tabk[17,1],tabk[18,1])
mbetaldl[3,] <- c(tabk[19,1],tabk[20,1])
mldlcov1<- matrix(c((tabk[15,2])^2,0,0,(tabk[16,2])^2), byrow = T,ncol = 2)
mldlcov2<- matrix(c((tabk[17,2])^2,0,0,(tabk[18,2])^2), byrow = T,ncol = 2)
mldlcov3<- matrix(c((tabk[19,2])^2,0,0,(tabk[20,2])^2), byrow = T,ncol = 2)
smmatlist1<- list(mldlcov1,mldlcov2,mldlcov3)
sldlmvmeta1<- mvmeta(mbetaldl, smmatlist1)
### large
lbetaldl<- matrix(nrow = 4, ncol = 2, NA)
lbetaldl[1,] <- c(tabk[7,1],tabk[8,1])
lbetaldl[2,] <- c(tabk[9,1],tabk[10,1])
lbetaldl[3,] <- c(tabk[11,1],tabk[12,1])
lbetaldl[4,] <- c(tabk[13,1],tabk[14,1])
lldlcov1<- matrix(c((tabk[7,2])^2,0,0,(tabk[8,2])^2), byrow = T,ncol = 2)
lldlcov2<- matrix(c((tabk[9,2])^2,0,0,(tabk[10,2])^2), byrow = T,ncol = 2)
lldlcov3<- matrix(c((tabk[11,2])^2,0,0,(tabk[12,2])^2), byrow = T,ncol = 2)
lldlcov4<- matrix(c((tabk[13,2])^2,0,0,(tabk[14,2])^2), byrow = T,ncol = 2)
smmatlist2<- list(lldlcov1,lldlcov2,lldlcov3,lldlcov4)
sldlmvmeta2<- mvmeta(lbetaldl, smmatlist2)
sizes_ldlmvmeta <-
rbind(
c(ldlsize1$k,
unname(ildlmvmeta$coefficients),
summary(ildlmvmeta)$coef[1, 4],
summary(ildlmvmeta)$coef[2, 4]
),
c(ldlsize2$k,
unname(sldlmvmeta1$coefficients),
summary(sldlmvmeta1)$coef[1, 4],
summary(sldlmvmeta1)$coef[2, 4]
),
c(ldlsize3$k,
unname(sldlmvmeta2$coefficients),
summary(sldlmvmeta2)$coef[1, 4],
summary(sldlmvmeta2)$coef[2, 4]
)
)
rownames(sizes_ldlmvmeta)<- c("Intermediate", "Medium", "Large")
colnames(sizes_ldlmvmeta)<- c("N","Avg Pleio", "Estimate", "Pval(Pleio)", "Pval(Est)")
```
```{r, ldlmvmeta2, include=TRUE, echo=FALSE}
sizes_ldlmvmeta <- as.data.frame(sizes_ldlmvmeta)
sizes_ldlmvmeta %>%
kable("html",escape = F, caption = "Multivariate meta-analysis of MR-Egger estimates for LDL sizes", digits = 4)%>%
kable_styling("striped", full_width = TRUE)
```
## Selecting genetic variants using Q-statistics {#section5}
As most of the results presented hitherto have lacked statistical power, we therefore sought to increase the number of SNPs used as instruments, with the hope of increasing power, through the use of Q-statistics. This section presents results using genotypes based on their contribution to the Q-statistic in the IVW models.
### IVW estimates
The estimates from the IVW model are given in Tables \@ref(tab:ldlivwQ) and \@ref(tab:hdlivwQ).
```{r}
ldlQ_ivw <- ivw(ldlsnps_Q[,2],ldlsnps_Q[,4],ldlsnps_Q[,3],ldlsnps_Q[,4])
ldlQ_ivw1 <- ivw(ldlsnps_Q1[,2],ldlsnps_Q1[,4],ldlsnps_Q1[,3],ldlsnps_Q1[,4])
ldlQ_ivw2 <- ivw(ldlsnps_Q2[,2],ldlsnps_Q2[,4],ldlsnps_Q2[,3],ldlsnps_Q2[,4])
ldlQ_ivw3 <- ivw(ldlsnps_Q3[,2],ldlsnps_Q3[,4],ldlsnps_Q3[,3],ldlsnps_Q3[,4])
ldlQ_ivw4 <- ivw(ldlsnps_Q4[,2],ldlsnps_Q4[,4],ldlsnps_Q4[,3],ldlsnps_Q4[,4])
ldlQ_ivw5 <- ivw(ldlsnps_Q5[,2],ldlsnps_Q5[,4],ldlsnps_Q5[,3],ldlsnps_Q5[,4])
ldlQ_ivw6 <- ivw(ldlsnps_Q6[,2],ldlsnps_Q6[,4],ldlsnps_Q6[,3],ldlsnps_Q6[,4])
ldlQ_ivw7 <- ivw(ldlsnps_Q7[,2],ldlsnps_Q7[,4],ldlsnps_Q7[,3],ldlsnps_Q7[,4])
ldlQ_ivw8 <- ivw(ldlsnps_Q8[,2],ldlsnps_Q8[,4],ldlsnps_Q8[,3],ldlsnps_Q8[,4])
ldlQ_ivw9 <- ivw(ldlsnps_Q9[,2],ldlsnps_Q9[,4],ldlsnps_Q9[,3],ldlsnps_Q9[,4])
ldlQ_ivw10 <- ivw(ldlsnps_Q10[,2],ldlsnps_Q10[,4],ldlsnps_Q10[,3],ldlsnps_Q10[,4])
ldlivwQ<- rbind(ldlQ_ivw,ldlQ_ivw1,ldlQ_ivw2,ldlQ_ivw3,ldlQ_ivw4,ldlQ_ivw5,ldlQ_ivw6,ldlQ_ivw7,ldlQ_ivw8,ldlQ_ivw9,ldlQ_ivw10)
ldlivwQ <- cbind (lipid_traits,unname(ldlivwQ))
colnames(ldlivwQ) <- c("Exposures","Estimates", "SE","LI","UI", "Pval","SNPs")
## HDLS
hdlQ_ivw <- ivw(hdlsnps_Q[,2],hdlsnps_Q[,4],hdlsnps_Q[,3],hdlsnps_Q[,4])
hdlQ_ivw1 <- ivw(hdlsnps_Q1[,2],hdlsnps_Q1[,4],hdlsnps_Q1[,3],hdlsnps_Q1[,4])
hdlQ_ivw2 <- ivw(hdlsnps_Q2[,2],hdlsnps_Q2[,4],hdlsnps_Q2[,3],hdlsnps_Q2[,4])
hdlQ_ivw3 <- ivw(hdlsnps_Q3[,2],hdlsnps_Q3[,4],hdlsnps_Q3[,3],hdlsnps_Q3[,4])
hdlQ_ivw4 <- ivw(hdlsnps_Q4[,2],hdlsnps_Q4[,4],hdlsnps_Q4[,3],hdlsnps_Q4[,4])
hdlQ_ivw5 <- ivw(hdlsnps_Q5[,2],hdlsnps_Q5[,4],hdlsnps_Q5[,3],hdlsnps_Q5[,4])
hdlQ_ivw6 <- ivw(hdlsnps_Q6[,2],hdlsnps_Q6[,4],hdlsnps_Q6[,3],hdlsnps_Q6[,4])
hdlQ_ivw7 <- ivw(hdlsnps_Q7[,2],hdlsnps_Q7[,4],hdlsnps_Q7[,3],hdlsnps_Q7[,4])
hdlQ_ivw8 <- ivw(hdlsnps_Q8[,2],hdlsnps_Q8[,4],hdlsnps_Q8[,3],hdlsnps_Q8[,4])
hdlQ_ivw9 <- ivw(hdlsnps_Q9[,2],hdlsnps_Q9[,4],hdlsnps_Q9[,3],hdlsnps_Q9[,4])
hdlQ_ivw10 <- ivw(hdlsnps_Q10[,2],hdlsnps_Q10[,4],hdlsnps_Q10[,3],hdlsnps_Q10[,4])
hdlQ_ivw11 <- ivw(hdlsnps_Q11[,2],hdlsnps_Q11[,4],hdlsnps_Q11[,3],hdlsnps_Q11[,4])
hdlQ_ivw12 <- ivw(hdlsnps_Q12[,2],hdlsnps_Q12[,4],hdlsnps_Q12[,3],hdlsnps_Q12[,4])
hdlQ_ivw13 <- ivw(hdlsnps_Q13[,2],hdlsnps_Q13[,4],hdlsnps_Q13[,3],hdlsnps_Q13[,4])
hdlivwQ<- rbind(hdlQ_ivw,hdlQ_ivw1,hdlQ_ivw2,hdlQ_ivw3,hdlQ_ivw4,hdlQ_ivw5,hdlQ_ivw6,hdlQ_ivw7,hdlQ_ivw8,hdlQ_ivw9,hdlQ_ivw10,hdlQ_ivw11,hdlQ_ivw12,hdlQ_ivw13)
hdlivwQ <- cbind (traits,unname(hdlivwQ))
colnames(hdlivwQ) <- c("Exposures","Estimates", "SE","LI","UI", "Pval","SNPs")
```
MR estimates in Table \@ref(tab:ldlivwQ) show positive point estimates which agree with our expectations, the estimates also show significance (confidence intervals exclude null). However a major limitation here is that the SNPs used in the models are the same or largely overlapping, meaning that the MR estimates are unlikely to be valid. This is because the estimates from the genotype-outcome association are the same in each model with the genotype-exposure association varying for each lipid trait leading to a simple scaling of the genotype-outcome associations for each trait. This makes it impossible to disentangle which trait has a true causal effect and which is confounded by using the same SNPs. This issue has been discussed previously by @holmes-nrg-2017.
```{r ldlivwQ, include=TRUE, echo=FALSE}
ldlivwQ <- as.data.frame(ldlivwQ)
ldlivwQ %>%
mutate(SNPs = ifelse (
as.numeric(as.character((SNPs))) < 3,
cell_spec(SNPs, color = "white", background = "grey"),
cell_spec(SNPs, color = "black", background = "white")
))%>%
mutate(Estimates = ifelse (
as.numeric(as.character(Estimates)) < 0.01,
cell_spec(as.numeric(as.character(Estimates)), color = "white", background = "grey"),
cell_spec(as.numeric(as.character(Estimates)), color = "black", background = "white")
))%>%
kable("html",escape = F, caption = "IVW estimates for exposures related LDLs", digits = 4)%>%
kable_styling("striped", full_width = TRUE)
```
Results from Table \@ref(tab:hdlivwQ) show causal estimates of lipid traits related to HDL with the increased number of SNPs. The point estimates are generally null or negative with small p-values. Triglycerides in small HDL show a positive causal effect on ischemic stroke with statistical significance. We show the MR-Egger model for this estimate below. Precisely the same issue as noted above applies in this setting where SNPs used in the IVs overlap between exposures, meaning the effect estimates from MR are unlikely to be valid.
```{r hdlivwQ, include=TRUE, echo=FALSE}
hdlivwQ <- as.data.frame(hdlivwQ)
hdlivwQ %>%
mutate(SNPs = ifelse (
as.numeric(as.character((SNPs))) < 3,
cell_spec(SNPs, color = "white", background = "grey"),
cell_spec(SNPs, color = "black", background = "white")
))%>%
mutate(Estimates = ifelse (
as.numeric(as.character(Estimates)) > 0.01,
cell_spec(as.numeric(as.character(Estimates)), color = "white", background = "grey"),
cell_spec(as.numeric(as.character(Estimates)), color = "black", background = "white")
))%>%