Last updated: 2024-06-15

Checks: 7 0

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.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

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 7a93f78. 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/apwp_multiple.Rmd
    Untracked:  apwp_single_pca.Rmd
    Untracked:  apwp_single_pca.html
    Untracked:  data/dirEffect_apwp_single_pca.Rd
    Untracked:  data/medEffect_apwp_single_pca.Rd
    Untracked:  data/totalEffect_apwp_single_pca.Rd

Unstaged changes:
    Modified:   analysis/apwp.Rmd
    Modified:   analysis/apwp_pca_single.Rmd
    Modified:   analysis/cluster_pca_single.Rmd
    Deleted:    withelisa.csv
    Deleted:    withelist1.csv

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_pca.Rmd) and HTML (docs/mediation_pca.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 50edc75 Jie Zhou 2024-06-09 remove ap data from manuscript1 and remove elisa data from manuscript2
html 50edc75 Jie Zhou 2024-06-09 remove ap data from manuscript1 and remove elisa data from manuscript2
Rmd 532d320 Jie Zhou 2024-02-21 madi meeting
html 532d320 Jie Zhou 2024-02-21 madi meeting
Rmd 528d126 Jie Zhou 2024-01-23 added pls and pca based mediation analysis
html 528d126 Jie Zhou 2024-01-23 added pls and pca based mediation analysis


Attaching package: 'data.table'
The following objects are masked from 'package:gdata':

    first, last
The following objects are masked from 'package:dplyr':

    between, first, last

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 Definitions

0.1.2 model

[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" 
[1] "The Proportion explained by the principal components: "
[1] 0.559 0.850 1.000

0.2 Results 1: matimm+/-

0.2.1 Direct causal effects

      outcome      deffect        dlower       dupper dpvalue       dfdr
1      PT_IgG -0.437796255 -0.6659503668 -0.163429562   0.000 0.00000000
2   TT_FcgR2a  0.256071844  0.1141989961  0.439205830   0.000 0.00000000
3   TT_FcgR3b  0.609550681  0.2990839307  1.022512968   0.000 0.00000000
4     TT_ADCD  0.433959242  0.2054953620  0.685466333   0.000 0.00000000
5     TT_ADCP  0.206383746  0.0840270499  0.341283338   0.002 0.02000000
6   DT_FcgR3b  0.572777510  0.0848840643  1.011729927   0.010 0.07142857
7     TT_IgG1  0.544240040  0.1174210760  1.005950479   0.010 0.07142857
8    FHA_ADCP -0.118206076 -0.1950125816 -0.025196657   0.012 0.07500000
9     TT_ADNP  0.157238616  0.0254691654  0.273075335   0.022 0.12222222
10    DT_IgG3  0.279411757  0.0200576270  0.469192581   0.030 0.15000000
11    PT_IgG1 -0.382916943 -0.7235185922 -0.010093490   0.034 0.15454545
12    FHA_IgG -0.228346582 -0.4028635116  0.004768727   0.044 0.17857143
13    TT_IgG3  0.224390667  0.0045782358  0.432396135   0.048 0.17857143
14   FHA_IgG2 -0.272631308 -0.5286583667  0.005080510   0.050 0.17857143
15   FHA_IgG4 -0.356565821 -0.7524476427  0.007706168   0.062 0.19411765
16 PRN_FcgR2a  0.296481345 -0.0285871243  0.595154990   0.066 0.19411765
17    PT_IgG3  0.212389576 -0.0073220772  0.430724573   0.066 0.19411765
18 FHA_FcgR2a  0.186418557 -0.0129937221  0.415121000   0.074 0.20555556
19  DT_FcgR2a  0.131280778  0.0004617927  0.333199467   0.082 0.21578947
20   FHA_ADNP  0.089810859 -0.0092439875  0.190050127   0.088 0.22000000
21     TT_IgG  0.155374324 -0.0333963585  0.349032516   0.120 0.27391304
22 FHA_FcgR3b  0.264294145 -0.0514374249  0.648671960   0.124 0.27391304
23    DT_ADCD  0.127481120 -0.0366039393  0.309472389   0.126 0.27391304
24 PRN_FcgR3b  0.399427711 -0.2101596901  0.890768124   0.176 0.36000000
25    PT_IgG2 -0.079612662 -0.2136540218  0.037060502   0.180 0.36000000
26     DT_IgG -0.145741215 -0.3565214066  0.079357770   0.198 0.36551724
27    DT_IgG4 -0.277152572 -0.7035625419  0.134357180   0.206 0.36551724
28   PRN_ADCD  0.159700911 -0.0806461494  0.409848142   0.212 0.36551724
29    PT_ADNP  0.105617489 -0.0495370828  0.283808934   0.212 0.36551724
30   PRN_IgG2  0.166336539 -0.1254750295  0.408818608   0.238 0.39666667
31   PRN_IgG1  0.272054363 -0.1751213107  0.730040726   0.256 0.41290323
32   PRN_ADNP  0.038385381 -0.0300736339  0.112144415   0.282 0.44062500
33    PT_ADCD  0.193109967 -0.1728385714  0.557190086   0.292 0.44242424
34   PRN_IgG3  0.164189691 -0.1333244931  0.460671080   0.306 0.45000000
35    PT_IgG4 -0.056306024 -0.1843457147  0.051375069   0.340 0.48571429
36   FHA_ADCD  0.092373678 -0.1675435972  0.325498320   0.456 0.62702703
37    TT_IgG2  0.045164861 -0.0881174050  0.177222282   0.464 0.62702703
38    DT_ADNP  0.015811015 -0.0382049698  0.072604126   0.516 0.66410256
39    DT_IgG2 -0.096476378 -0.3504110572  0.188005416   0.518 0.66410256
40    PRN_IgG -0.086525591 -0.3643006577  0.182001282   0.546 0.67804878
41   FHA_IgG3  0.101720076 -0.2304640131  0.403481978   0.556 0.67804878
42   PRN_IgG4  0.057299548 -0.2306736333  0.285087288   0.638 0.75952381
43   FHA_IgG1  0.066382412 -0.2430847626  0.364172736   0.654 0.76046512
44    TT_IgG4  0.047198392 -0.2420750976  0.307465551   0.694 0.78863636
45   PRN_ADCP -0.018251222 -0.1223102594  0.096856768   0.728 0.79565217
46    DT_IgG1  0.073993113 -0.3332654197  0.573146259   0.732 0.79565217
47  PT_FcgR3b -0.039853026 -0.2866512651  0.260311645   0.808 0.84166667
48    PT_ADCP -0.015272535 -0.1400979573  0.107621217   0.808 0.84166667
49    DT_ADCP -0.002280838 -0.0591040660  0.060352039   0.894 0.91224490
50  PT_FcgR2a -0.006686480 -0.3334244796  0.278623575   0.952 0.95200000

0.2.2 Mediation causal effects

      outcome         meffect       mlower       mupper mpvalue  mfdr
1    FHA_IgG1 -0.075689516839 -0.236802000 0.0002190974   0.096 0.972
2    FHA_IgG2 -0.051119791084 -0.175516290 0.0047667498   0.154 0.972
3      TT_IgG -0.032180838391 -0.146588501 0.0013944285   0.154 0.972
4    FHA_ADNP -0.017780785324 -0.066997593 0.0026799186   0.166 0.972
5     FHA_IgG -0.030160367569 -0.096346950 0.0038051702   0.172 0.972
6    FHA_ADCP -0.013561595767 -0.042770206 0.0027023031   0.206 0.972
7     DT_ADCP  0.007459049766 -0.001242029 0.0338833166   0.214 0.972
8    FHA_IgG3 -0.047308939560 -0.183454346 0.0114101162   0.270 0.972
9     DT_IgG3 -0.031672097728 -0.115976773 0.0146934328   0.286 0.972
10    PT_IgG3 -0.026863507557 -0.132032351 0.0096157641   0.316 0.972
11    TT_IgG2  0.020335399096 -0.014389584 0.0744866612   0.334 0.972
12 FHA_FcgR2a -0.023352753799 -0.121338530 0.0109189617   0.344 0.972
13 FHA_FcgR3b -0.040204106466 -0.181044765 0.0205292166   0.356 0.972
14 PRN_FcgR3b  0.051265353584 -0.048018223 0.2629233962   0.404 0.972
15     DT_IgG -0.019117699448 -0.111913436 0.0102939226   0.406 0.972
16   PRN_ADCP  0.010532392655 -0.010069482 0.0444795689   0.412 0.972
17  TT_FcgR2a -0.014934156805 -0.114518334 0.0067660505   0.430 0.972
18    DT_IgG4 -0.038035469877 -0.209637531 0.0386701738   0.456 0.972
19    PT_ADCD  0.034885432340 -0.032226487 0.1741766056   0.458 0.972
20    TT_IgG3 -0.020316638035 -0.108374690 0.0229748660   0.462 0.972
21   FHA_ADCD -0.019462933572 -0.079933785 0.0243764404   0.500 0.972
22   PRN_IgG1  0.045124829744 -0.061632169 0.2482312631   0.510 0.972
23    PT_ADNP  0.013584324311 -0.019933323 0.0663214726   0.522 0.972
24  TT_FcgR3b -0.020195743714 -0.207616777 0.0241198644   0.562 0.972
25 PRN_FcgR2a  0.018761185451 -0.031736178 0.1143405589   0.576 0.972
26    TT_ADNP  0.007800509659 -0.017352101 0.0466144016   0.578 0.972
27   PRN_IgG3 -0.026665893329 -0.143718450 0.0581021318   0.580 0.972
28    TT_IgG4  0.030884202687 -0.049421497 0.1394571902   0.604 0.972
29  DT_FcgR3b -0.030976705888 -0.219047506 0.0637426040   0.610 0.972
30    TT_ADCD -0.011404988689 -0.115846083 0.0220653668   0.634 0.972
31  DT_FcgR2a -0.009850882547 -0.101049308 0.0139439645   0.646 0.972
32  PT_FcgR3b  0.014792231211 -0.042610224 0.1245712779   0.658 0.972
33   FHA_IgG4 -0.021799008971 -0.165726513 0.0709249699   0.662 0.972
34    TT_IgG1 -0.016547651402 -0.237692121 0.0594507348   0.674 0.972
35  PT_FcgR2a  0.015445521247 -0.063571741 0.1164317223   0.724 0.972
36   PRN_IgG2 -0.009749616288 -0.118451565 0.0412160288   0.726 0.972
37     PT_IgG  0.010876217604 -0.045540610 0.0914122885   0.750 0.972
38    PT_ADCP  0.004794060812 -0.030037436 0.0354236402   0.774 0.972
39    TT_ADCP -0.004356780099 -0.075856600 0.0150031585   0.792 0.972
40    PT_IgG2  0.002855577421 -0.019976788 0.0589008347   0.796 0.972
41    DT_ADNP  0.001348914574 -0.010690545 0.0218587596   0.826 0.972
42   PRN_IgG4 -0.001773783320 -0.094932127 0.0500552181   0.828 0.972
43    DT_IgG2 -0.000926649410 -0.144624035 0.0457107842   0.856 0.972
44    PT_IgG1  0.005284322225 -0.100837449 0.1011699604   0.896 0.972
45    DT_IgG1 -0.004110558204 -0.236509366 0.1217741224   0.910 0.972
46   PRN_ADNP -0.001179825633 -0.031424668 0.0169278087   0.922 0.972
47   PRN_ADCD  0.001046268738 -0.075739084 0.0468950406   0.940 0.972
48    PT_IgG4  0.001034985180 -0.049635779 0.0338484893   0.954 0.972
49    DT_ADCD  0.001504258512 -0.049684477 0.0342790173   0.964 0.972
50    PRN_IgG  0.000005552545 -0.054265981 0.0892570738   0.972 0.972

0.2.3 Total effects

      outcome      teffect       tlower      tupper tpvalue       tfdr
1      PT_IgG -0.426920037 -0.653541754 -0.17079027   0.000 0.00000000
2   TT_FcgR2a  0.241137688  0.112672135  0.39658401   0.000 0.00000000
3   TT_FcgR3b  0.589354937  0.286580684  0.96287633   0.000 0.00000000
4     TT_ADCD  0.422554253  0.207049865  0.67251212   0.000 0.00000000
5     TT_ADCP  0.202026966  0.082678188  0.32276265   0.000 0.00000000
6     TT_ADNP  0.165039126  0.043148212  0.26717823   0.002 0.01666667
7    FHA_ADCP -0.131767672 -0.210631927 -0.03967033   0.006 0.04285714
8   DT_FcgR3b  0.541800804  0.113682724  0.96152150   0.008 0.05000000
9     TT_IgG1  0.527692388  0.104098056  0.93921965   0.010 0.05555556
10   FHA_IgG2 -0.323751099 -0.549761177 -0.04007584   0.018 0.09000000
11   FHA_IgG4 -0.378364830 -0.712448821 -0.05124104   0.020 0.09090909
12    FHA_IgG -0.258506950 -0.418234923 -0.02121004   0.024 0.10000000
13    PT_IgG1 -0.377632621 -0.742275776 -0.02110133   0.036 0.13846154
14    DT_IgG3  0.247739659 -0.002742856  0.44069838   0.048 0.17142857
15 PRN_FcgR2a  0.315242530 -0.005205230  0.60871583   0.052 0.17333333
16    TT_IgG3  0.204074029 -0.002667692  0.42353459   0.068 0.21250000
17  DT_FcgR2a  0.121429896 -0.002527717  0.28321970   0.076 0.22352941
18 FHA_FcgR2a  0.163065803 -0.012169028  0.37889210   0.082 0.22777778
19    PT_IgG3  0.185526068 -0.033588380  0.41153944   0.098 0.25000000
20    DT_ADCD  0.128985379 -0.022376023  0.30278383   0.102 0.25000000
21 PRN_FcgR3b  0.450693065 -0.131731065  0.93495094   0.108 0.25000000
22    DT_IgG4 -0.315188042 -0.732436848  0.04657734   0.110 0.25000000
23     DT_IgG -0.164858914 -0.347968355  0.03850453   0.120 0.26086957
24   FHA_ADNP  0.072030074 -0.018004534  0.17264912   0.150 0.30000000
25    PT_ADNP  0.119201813 -0.041417684  0.27319357   0.150 0.30000000
26   PRN_IgG1  0.317179192 -0.118224593  0.78166994   0.162 0.31153846
27 FHA_FcgR3b  0.224090039 -0.076937737  0.57417555   0.176 0.31428571
28   PRN_ADCD  0.160747179 -0.058455909  0.37462946   0.176 0.31428571
29    PT_IgG2 -0.076757084 -0.196197377  0.03995595   0.198 0.34137931
30     TT_IgG  0.123193486 -0.065330111  0.29580930   0.224 0.36129032
31    PT_ADCD  0.227995399 -0.138264040  0.56996167   0.224 0.36129032
32    PT_IgG4 -0.055271039 -0.156165749  0.03474189   0.238 0.36969697
33   PRN_IgG2  0.156586922 -0.128357277  0.39426554   0.244 0.36969697
34   PRN_ADNP  0.037205555 -0.029172947  0.10630082   0.272 0.40000000
35    TT_IgG2  0.065500260 -0.064554712  0.20141165   0.300 0.42857143
36   PRN_IgG3  0.137523797 -0.150732732  0.45182472   0.398 0.54324324
37    DT_IgG2 -0.097403027 -0.325925112  0.14959872   0.402 0.54324324
38    DT_ADNP  0.017159929 -0.034576403  0.07194845   0.484 0.63684211
39    PRN_IgG -0.086520039 -0.349284060  0.15606738   0.528 0.67692308
40   FHA_ADCD  0.072910744 -0.169273190  0.32104635   0.546 0.67804878
41    TT_IgG4  0.078082594 -0.155089542  0.33799040   0.556 0.67804878
42   PRN_IgG4  0.055525765 -0.199296474  0.23930106   0.600 0.71428571
43   FHA_IgG3  0.054411136 -0.259839704  0.33886449   0.732 0.85116279
44    DT_IgG1  0.069882555 -0.341157934  0.53216366   0.750 0.85227273
45    PT_ADCP -0.010478474 -0.130952146  0.10331083   0.844 0.92173913
46   PRN_ADCP -0.007718830 -0.117880274  0.10176049   0.848 0.92173913
47    DT_ADCP  0.005178212 -0.050916202  0.06485176   0.880 0.93617021
48  PT_FcgR3b -0.025060794 -0.275378988  0.26689601   0.914 0.95208333
49   FHA_IgG1 -0.009307104 -0.320998145  0.26535682   0.956 0.97551020
50  PT_FcgR2a  0.008759042 -0.317150230  0.27533538   0.982 0.98200000

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 broom_1.0.5        here_1.0.1         glue_1.7.0        
 [5] RPostgres_1.4.6    DT_0.33            data.table_1.15.4  DBI_1.2.2         
 [9] pls_2.8-3          mediation_4.5.0    sandwich_3.1-0     mvtnorm_1.2-4     
[13] Matrix_1.7-0       MASS_7.3-60.2      ggpubr_0.6.0       ggExtra_0.10.1    
[17] e1071_1.7-14       ggfortify_0.4.17   rmarkdown_2.26     knitr_1.46        
[21] ggplot2_3.5.1      gdata_3.0.0        tidyr_1.3.1        tidyquery_0.2.4   
[25] 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        ggsignif_0.6.4    htmlwidgets_1.6.4
[21] bit_4.0.5         abind_1.4-5       miniUI_0.1.1.1    workflowr_1.7.1  
[25] withr_3.0.0       foreign_0.8-86    purrr_1.0.2       nnet_7.3-19      
[29] grid_4.4.0        fansi_1.0.6       git2r_0.33.0      xtable_1.8-4     
[33] colorspace_2.1-0  scales_1.3.0      gtools_3.9.5      cli_3.6.2        
[37] generics_0.1.3    rstudioapi_0.16.0 minqa_1.2.6       cachem_1.0.8     
[41] proxy_0.4-27      stringr_1.5.1     splines_4.4.0     base64enc_0.1-3  
[45] vctrs_0.6.5       boot_1.3-30       jsonlite_1.8.8    carData_3.0-5    
[49] queryparser_0.3.2 car_3.1-2         hms_1.1.3         bit64_4.0.5      
[53] rstatix_0.7.2     Formula_1.2-5     htmlTable_2.4.2   jquerylib_0.1.4  
[57] nloptr_2.0.3      lubridate_1.9.3   stringi_1.8.3     gtable_0.3.5     
[61] later_1.3.2       lme4_1.1-35.3     munsell_0.5.1     tibble_3.2.1     
[65] pillar_1.9.0      htmltools_0.5.8.1 R6_2.5.1          rprojroot_2.0.4  
[69] lpSolve_5.6.20    evaluate_0.23     shiny_1.8.1.1     lattice_0.22-6   
[73] backports_1.4.1   httpuv_1.6.15     bslib_0.7.0       class_7.3-22     
[77] Rcpp_1.0.12       nlme_3.1-164      gridExtra_2.3     checkmate_2.3.1  
[81] whisker_0.4.1     xfun_0.43         fs_1.6.4          zoo_1.8-12       
[85] pkgconfig_2.0.3