Supplementary information and Source code for the manuscript 
Title: "Joint Analysis of Two Time-to-Event Outcomes using a Product Partition Model Accounting for Semi-Competing Risks "

Dbtteppmx Ver.1.1
Authors: Kang L., Satoshi, M., Shogo N., Junichiro H.
Code was written by Kang L.
In case of questions or comments please contact kanglei_adam@outlook.com!

The code was written/evaluated in R, C, C++ with the following software versions:
R version 4.2.0 (2022-04-22)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura Version 133.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

    
other attached packages:
[1] xtable_1.8-4        ggsci_3.0.0         survival_3.4-0      Rcpp_1.0.9         
[5] gridExtra_2.3       dplyr_1.1.0         ggplot2_3.4.0       randomcoloR_1.1.0.1
[9] nloptr_2.0.3      

loaded via a namespace (and not attached):
 [1] pillar_1.7.0     compiler_4.2.0   tools_4.2.0      lattice_0.20-45  jsonlite_1.8.0  
 [6] Rtsne_0.16       lifecycle_1.0.3  tibble_3.1.7     gtable_0.3.0     pkgconfig_2.0.3 
[11] rlang_1.1.3      Matrix_1.4-1     cli_3.4.1        rstudioapi_0.13  curl_4.3.2      
[16] withr_2.5.0      stringr_1.4.0    cluster_2.1.3    generics_0.1.2   vctrs_0.5.2     
[21] grid_4.2.0       tidyselect_1.2.0 glue_1.6.2       R6_2.5.1         fansi_1.0.3     
[26] farver_2.1.0     magrittr_2.0.3   scales_1.2.0     ellipsis_0.3.2   splines_4.2.0   
[31] colorspace_2.0-3 labeling_0.4.2   V8_4.2.0         utf8_1.2.2       stringi_1.7.6   
[36] munsell_0.5.0    crayon_1.5.1    



-----

Guide for environment setting (using macOS as an example)

1.Cmake 3.23.2
2.gcc (Apple clang version 14.0.3 (clang-1403.0.22.14.1))
3.OpenMp 18.1.1 
4.nloptr 2.0.3
5.llvm 17.0.6 
6.boost 1.84.0 
6.Edit 	/Users/your name/.R/Makevars.  

e.g.

FLIBS   =-L/opt/homebrew/opt/gfortran/lib
F77     = /opt/homebrew/bin/gfortran
FC      = /opt/homebrew/bin/gfortran

LLVM_LOC = /opt/homebrew/opt/llvm
CFLAGS   = -I/opt/homebrew/include
CPPFLAGS = -I/opt/homebrew/include
CXXFLAGS = -I/opt/homebrew/include
LDFLAGS+=-L/opt/homebrew/opt/jpeg/lib
LDFLAGS += -L/opt/homebrew/opt/libomp/lib -lomp
CPPFLAGS += -Xclang -fopenmp
CXX = /opt/homebrew/opt/llvm/bin/clang++





# For PPMx
If need to change the default C complier, Edit /Users/your name/.R/Makevars
input the clang complier path on your PC with the command e.g.
CC = /your-library-path/clang       
