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/apwp_pca_single.Rmd
    Modified:   analysis/cluster_pca_single4.Rmd
    Modified:   analysis/cluster_single.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/cluster_single.Rmd) and HTML (docs/cluster_single.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 8c46744 Jie Zhou 2024-06-03 remove antigen elisa
html 8c46744 Jie Zhou 2024-06-03 remove antigen elisa
html 2fd12dc Jie Zhou 2024-05-31 start manuscript 2
Rmd 42c1edc Jie Zhou 2024-04-28 double pca
html 42c1edc Jie Zhou 2024-04-28 double pca
Rmd 17ca781 Jie Zhou 2024-04-07 cleanup


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

[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+/-

### load PCA scores
library(tidyr)
load("./code/pca_scores_both_studies.RData")

index=which(pca_store$group %in% c("RClust1", "RClust2", "RClust3", "RClust4")
            & pca_store$manuscript=="manuscript1"
            & pca_store$visit_name=="vaccinated")
clusterdata=pca_store[index,]
cl1=clusterdata[which(clusterdata$group=="RClust1"),]
cl2=clusterdata[which(clusterdata$group=="RClust2"),]
cl3=clusterdata[which(clusterdata$group=="RClust3"),]
cl4=clusterdata[which(clusterdata$group=="RClust4"),]

0.2.1 cluster 1

0.2.1.1 Direct causal effects

  outcome      mediator     deffect    dlower     dupper dpvalue  dfdr
1     PC2 ELISA_FHA_IgG -1.33364323 -2.285571 -0.4527285   0.002 0.012
2     PC2 ELISA_PRN_IgG -1.39596664 -2.322278 -0.4387961   0.006 0.018
3     PC2  ELISA_PT_IgG -1.33183009 -2.286999 -0.3912140   0.010 0.020
4     PC1 ELISA_PRN_IgG -0.18317077 -1.629314  1.1183415   0.822 0.984
5     PC1 ELISA_FHA_IgG -0.13712247 -1.490628  1.1832640   0.830 0.984
6     PC1  ELISA_PT_IgG -0.00570454 -1.412446  1.3864768   0.984 0.984

0.2.1.2 Mediation causal effects

  outcome      mediator       meffect     mlower    mupper mpvalue   mfdr
1     PC2 ELISA_FHA_IgG -0.0900569387 -0.4044780 0.1081501   0.440 0.8784
2     PC2  ELISA_PT_IgG -0.0817426340 -0.3817395 0.1183038   0.446 0.8784
3     PC1  ELISA_PT_IgG -0.0814718563 -0.5017488 0.2331207   0.596 0.8784
4     PC1 ELISA_PRN_IgG  0.0658518784 -0.2176415 0.4599149   0.666 0.8784
5     PC1 ELISA_FHA_IgG  0.0465015288 -0.1838283 0.3744302   0.732 0.8784
6     PC2 ELISA_PRN_IgG -0.0004444533 -0.2075622 0.2128584   0.984 0.9840

0.2.1.3 Total effects

  outcome      mediator     teffect    tlower     tupper tpvalue  tfdr
1     PC2 ELISA_FHA_IgG -1.42370017 -2.368972 -0.4885919   0.000 0.000
2     PC2 ELISA_PRN_IgG -1.39641109 -2.315415 -0.5125377   0.000 0.000
3     PC2  ELISA_PT_IgG -1.41357272 -2.362192 -0.4705191   0.002 0.004
4     PC1 ELISA_FHA_IgG -0.09062094 -1.417274  1.2367720   0.866 0.898
5     PC1 ELISA_PRN_IgG -0.11731889 -1.532371  1.2359292   0.898 0.898
6     PC1  ELISA_PT_IgG -0.08717640 -1.462824  1.3303458   0.898 0.898

0.2.2 cluster 2

0.2.2.1 Direct causal effects

  outcome      mediator   deffect     dlower   dupper dpvalue   dfdr
1     PC1  ELISA_PT_IgG 1.9630587  0.5345413 3.462975   0.012 0.0480
2     PC1 ELISA_PRN_IgG 1.9192500  0.3824428 3.367074   0.016 0.0480
3     PC1 ELISA_FHA_IgG 1.7779105  0.1810343 3.302970   0.028 0.0560
4     PC2 ELISA_PRN_IgG 0.5122989 -0.1999695 1.257762   0.160 0.2400
5     PC2 ELISA_FHA_IgG 0.4870020 -0.2543515 1.277551   0.212 0.2544
6     PC2  ELISA_PT_IgG 0.4117045 -0.3430096 1.134905   0.304 0.3040

0.2.2.2 Mediation causal effects

  outcome      mediator      meffect      mlower    mupper mpvalue  mfdr
1     PC2  ELISA_PT_IgG  0.135497089 -0.04313602 0.4079518   0.176 0.855
2     PC1  ELISA_PT_IgG -0.190745271 -0.69613816 0.1234275   0.300 0.855
3     PC1 ELISA_PRN_IgG -0.107981143 -0.56590047 0.1677196   0.506 0.855
4     PC2 ELISA_FHA_IgG  0.044701674 -0.08492599 0.2599039   0.570 0.855
5     PC2 ELISA_PRN_IgG  0.012496199 -0.12218534 0.1980211   0.866 0.986
6     PC1 ELISA_FHA_IgG  0.002276055 -0.37890251 0.3241301   0.986 0.986

0.2.2.3 Total effects

  outcome      mediator   teffect     tlower   tupper tpvalue  tfdr
1     PC1  ELISA_PT_IgG 1.7723134  0.3056033 3.203446   0.018 0.060
2     PC1 ELISA_PRN_IgG 1.8112688  0.2532304 3.251029   0.020 0.060
3     PC1 ELISA_FHA_IgG 1.7801866  0.1711000 3.303233   0.032 0.064
4     PC2 ELISA_PRN_IgG 0.5247951 -0.1938216 1.231579   0.152 0.182
5     PC2 ELISA_FHA_IgG 0.5317037 -0.2157883 1.322118   0.170 0.182
6     PC2  ELISA_PT_IgG 0.5472016 -0.2216279 1.278463   0.182 0.182

0.2.3 cluster 3

0.2.3.1 Direct causal effects

  outcome      mediator    deffect     dlower   dupper dpvalue   dfdr
1     PC2 ELISA_PRN_IgG 1.42579764  0.2864403 2.397460   0.004 0.0240
2     PC2 ELISA_FHA_IgG 1.49781195  0.4836739 2.568917   0.008 0.0240
3     PC2  ELISA_PT_IgG 1.51878647  0.4618136 2.514459   0.012 0.0240
4     PC1 ELISA_PRN_IgG 0.28230579 -1.1192842 1.719964   0.690 0.8976
5     PC1 ELISA_FHA_IgG 0.27676964 -1.2070390 1.767124   0.748 0.8976
6     PC1  ELISA_PT_IgG 0.07314142 -1.5253284 1.609204   0.916 0.9160

0.2.3.2 Mediation causal effects

  outcome      mediator     meffect     mlower    mupper mpvalue  mfdr
1     PC1  ELISA_PT_IgG  0.13007741 -0.2022499 0.6181570   0.470 0.946
2     PC2  ELISA_PT_IgG -0.09044620 -0.4215620 0.1494247   0.488 0.946
3     PC2 ELISA_FHA_IgG -0.04950298 -0.3347248 0.1561648   0.686 0.946
4     PC1 ELISA_PRN_IgG -0.05012777 -0.4104483 0.2095281   0.758 0.946
5     PC1 ELISA_FHA_IgG -0.02064108 -0.3280140 0.2609410   0.852 0.946
6     PC2 ELISA_PRN_IgG -0.01103198 -0.2652956 0.1872902   0.946 0.946

0.2.3.3 Total effects

  outcome      mediator   teffect     tlower   tupper tpvalue  tfdr
1     PC2 ELISA_PRN_IgG 1.4147657  0.3228873 2.415478   0.002 0.012
2     PC2 ELISA_FHA_IgG 1.4483090  0.4138235 2.542958   0.008 0.016
3     PC2  ELISA_PT_IgG 1.4283403  0.3166595 2.423078   0.008 0.016
4     PC1 ELISA_PRN_IgG 0.2321780 -1.2343321 1.630743   0.744 0.782
5     PC1 ELISA_FHA_IgG 0.2561286 -1.2193489 1.694458   0.766 0.782
6     PC1  ELISA_PT_IgG 0.2032188 -1.3728811 1.644870   0.782 0.782

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