Investigating SES measures in relation to number of children
library(TwoSampleMR)
## TwoSampleMR version 0.5.6
## [>] New: Option to use non-European LD reference panels for clumping etc
## [>] Some studies temporarily quarantined to verify effect allele
## [>] See news(package='TwoSampleMR') and https://gwas.mrcieu.ac.uk for further details
d <- make_dat("ukb-b-10011", "ieu-b-4760")
## API: public: http://gwas-api.mrcieu.ac.uk/
## Extracting data for 18 SNP(s) from 1 GWAS(s)
## Finding proxies for 1 SNPs in outcome ieu-b-4760
## Extracting data for 1 SNP(s) from 1 GWAS(s)
## Harmonising Townsend deprivation index at recruitment || id:ukb-b-10011 (ukb-b-10011) and Number of children || id:ieu-b-4760 (ieu-b-4760)
d_mr<-mr(d)
## Analysing 'ukb-b-10011' on 'ieu-b-4760'
d_mr
## id.exposure id.outcome outcome
## 1 ukb-b-10011 ieu-b-4760 Number of children || id:ieu-b-4760
## 2 ukb-b-10011 ieu-b-4760 Number of children || id:ieu-b-4760
## 3 ukb-b-10011 ieu-b-4760 Number of children || id:ieu-b-4760
## 4 ukb-b-10011 ieu-b-4760 Number of children || id:ieu-b-4760
## 5 ukb-b-10011 ieu-b-4760 Number of children || id:ieu-b-4760
## exposure
## 1 Townsend deprivation index at recruitment || id:ukb-b-10011
## 2 Townsend deprivation index at recruitment || id:ukb-b-10011
## 3 Townsend deprivation index at recruitment || id:ukb-b-10011
## 4 Townsend deprivation index at recruitment || id:ukb-b-10011
## 5 Townsend deprivation index at recruitment || id:ukb-b-10011
## method nsnp b se pval
## 1 MR Egger 18 -0.47015708 0.51648412 0.3761728
## 2 Weighted median 18 -0.10140219 0.06727362 0.1317313
## 3 Inverse variance weighted 18 -0.16595717 0.08377664 0.0475971
## 4 Simple mode 18 -0.09937058 0.12895717 0.4515386
## 5 Weighted mode 18 -0.06425356 0.11637765 0.5880570
mr_scatter_plot(d_mr,d)
## $`ukb-b-10011.ieu-b-4760`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ukb-b-10011 ieu-b-4760
d <- make_dat("ieu-b-4760", "ukb-b-10011")
## Extracting data for 9 SNP(s) from 1 GWAS(s)
## Finding proxies for 1 SNPs in outcome ukb-b-10011
## Extracting data for 1 SNP(s) from 1 GWAS(s)
## Harmonising Number of children || id:ieu-b-4760 (ieu-b-4760) and Townsend deprivation index at recruitment || id:ukb-b-10011 (ukb-b-10011)
d_mr<-mr(d)
## Analysing 'ieu-b-4760' on 'ukb-b-10011'
d_mr
## id.exposure id.outcome
## 1 ieu-b-4760 ukb-b-10011
## 2 ieu-b-4760 ukb-b-10011
## 3 ieu-b-4760 ukb-b-10011
## 4 ieu-b-4760 ukb-b-10011
## 5 ieu-b-4760 ukb-b-10011
## outcome
## 1 Townsend deprivation index at recruitment || id:ukb-b-10011
## 2 Townsend deprivation index at recruitment || id:ukb-b-10011
## 3 Townsend deprivation index at recruitment || id:ukb-b-10011
## 4 Townsend deprivation index at recruitment || id:ukb-b-10011
## 5 Townsend deprivation index at recruitment || id:ukb-b-10011
## exposure method nsnp
## 1 Number of children || id:ieu-b-4760 MR Egger 8
## 2 Number of children || id:ieu-b-4760 Weighted median 8
## 3 Number of children || id:ieu-b-4760 Inverse variance weighted 8
## 4 Number of children || id:ieu-b-4760 Simple mode 8
## 5 Number of children || id:ieu-b-4760 Weighted mode 8
## b se pval
## 1 -0.22816207 0.70658678 0.7577219
## 2 0.06505810 0.07964592 0.4140189
## 3 -0.03419200 0.11424075 0.7647128
## 4 0.08764542 0.10825542 0.4448054
## 5 0.13941722 0.08905672 0.1614489
mr_scatter_plot(d_mr,d)
## $`ieu-b-4760.ukb-b-10011`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ieu-b-4760 ukb-b-10011
No causal relationship, did not appear in list of traits from rms2.
d <- make_dat("ukb-b-7408", "ieu-b-4760")
## Extracting data for 48 SNP(s) from 1 GWAS(s)
## Finding proxies for 1 SNPs in outcome ieu-b-4760
## Extracting data for 1 SNP(s) from 1 GWAS(s)
## Harmonising Average total household income before tax || id:ukb-b-7408 (ukb-b-7408) and Number of children || id:ieu-b-4760 (ieu-b-4760)
## Removing the following SNPs for incompatible alleles:
## rs1239705
d_mr<-mr(d)
## Analysing 'ukb-b-7408' on 'ieu-b-4760'
d_mr
## id.exposure id.outcome outcome
## 1 ukb-b-7408 ieu-b-4760 Number of children || id:ieu-b-4760
## 2 ukb-b-7408 ieu-b-4760 Number of children || id:ieu-b-4760
## 3 ukb-b-7408 ieu-b-4760 Number of children || id:ieu-b-4760
## 4 ukb-b-7408 ieu-b-4760 Number of children || id:ieu-b-4760
## 5 ukb-b-7408 ieu-b-4760 Number of children || id:ieu-b-4760
## exposure
## 1 Average total household income before tax || id:ukb-b-7408
## 2 Average total household income before tax || id:ukb-b-7408
## 3 Average total household income before tax || id:ukb-b-7408
## 4 Average total household income before tax || id:ukb-b-7408
## 5 Average total household income before tax || id:ukb-b-7408
## method nsnp b se pval
## 1 MR Egger 47 -0.17569545 0.12746944 0.1749149190
## 2 Weighted median 47 -0.10871489 0.02949439 0.0002278502
## 3 Inverse variance weighted 47 -0.08746043 0.02978605 0.0033216490
## 4 Simple mode 47 -0.12181312 0.06535924 0.0687473595
## 5 Weighted mode 47 -0.12181312 0.06575089 0.0703552908
mr_scatter_plot(d_mr,d)
## $`ukb-b-7408.ieu-b-4760`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ukb-b-7408 ieu-b-4760
d <- make_dat("ieu-b-4760", "ukb-b-7408")
## Extracting data for 9 SNP(s) from 1 GWAS(s)
## Finding proxies for 1 SNPs in outcome ukb-b-7408
## Extracting data for 1 SNP(s) from 1 GWAS(s)
## Harmonising Number of children || id:ieu-b-4760 (ieu-b-4760) and Average total household income before tax || id:ukb-b-7408 (ukb-b-7408)
d_mr<-mr(d)
## Analysing 'ieu-b-4760' on 'ukb-b-7408'
d_mr
## id.exposure id.outcome
## 1 ieu-b-4760 ukb-b-7408
## 2 ieu-b-4760 ukb-b-7408
## 3 ieu-b-4760 ukb-b-7408
## 4 ieu-b-4760 ukb-b-7408
## 5 ieu-b-4760 ukb-b-7408
## outcome
## 1 Average total household income before tax || id:ukb-b-7408
## 2 Average total household income before tax || id:ukb-b-7408
## 3 Average total household income before tax || id:ukb-b-7408
## 4 Average total household income before tax || id:ukb-b-7408
## 5 Average total household income before tax || id:ukb-b-7408
## exposure method nsnp b
## 1 Number of children || id:ieu-b-4760 MR Egger 8 1.2084329
## 2 Number of children || id:ieu-b-4760 Weighted median 8 0.1004838
## 3 Number of children || id:ieu-b-4760 Inverse variance weighted 8 -0.1191323
## 4 Number of children || id:ieu-b-4760 Simple mode 8 0.2257828
## 5 Number of children || id:ieu-b-4760 Weighted mode 8 0.1471450
## se pval
## 1 1.4060724 0.4231016
## 2 0.1069583 0.3474911
## 3 0.2425635 0.6233283
## 4 0.1497424 0.1753366
## 5 0.1134027 0.2355654
mr_scatter_plot(d_mr,d)
## $`ieu-b-4760.ukb-b-7408`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ieu-b-4760 ukb-b-7408
Appears to be a causal relationship.
d <- make_dat("ieu-a-1239", "ieu-b-4760")
## Extracting data for 317 SNP(s) from 1 GWAS(s)
## Finding proxies for 25 SNPs in outcome ieu-b-4760
## Extracting data for 25 SNP(s) from 1 GWAS(s)
## Harmonising Years of schooling || id:ieu-a-1239 (ieu-a-1239) and Number of children || id:ieu-b-4760 (ieu-b-4760)
d_mr<-mr(d)
## Analysing 'ieu-a-1239' on 'ieu-b-4760'
d_mr
## id.exposure id.outcome outcome
## 1 ieu-a-1239 ieu-b-4760 Number of children || id:ieu-b-4760
## 2 ieu-a-1239 ieu-b-4760 Number of children || id:ieu-b-4760
## 3 ieu-a-1239 ieu-b-4760 Number of children || id:ieu-b-4760
## 4 ieu-a-1239 ieu-b-4760 Number of children || id:ieu-b-4760
## 5 ieu-a-1239 ieu-b-4760 Number of children || id:ieu-b-4760
## exposure method nsnp b
## 1 Years of schooling || id:ieu-a-1239 MR Egger 311 -0.1756561
## 2 Years of schooling || id:ieu-a-1239 Weighted median 311 -0.1500897
## 3 Years of schooling || id:ieu-a-1239 Inverse variance weighted 311 -0.1489214
## 4 Years of schooling || id:ieu-a-1239 Simple mode 311 -0.1443155
## 5 Years of schooling || id:ieu-a-1239 Weighted mode 311 -0.1564250
## se pval
## 1 0.05427552 1.341942e-03
## 2 0.01532150 1.171076e-22
## 3 0.01362444 8.243104e-28
## 4 0.05632660 1.087595e-02
## 5 0.04938432 1.690706e-03
mr_scatter_plot(d_mr,d)
## $`ieu-a-1239.ieu-b-4760`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ieu-a-1239 ieu-b-4760
d <- make_dat("ieu-b-4760", "ieu-a-1239")
## Extracting data for 9 SNP(s) from 1 GWAS(s)
## Finding proxies for 2 SNPs in outcome ieu-a-1239
## Extracting data for 2 SNP(s) from 1 GWAS(s)
## Harmonising Number of children || id:ieu-b-4760 (ieu-b-4760) and Years of schooling || id:ieu-a-1239 (ieu-a-1239)
d_mr<-mr(d)
## Analysing 'ieu-b-4760' on 'ieu-a-1239'
d_mr
## id.exposure id.outcome outcome
## 1 ieu-b-4760 ieu-a-1239 Years of schooling || id:ieu-a-1239
## 2 ieu-b-4760 ieu-a-1239 Years of schooling || id:ieu-a-1239
## 3 ieu-b-4760 ieu-a-1239 Years of schooling || id:ieu-a-1239
## 4 ieu-b-4760 ieu-a-1239 Years of schooling || id:ieu-a-1239
## 5 ieu-b-4760 ieu-a-1239 Years of schooling || id:ieu-a-1239
## exposure method nsnp b
## 1 Number of children || id:ieu-b-4760 MR Egger 7 0.4326492
## 2 Number of children || id:ieu-b-4760 Weighted median 7 -0.3629820
## 3 Number of children || id:ieu-b-4760 Inverse variance weighted 7 -0.4291652
## 4 Number of children || id:ieu-b-4760 Simple mode 7 -0.2937079
## 5 Number of children || id:ieu-b-4760 Weighted mode 7 -0.3275255
## se pval
## 1 1.16111218 7.247070e-01
## 2 0.07839486 3.653546e-06
## 3 0.20196820 3.359371e-02
## 4 0.08855317 1.606937e-02
## 5 0.07280524 4.109825e-03
mr_scatter_plot(d_mr,d)
## $`ieu-b-4760.ieu-a-1239`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ieu-b-4760 ieu-a-1239
Appears to be a causal realtionship.
d <- mv_extract_exposures(c("ieu-a-1239", "ukb-b-7408"))
## Please look at vignettes for options on running this locally if you need to run many instances of this command.
## Clumping 1, 362 variants, using EUR population reference
## Removing 50 of 362 variants due to LD with other variants or absence from LD reference panel
## Extracting data for 312 SNP(s) from 2 GWAS(s)
## Harmonising Years of schooling || id:ieu-a-1239 (ieu-a-1239) and Average total household income before tax || id:ukb-b-7408 (ukb-b-7408)
## Removing the following SNPs for incompatible alleles:
## rs510706
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs12134151, rs13130765, rs1455350, rs2414072, rs2478208, rs2545798, rs320693, rs401687, rs60483752, rs6867851, rs7920624
o <- extract_outcome_data(d$SNP, "ieu-b-4760")
## Extracting data for 311 SNP(s) from 1 GWAS(s)
## Finding proxies for 25 SNPs in outcome ieu-b-4760
## Extracting data for 25 SNP(s) from 1 GWAS(s)
d <- mv_harmonise_data(d, o)
## Harmonising Years of schooling || id:ieu-a-1239 (ieu-a-1239) and Number of children || id:ieu-b-4760 (ieu-b-4760)
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs12134151, rs1455350, rs2414072, rs2478208, rs2545798, rs320693, rs401687, rs6867851, rs7920624
mv_multiple(d)
## $result
## id.exposure exposure
## 1 ieu-a-1239 Years of schooling || id:ieu-a-1239
## 2 ukb-b-7408 Average total household income before tax || id:ukb-b-7408
## id.outcome outcome nsnp b se
## 1 ieu-b-4760 Number of children || id:ieu-b-4760 293 -0.19745314 0.03097457
## 2 ieu-b-4760 Number of children || id:ieu-b-4760 22 0.07974917 0.04173389
## pval
## 1 1.833379e-10
## 2 5.601781e-02
Income attenuates. Income effect on number of children is mostly explained by years of schooling.
d <- make_dat("ukb-a-505", "ieu-b-4760")
## Extracting data for 22 SNP(s) from 1 GWAS(s)
## Finding proxies for 2 SNPs in outcome ieu-b-4760
## Extracting data for 2 SNP(s) from 1 GWAS(s)
## Harmonising Age completed full time education || id:ukb-a-505 (ukb-a-505) and Number of children || id:ieu-b-4760 (ieu-b-4760)
d_mr<-mr(d)
## Analysing 'ukb-a-505' on 'ieu-b-4760'
d_mr
## id.exposure id.outcome outcome
## 1 ukb-a-505 ieu-b-4760 Number of children || id:ieu-b-4760
## 2 ukb-a-505 ieu-b-4760 Number of children || id:ieu-b-4760
## 3 ukb-a-505 ieu-b-4760 Number of children || id:ieu-b-4760
## 4 ukb-a-505 ieu-b-4760 Number of children || id:ieu-b-4760
## 5 ukb-a-505 ieu-b-4760 Number of children || id:ieu-b-4760
## exposure method
## 1 Age completed full time education || id:ukb-a-505 MR Egger
## 2 Age completed full time education || id:ukb-a-505 Weighted median
## 3 Age completed full time education || id:ukb-a-505 Inverse variance weighted
## 4 Age completed full time education || id:ukb-a-505 Simple mode
## 5 Age completed full time education || id:ukb-a-505 Weighted mode
## nsnp b se pval
## 1 21 -0.1631685 0.22045816 0.468266844
## 2 21 -0.1004756 0.04675008 0.031617898
## 3 21 -0.1351041 0.05164271 0.008893241
## 4 21 -0.1167472 0.10072883 0.260097695
## 5 21 -0.1195580 0.08248333 0.162703870
mr_scatter_plot(d_mr,d)
## $`ukb-a-505.ieu-b-4760`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ukb-a-505 ieu-b-4760
d <- make_dat("ieu-b-4760", "ukb-a-505")
## Extracting data for 9 SNP(s) from 1 GWAS(s)
## Finding proxies for 1 SNPs in outcome ukb-a-505
## Extracting data for 1 SNP(s) from 1 GWAS(s)
## Harmonising Number of children || id:ieu-b-4760 (ieu-b-4760) and Age completed full time education || id:ukb-a-505 (ukb-a-505)
d_mr<-mr(d)
## Analysing 'ieu-b-4760' on 'ukb-a-505'
d_mr
## id.exposure id.outcome outcome
## 1 ieu-b-4760 ukb-a-505 Age completed full time education || id:ukb-a-505
## 2 ieu-b-4760 ukb-a-505 Age completed full time education || id:ukb-a-505
## 3 ieu-b-4760 ukb-a-505 Age completed full time education || id:ukb-a-505
## 4 ieu-b-4760 ukb-a-505 Age completed full time education || id:ukb-a-505
## 5 ieu-b-4760 ukb-a-505 Age completed full time education || id:ukb-a-505
## exposure method nsnp b
## 1 Number of children || id:ieu-b-4760 MR Egger 8 0.3611244
## 2 Number of children || id:ieu-b-4760 Weighted median 8 -0.2513712
## 3 Number of children || id:ieu-b-4760 Inverse variance weighted 8 -0.3220059
## 4 Number of children || id:ieu-b-4760 Simple mode 8 -0.1845275
## 5 Number of children || id:ieu-b-4760 Weighted mode 8 -0.1806188
## se pval
## 1 0.6726738 0.610684801
## 2 0.0860693 0.003493940
## 3 0.1170849 0.005956023
## 4 0.1143241 0.150545916
## 5 0.1016990 0.118986135
mr_scatter_plot(d_mr,d)
## $`ieu-b-4760.ukb-a-505`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ieu-b-4760 ukb-a-505
d <- make_dat("ukb-b-17729", "ieu-b-4760")
## Extracting data for 93 SNP(s) from 1 GWAS(s)
## Finding proxies for 4 SNPs in outcome ieu-b-4760
## Extracting data for 4 SNP(s) from 1 GWAS(s)
## Harmonising Qualifications: None of the above || id:ukb-b-17729 (ukb-b-17729) and Number of children || id:ieu-b-4760 (ieu-b-4760)
d_mr<-mr(d)
## Analysing 'ukb-b-17729' on 'ieu-b-4760'
d_mr
## id.exposure id.outcome outcome
## 1 ukb-b-17729 ieu-b-4760 Number of children || id:ieu-b-4760
## 2 ukb-b-17729 ieu-b-4760 Number of children || id:ieu-b-4760
## 3 ukb-b-17729 ieu-b-4760 Number of children || id:ieu-b-4760
## 4 ukb-b-17729 ieu-b-4760 Number of children || id:ieu-b-4760
## 5 ukb-b-17729 ieu-b-4760 Number of children || id:ieu-b-4760
## exposure method
## 1 Qualifications: None of the above || id:ukb-b-17729 MR Egger
## 2 Qualifications: None of the above || id:ukb-b-17729 Weighted median
## 3 Qualifications: None of the above || id:ukb-b-17729 Inverse variance weighted
## 4 Qualifications: None of the above || id:ukb-b-17729 Simple mode
## 5 Qualifications: None of the above || id:ukb-b-17729 Weighted mode
## nsnp b se pval
## 1 92 0.9676011 0.31608040 2.905618e-03
## 2 92 0.4874886 0.06800260 7.572665e-13
## 3 92 0.4470218 0.06353423 1.979503e-12
## 4 92 0.5567593 0.19011623 4.303137e-03
## 5 92 0.5654027 0.17489734 1.708228e-03
mr_scatter_plot(d_mr,d)
## $`ukb-b-17729.ieu-b-4760`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ukb-b-17729 ieu-b-4760
d <- make_dat("ieu-b-4760", "ukb-b-17729")
## Extracting data for 9 SNP(s) from 1 GWAS(s)
## Finding proxies for 1 SNPs in outcome ukb-b-17729
## Extracting data for 1 SNP(s) from 1 GWAS(s)
## Harmonising Number of children || id:ieu-b-4760 (ieu-b-4760) and Qualifications: None of the above || id:ukb-b-17729 (ukb-b-17729)
d_mr<-mr(d)
## Analysing 'ieu-b-4760' on 'ukb-b-17729'
d_mr
## id.exposure id.outcome outcome
## 1 ieu-b-4760 ukb-b-17729 Qualifications: None of the above || id:ukb-b-17729
## 2 ieu-b-4760 ukb-b-17729 Qualifications: None of the above || id:ukb-b-17729
## 3 ieu-b-4760 ukb-b-17729 Qualifications: None of the above || id:ukb-b-17729
## 4 ieu-b-4760 ukb-b-17729 Qualifications: None of the above || id:ukb-b-17729
## 5 ieu-b-4760 ukb-b-17729 Qualifications: None of the above || id:ukb-b-17729
## exposure method nsnp
## 1 Number of children || id:ieu-b-4760 MR Egger 8
## 2 Number of children || id:ieu-b-4760 Weighted median 8
## 3 Number of children || id:ieu-b-4760 Inverse variance weighted 8
## 4 Number of children || id:ieu-b-4760 Simple mode 8
## 5 Number of children || id:ieu-b-4760 Weighted mode 8
## b se pval
## 1 -0.14305194 0.24882321 0.586244895
## 2 0.08767716 0.02890189 0.002416434
## 3 0.11657486 0.04354971 0.007432395
## 4 0.08339078 0.04122808 0.082803550
## 5 0.08339078 0.03425882 0.045145420
mr_scatter_plot(d_mr,d)
## $`ieu-b-4760.ukb-b-17729`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ieu-b-4760 ukb-b-17729
d <- make_dat("ukb-b-11615", "ieu-b-4760")
## Extracting data for 88 SNP(s) from 1 GWAS(s)
## Finding proxies for 9 SNPs in outcome ieu-b-4760
## Extracting data for 9 SNP(s) from 1 GWAS(s)
## Harmonising Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615 (ukb-b-11615) and Number of children || id:ieu-b-4760 (ieu-b-4760)
d_mr<-mr(d)
## Analysing 'ukb-b-11615' on 'ieu-b-4760'
d_mr
## id.exposure id.outcome outcome
## 1 ukb-b-11615 ieu-b-4760 Number of children || id:ieu-b-4760
## 2 ukb-b-11615 ieu-b-4760 Number of children || id:ieu-b-4760
## 3 ukb-b-11615 ieu-b-4760 Number of children || id:ieu-b-4760
## 4 ukb-b-11615 ieu-b-4760 Number of children || id:ieu-b-4760
## 5 ukb-b-11615 ieu-b-4760 Number of children || id:ieu-b-4760
## exposure
## 1 Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615
## 2 Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615
## 3 Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615
## 4 Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615
## 5 Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615
## method nsnp b se pval
## 1 MR Egger 84 -0.6877797 0.29511991 2.223663e-02
## 2 Weighted median 84 -0.3766102 0.06124724 7.796541e-10
## 3 Inverse variance weighted 84 -0.4435550 0.05358249 1.252776e-16
## 4 Simple mode 84 -0.3032140 0.18676763 1.082785e-01
## 5 Weighted mode 84 -0.3175902 0.18166858 8.412977e-02
mr_scatter_plot(d_mr,d)
## $`ukb-b-11615.ieu-b-4760`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ukb-b-11615 ieu-b-4760
d <- make_dat("ieu-b-4760", "ukb-b-11615")
## Extracting data for 9 SNP(s) from 1 GWAS(s)
## Finding proxies for 1 SNPs in outcome ukb-b-11615
## Extracting data for 1 SNP(s) from 1 GWAS(s)
## Harmonising Number of children || id:ieu-b-4760 (ieu-b-4760) and Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615 (ukb-b-11615)
d_mr<-mr(d)
## Analysing 'ieu-b-4760' on 'ukb-b-11615'
d_mr
## id.exposure id.outcome
## 1 ieu-b-4760 ukb-b-11615
## 2 ieu-b-4760 ukb-b-11615
## 3 ieu-b-4760 ukb-b-11615
## 4 ieu-b-4760 ukb-b-11615
## 5 ieu-b-4760 ukb-b-11615
## outcome
## 1 Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615
## 2 Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615
## 3 Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615
## 4 Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615
## 5 Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615
## exposure method nsnp b
## 1 Number of children || id:ieu-b-4760 MR Egger 8 0.1253038
## 2 Number of children || id:ieu-b-4760 Weighted median 8 -0.1503129
## 3 Number of children || id:ieu-b-4760 Inverse variance weighted 8 -0.1946285
## 4 Number of children || id:ieu-b-4760 Simple mode 8 -0.1437685
## 5 Number of children || id:ieu-b-4760 Weighted mode 8 -0.1437685
## se pval
## 1 0.38520413 7.560041e-01
## 2 0.03550376 2.298586e-05
## 3 0.06544024 2.938101e-03
## 4 0.04580494 1.640871e-02
## 5 0.03883413 7.633675e-03
mr_scatter_plot(d_mr,d)
## $`ieu-b-4760.ukb-b-11615`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ieu-b-4760 ukb-b-11615
d <- make_dat("ukb-b-16489", "ieu-b-4760")
## Extracting data for 261 SNP(s) from 1 GWAS(s)
## Finding proxies for 20 SNPs in outcome ieu-b-4760
## Extracting data for 20 SNP(s) from 1 GWAS(s)
## Harmonising Qualifications: College or University degree || id:ukb-b-16489 (ukb-b-16489) and Number of children || id:ieu-b-4760 (ieu-b-4760)
d_mr<-mr(d)
## Analysing 'ukb-b-16489' on 'ieu-b-4760'
d_mr
## id.exposure id.outcome outcome
## 1 ukb-b-16489 ieu-b-4760 Number of children || id:ieu-b-4760
## 2 ukb-b-16489 ieu-b-4760 Number of children || id:ieu-b-4760
## 3 ukb-b-16489 ieu-b-4760 Number of children || id:ieu-b-4760
## 4 ukb-b-16489 ieu-b-4760 Number of children || id:ieu-b-4760
## 5 ukb-b-16489 ieu-b-4760 Number of children || id:ieu-b-4760
## exposure
## 1 Qualifications: College or University degree || id:ukb-b-16489
## 2 Qualifications: College or University degree || id:ukb-b-16489
## 3 Qualifications: College or University degree || id:ukb-b-16489
## 4 Qualifications: College or University degree || id:ukb-b-16489
## 5 Qualifications: College or University degree || id:ukb-b-16489
## method nsnp b se pval
## 1 MR Egger 253 -0.5308634 0.11535070 6.642763e-06
## 2 Weighted median 253 -0.3241435 0.03185387 2.539029e-24
## 3 Inverse variance weighted 253 -0.3153327 0.02862108 3.146772e-28
## 4 Simple mode 253 -0.4192495 0.10978258 1.688261e-04
## 5 Weighted mode 253 -0.4192495 0.08982055 4.954289e-06
mr_scatter_plot(d_mr,d)
## $`ukb-b-16489.ieu-b-4760`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ukb-b-16489 ieu-b-4760
d <- make_dat("ieu-b-4760", "ukb-b-16489")
## Extracting data for 9 SNP(s) from 1 GWAS(s)
## Finding proxies for 1 SNPs in outcome ukb-b-16489
## Extracting data for 1 SNP(s) from 1 GWAS(s)
## Harmonising Number of children || id:ieu-b-4760 (ieu-b-4760) and Qualifications: College or University degree || id:ukb-b-16489 (ukb-b-16489)
d_mr<-mr(d)
## Analysing 'ieu-b-4760' on 'ukb-b-16489'
d_mr
## id.exposure id.outcome
## 1 ieu-b-4760 ukb-b-16489
## 2 ieu-b-4760 ukb-b-16489
## 3 ieu-b-4760 ukb-b-16489
## 4 ieu-b-4760 ukb-b-16489
## 5 ieu-b-4760 ukb-b-16489
## outcome
## 1 Qualifications: College or University degree || id:ukb-b-16489
## 2 Qualifications: College or University degree || id:ukb-b-16489
## 3 Qualifications: College or University degree || id:ukb-b-16489
## 4 Qualifications: College or University degree || id:ukb-b-16489
## 5 Qualifications: College or University degree || id:ukb-b-16489
## exposure method nsnp b
## 1 Number of children || id:ieu-b-4760 MR Egger 8 0.1698541
## 2 Number of children || id:ieu-b-4760 Weighted median 8 -0.2556054
## 3 Number of children || id:ieu-b-4760 Inverse variance weighted 8 -0.3331147
## 4 Number of children || id:ieu-b-4760 Simple mode 8 -0.2413967
## 5 Number of children || id:ieu-b-4760 Weighted mode 8 -0.2485288
## se pval
## 1 0.58538487 7.814625e-01
## 2 0.04408985 6.736083e-09
## 3 0.09983360 8.477961e-04
## 4 0.05416148 2.946745e-03
## 5 0.04420815 7.975836e-04
mr_scatter_plot(d_mr,d)
## $`ieu-b-4760.ukb-b-16489`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ieu-b-4760 ukb-b-16489
Can these all be explained using years of schooling?
d <- mv_extract_exposures(c("ieu-a-1239", "ukb-b-17729"))
## Please look at vignettes for options on running this locally if you need to run many instances of this command.
## Clumping 1, 397 variants, using EUR population reference
## Removing 84 of 397 variants due to LD with other variants or absence from LD reference panel
## Extracting data for 313 SNP(s) from 2 GWAS(s)
## Harmonising Years of schooling || id:ieu-a-1239 (ieu-a-1239) and Qualifications: None of the above || id:ukb-b-17729 (ukb-b-17729)
## Removing the following SNPs for incompatible alleles:
## rs510706
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs12134151, rs13130765, rs1455350, rs2414072, rs2478208, rs2545798, rs320693, rs401687, rs60483752, rs6867851, rs7920624
o <- extract_outcome_data(d$SNP, "ieu-b-4760")
## Extracting data for 312 SNP(s) from 1 GWAS(s)
## Finding proxies for 24 SNPs in outcome ieu-b-4760
## Extracting data for 24 SNP(s) from 1 GWAS(s)
d <- mv_harmonise_data(d, o)
## Harmonising Years of schooling || id:ieu-a-1239 (ieu-a-1239) and Number of children || id:ieu-b-4760 (ieu-b-4760)
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs12134151, rs1455350, rs2414072, rs2478208, rs2545798, rs320693, rs401687, rs6867851, rs7920624
mv_multiple(d)
## $result
## id.exposure exposure id.outcome
## 1 ieu-a-1239 Years of schooling || id:ieu-a-1239 ieu-b-4760
## 2 ukb-b-17729 Qualifications: None of the above || id:ukb-b-17729 ieu-b-4760
## outcome nsnp b se pval
## 1 Number of children || id:ieu-b-4760 293 -0.11861679 0.06151064 0.05380604
## 2 Number of children || id:ieu-b-4760 58 0.08596243 0.20139872 0.66950528
d <- mv_extract_exposures(c("ieu-a-1239", "ukb-b-11615"))
## Please look at vignettes for options on running this locally if you need to run many instances of this command.
## Clumping 1, 399 variants, using EUR population reference
## Removing 83 of 399 variants due to LD with other variants or absence from LD reference panel
## Extracting data for 316 SNP(s) from 2 GWAS(s)
## Harmonising Years of schooling || id:ieu-a-1239 (ieu-a-1239) and Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615 (ukb-b-11615)
## Removing the following SNPs for incompatible alleles:
## rs510706
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs12134151, rs13130765, rs1455350, rs2414072, rs2478208, rs2545798, rs320693, rs401687, rs60483752, rs6867851, rs7920624
o <- extract_outcome_data(d$SNP, "ieu-b-4760")
## Extracting data for 315 SNP(s) from 1 GWAS(s)
## Finding proxies for 27 SNPs in outcome ieu-b-4760
## Extracting data for 27 SNP(s) from 1 GWAS(s)
d <- mv_harmonise_data(d, o)
## Harmonising Years of schooling || id:ieu-a-1239 (ieu-a-1239) and Number of children || id:ieu-b-4760 (ieu-b-4760)
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs12134151, rs1455350, rs2414072, rs2478208, rs2545798, rs320693, rs401687, rs6867851, rs7920624
mv_multiple(d)
## $result
## id.exposure
## 1 ieu-a-1239
## 2 ukb-b-11615
## exposure id.outcome
## 1 Years of schooling || id:ieu-a-1239 ieu-b-4760
## 2 Qualifications: A levels/AS levels or equivalent || id:ukb-b-11615 ieu-b-4760
## outcome nsnp b se pval
## 1 Number of children || id:ieu-b-4760 289 -0.1042109 0.04021972 0.009568651
## 2 Number of children || id:ieu-b-4760 43 -0.1385131 0.12672708 0.274392474
d <- mv_extract_exposures(c("ieu-a-1239", "ukb-b-16489"))
## Please look at vignettes for options on running this locally if you need to run many instances of this command.
## Clumping 1, 543 variants, using EUR population reference
## Removing 203 of 543 variants due to LD with other variants or absence from LD reference panel
## Extracting data for 340 SNP(s) from 2 GWAS(s)
## Finding proxies for 1 SNPs in outcome ieu-a-1239
## Extracting data for 1 SNP(s) from 1 GWAS(s)
## Harmonising Years of schooling || id:ieu-a-1239 (ieu-a-1239) and Qualifications: College or University degree || id:ukb-b-16489 (ukb-b-16489)
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs10934957, rs1455350, rs1913145, rs2414072, rs2478208, rs2545798, rs320693, rs3751661, rs4887925, rs6867851, rs7047015, rs7624274, rs7920624
o <- extract_outcome_data(d$SNP, "ieu-b-4760")
## Extracting data for 339 SNP(s) from 1 GWAS(s)
## Finding proxies for 21 SNPs in outcome ieu-b-4760
## Extracting data for 21 SNP(s) from 1 GWAS(s)
d <- mv_harmonise_data(d, o)
## Harmonising Years of schooling || id:ieu-a-1239 (ieu-a-1239) and Number of children || id:ieu-b-4760 (ieu-b-4760)
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs10934957, rs1455350, rs1913145, rs2414072, rs2478208, rs2545798, rs320693, rs3751661, rs4887925, rs6867851, rs7047015, rs7624274, rs7920624
mv_multiple(d)
## $result
## id.exposure exposure
## 1 ieu-a-1239 Years of schooling || id:ieu-a-1239
## 2 ukb-b-16489 Qualifications: College or University degree || id:ukb-b-16489
## id.outcome outcome nsnp b se
## 1 ieu-b-4760 Number of children || id:ieu-b-4760 261 0.006010299 0.05388685
## 2 ieu-b-4760 Number of children || id:ieu-b-4760 193 -0.319149893 0.10665797
## pval
## 1 0.911191680
## 2 0.002769075
Qualification effect is explained by years of schooling for no qualifications or A level. However, having a degree is more important.
d <- mv_extract_exposures(c("ukb-b-16489", "ukb-b-7408"))
## Please look at vignettes for options on running this locally if you need to run many instances of this command.
## Clumping 1, 309 variants, using EUR population reference
## Removing 57 of 309 variants due to LD with other variants or absence from LD reference panel
## Extracting data for 252 SNP(s) from 2 GWAS(s)
## Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Qualifications: College or University degree || id:ukb-b-16489. Just keeping the first instance:
## rs2606913
## Harmonising Qualifications: College or University degree || id:ukb-b-16489 (ukb-b-16489) and Average total household income before tax || id:ukb-b-7408 (ukb-b-7408)
## Removing the following SNPs for incompatible alleles:
## rs2606913
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs10931821, rs10934957, rs12534506, rs13425585, rs1913145, rs2478208, rs3751661, rs62477728, rs7047015, rs7624274, rs7920624
o <- extract_outcome_data(d$SNP, "ieu-b-4760")
## Extracting data for 251 SNP(s) from 1 GWAS(s)
## Finding proxies for 18 SNPs in outcome ieu-b-4760
## Extracting data for 18 SNP(s) from 1 GWAS(s)
d <- mv_harmonise_data(d, o)
## Harmonising Qualifications: College or University degree || id:ukb-b-16489 (ukb-b-16489) and Number of children || id:ieu-b-4760 (ieu-b-4760)
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs10931821, rs10934957, rs12534506, rs13425585, rs1913145, rs2478208, rs3751661, rs62477728, rs7047015, rs7624274, rs7920624
mv_multiple(d)
## $result
## id.exposure exposure
## 1 ukb-b-16489 Qualifications: College or University degree || id:ukb-b-16489
## 2 ukb-b-7408 Average total household income before tax || id:ukb-b-7408
## id.outcome outcome nsnp b se
## 1 ieu-b-4760 Number of children || id:ieu-b-4760 225 -0.44202386 0.06840490
## 2 ieu-b-4760 Number of children || id:ieu-b-4760 28 0.09202972 0.04549224
## pval
## 1 1.03414e-10
## 2 4.30756e-02
Income effect is explained by having a degree level qualification.
Overall, having a degree explains the difference in number of children for this section.