Last updated: 2024-06-09

Checks: 6 1

Knit directory: madi-brussels-pertussis-thailand/

This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20231106) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 59a1721. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .RData
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/

Untracked files:
    Untracked:  analysis/cluster_pca_single4_old.Rmd
    Untracked:  withelisa.csv
    Untracked:  withelist1.csv

Unstaged changes:
    Modified:   analysis/antigenPCA_single.Rmd
    Modified:   analysis/apwp_pca_single.Rmd
    Modified:   analysis/cluster_pca_single4.Rmd
    Modified:   analysis/cluster_single.Rmd
    Modified:   analysis/doublepca1.Rmd
    Modified:   analysis/mediation_individual.Rmd
    Modified:   analysis/mediation_multiple.Rmd

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/mediation_multiple.Rmd) and HTML (docs/mediation_multiple.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 532d320 Jie Zhou 2024-02-21 madi meeting
html 532d320 Jie Zhou 2024-02-21 madi meeting


Attaching package: 'glue'
The following object is masked from 'package:gdata':

    trim
here() starts at C:/Users/Jie Zhou/Desktop/madi-brussels-pertussis-thailand

0.1 Model description

0.1.1 Definition

Let \(a\) be the treatment whit \(a=0\) for no maternal vaccination and \(a=1\) for maternal vaccination. \(M\) represents mediator,i.e, maternal antibodies, and \(Y\) the outcome, i.e., infant antibodies.

Causal direct effects of maternal vaccination on infant antibodies are defined as \[\tau_i=Y_i(1,M_i(a))-Y_i(0,M_i(a));\] while causal mediation effects of maternal antibodies on infant antibodies are defined as \[\alpha_i=Y_i(a,M_i(1))-Y_i(a,M_i(0))\]

0.1.2 model

For mediators, we have

\[M_{i1}=\gamma_{01}+\gamma_{11}a_i+e_{mi1}\]

\[M_{i2}=\gamma_{02}+\gamma_{12}a_i+e_{mi2}\]

\[M_{i3}=\gamma_{03}+\gamma_{13}a_i+e_{mi3}\] For outcome, we have

\[Y_i=\beta_0+\beta_1M_{i1}+\beta_2M_{i2}+\beta_3M_{i3}+\beta_{4}a_i+e_{yi}\]

[1] "All the outcome (infant antibodies) considered: "
 [1] "DT_FcgR2a"  "DT_FcgR3b"  "DT_IgG"     "DT_IgG1"    "DT_IgG2"   
 [6] "DT_IgG3"    "DT_IgG4"    "FHA_FcgR2a" "FHA_FcgR3b" "FHA_IgG"   
[11] "FHA_IgG1"   "FHA_IgG2"   "FHA_IgG3"   "FHA_IgG4"   "PRN_FcgR2a"
[16] "PRN_FcgR3b" "PRN_IgG"    "PRN_IgG1"   "PRN_IgG2"   "PRN_IgG3"  
[21] "PRN_IgG4"   "PT_FcgR2a"  "PT_FcgR3b"  "PT_IgG"     "PT_IgG1"   
[26] "PT_IgG2"    "PT_IgG3"    "PT_IgG4"    "TT_FcgR2a"  "TT_FcgR3b" 
[31] "TT_IgG"     "TT_IgG1"    "TT_IgG2"    "TT_IgG3"    "TT_IgG4"   
[36] "DT_ADCD"    "FHA_ADCD"   "PRN_ADCD"   "PT_ADCD"    "TT_ADCD"   
[41] "DT_ADCP"    "FHA_ADCP"   "PRN_ADCP"   "PT_ADCP"    "TT_ADCP"   
[46] "DT_ADNP"    "FHA_ADNP"   "PRN_ADNP"   "PT_ADNP"    "TT_ADNP"   
[1] "All the mediators (maternal cord blood total igg): "
[1] "ELISA_FHA_IgG" "ELISA_PRN_IgG" "ELISA_PT_IgG" 

0.2 Results 1: matimm+/-

      outcome     direffect     medeffect  pvalue_dir    fdr_dir
1      PT_IgG -0.4499575258  0.0230374883 0.002170220 0.04007240
2   TT_FcgR2a  0.2533187242 -0.0121810366 0.002722835 0.04007240
3   TT_FcgR3b  0.6093153152 -0.0199603782 0.003201791 0.04007240
4     TT_ADCD  0.4258765874 -0.0033223344 0.003205792 0.04007240
5     TT_ADCP  0.2042313633 -0.0022043970 0.006566089 0.06566089
6     TT_ADNP  0.1600088555  0.0050302703 0.012963856 0.09493358
7    FHA_ADCP -0.1160743117 -0.0156933599 0.013290701 0.09493358
8   DT_FcgR3b  0.5842478944 -0.0424470902 0.018420608 0.10469266
9     DT_IgG3  0.2898259986 -0.0420863393 0.019336441 0.10469266
10    TT_IgG1  0.5422755995 -0.0145832111 0.020938533 0.10469266
11    FHA_IgG -0.2255506499 -0.0329562999 0.027256353 0.12389251
12   FHA_IgG2 -0.2649364929 -0.0588146060 0.036597309 0.15248879
13    PT_IgG1 -0.4009131978  0.0232805773 0.052664146 0.18212300
14    TT_IgG3  0.2288896521 -0.0248156236 0.054477580 0.18212300
15 PRN_FcgR2a  0.3062615152  0.0089810151 0.060004736 0.18212300
16    PT_IgG3  0.2225464697 -0.0370204012 0.060455970 0.18212300
17   FHA_IgG4 -0.3421763673 -0.0361884625 0.061921820 0.18212300
18   FHA_ADNP  0.0933205845 -0.0212905106 0.071997929 0.19999425
19 FHA_FcgR2a  0.1929955433 -0.0299297399 0.095775365 0.25204044
20  DT_FcgR2a  0.1307850883 -0.0093551928 0.118483437 0.29620859
21     TT_IgG  0.1541213846 -0.0309278988 0.142297719 0.33880409
22 PRN_FcgR3b  0.4156414045  0.0350516602 0.152794220 0.34285034
23 FHA_FcgR3b  0.2760421780 -0.0519521394 0.157711158 0.34285034
24   PRN_IgG2  0.1726181910 -0.0160312688 0.199806336 0.38169050
25     DT_IgG -0.1414461008 -0.0234128132 0.201080962 0.38169050
26    DT_ADCD  0.1154117504  0.0135736284 0.213845909 0.38169050
27    DT_IgG4 -0.2662554542 -0.0489325873 0.215050060 0.38169050
28    PT_ADNP  0.1085680096  0.0106338034 0.233716418 0.38169050
29   PRN_ADCD  0.1478524994  0.0128946800 0.236045518 0.38169050
30    PT_IgG2 -0.0788299441  0.0020728599 0.240032585 0.38169050
31   PRN_IgG3  0.1861963696 -0.0486725723 0.244277704 0.38169050
32   PRN_IgG1  0.2805928995  0.0365862927 0.244281921 0.38169050
33    PT_IgG4 -0.0562492281  0.0009781891 0.268695789 0.40265429
34   PRN_ADNP  0.0391632891 -0.0019577340 0.273804915 0.40265429
35    PT_ADCD  0.1752123956  0.0527830038 0.388879009 0.55554144
36    DT_IgG2 -0.0986487891  0.0012457617 0.467369115 0.64912377
37   FHA_IgG3  0.1126140111 -0.0582028750 0.487828486 0.65846979
38    TT_IgG2  0.0447426349  0.0207576252 0.512568493 0.65846979
39   FHA_ADCD  0.0877271239 -0.0148163798 0.513606437 0.65846979
40    DT_ADNP  0.0179837415 -0.0008238124 0.546986004 0.67107795
41   PRN_IgG4  0.0728321280 -0.0173063628 0.550283922 0.67107795
42    PRN_IgG -0.0798857105 -0.0066343282 0.568320586 0.67657213
43   FHA_IgG1  0.0692670775 -0.0785741819 0.661796030 0.76953027
44    TT_IgG4  0.0515032538  0.0265793405 0.701589110 0.79726035
45    DT_IgG1  0.0792252213 -0.0093426665 0.749766991 0.81947570
46  PT_FcgR3b -0.0467719676  0.0217111733 0.753917641 0.81947570
47   PRN_ADCP -0.0158204877  0.0081016579 0.774155410 0.82356959
48    PT_ADCP -0.0155166795  0.0050382057 0.811596327 0.84541284
49  PT_FcgR2a -0.0188736221  0.0276326636 0.911370131 0.92996952
50    DT_ADCP -0.0005439078  0.0057221199 0.986134924 0.98613492

sessionInfo()
R version 4.4.0 (2024-04-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] RColorBrewer_1.1-3 here_1.0.1         glue_1.7.0         RPostgres_1.4.6   
 [5] DT_0.33            DBI_1.2.2          pls_2.8-3          mediation_4.5.0   
 [9] sandwich_3.1-0     mvtnorm_1.2-4      Matrix_1.7-0       MASS_7.3-60.2     
[13] ggpubr_0.6.0       ggExtra_0.10.1     e1071_1.7-14       ggfortify_0.4.17  
[17] rmarkdown_2.26     knitr_1.46         ggplot2_3.5.1      gdata_3.0.0       
[21] tidyr_1.3.1        tidyquery_0.2.4    dplyr_1.1.4       

loaded via a namespace (and not attached):
 [1] tidyselect_1.2.1  blob_1.2.4        fastmap_1.1.1     promises_1.3.0   
 [5] digest_0.6.35     rpart_4.1.23      timechange_0.3.0  mime_0.12        
 [9] lifecycle_1.0.4   cluster_2.1.6     magrittr_2.0.3    compiler_4.4.0   
[13] rlang_1.1.3       Hmisc_5.1-2       sass_0.4.9        tools_4.4.0      
[17] utf8_1.2.4        yaml_2.3.8        data.table_1.15.4 ggsignif_0.6.4   
[21] htmlwidgets_1.6.4 bit_4.0.5         abind_1.4-5       miniUI_0.1.1.1   
[25] workflowr_1.7.1   withr_3.0.0       foreign_0.8-86    purrr_1.0.2      
[29] nnet_7.3-19       grid_4.4.0        fansi_1.0.6       git2r_0.33.0     
[33] xtable_1.8-4      colorspace_2.1-0  scales_1.3.0      gtools_3.9.5     
[37] cli_3.6.2         generics_0.1.3    rstudioapi_0.16.0 minqa_1.2.6      
[41] cachem_1.0.8      proxy_0.4-27      stringr_1.5.1     splines_4.4.0    
[45] base64enc_0.1-3   vctrs_0.6.5       boot_1.3-30       jsonlite_1.8.8   
[49] carData_3.0-5     queryparser_0.3.2 car_3.1-2         hms_1.1.3        
[53] bit64_4.0.5       rstatix_0.7.2     Formula_1.2-5     htmlTable_2.4.2  
[57] jquerylib_0.1.4   nloptr_2.0.3      lubridate_1.9.3   stringi_1.8.3    
[61] gtable_0.3.5      later_1.3.2       lme4_1.1-35.3     munsell_0.5.1    
[65] tibble_3.2.1      pillar_1.9.0      htmltools_0.5.8.1 R6_2.5.1         
[69] rprojroot_2.0.4   lpSolve_5.6.20    evaluate_0.23     shiny_1.8.1.1    
[73] lattice_0.22-6    backports_1.4.1   broom_1.0.5       httpuv_1.6.15    
[77] bslib_0.7.0       class_7.3-22      Rcpp_1.0.12       nlme_3.1-164     
[81] gridExtra_2.3     checkmate_2.3.1   whisker_0.4.1     xfun_0.43        
[85] fs_1.6.4          zoo_1.8-12        pkgconfig_2.0.3