Based on our results, male sex, lung cancer, melanoma, and treatment with anti-PD-1, anti-PD-L1, or anti-PD-1 in combination with CTLA-4 may increase the risk of ICI-associated myocarditis. This evidence concerns the gene PDCD1 and lung cancer.