Paper 2

Author

Dr Samuel Blay Nguah

Published

March 19, 2025

Data manipulation

Code
library(tidyverse)

df_cathlab <- 
    readxl::read_xlsx(path = "CATHLAB REGISTRY DATA_Clean 4.xlsx") %>%
    janitor::clean_names() %>% 
    rename(
        baseline_hb = baseline_haematology_hb_13g_dl_male_11g_dl_female,
        ldl_3months = monitoring_lipid_profile_ldl_c_at_3_months,
        ldl_6months = monitoring_lipid_profile_ldl_c_at_6_months,
        ldl_1year = monitoring_lipid_profile_ldl_c_at_1yr,
        creatinine_48hrs = monitoring_creatinine_48hrs_post_procedure,
        baseline_hba1c = baseline_haematology_hba1c_5_6_percent_non_diabetic_7_percent_diabetic,
        nitroglycerin2 = nitroglycerin_premedication_dose_in_second_procedure_if_staged,
        heparin_premed_2 = heparin_premedication_dose_in_second_procedure_if_staged,
        coronary_angio = description_of_coronary_angiography_findings,
        contrast_vol_2 = contrast_volume_in_second_procedure_if_staged,
        creatinine_3months = monitoring_creatinine_3_months_post_procedure,
        creatinine_1week = monitoring_creatinine_1_week_post_procedure,
        film_no2 = film_number_of_second_procedure_if_staged,
        baseline_plt = baseline_haematology_platelet_150_10_3_u_l,
        second_access = reason_for_secondary_access_if_applicable,
        sex = sex_1 ) %>% 
    mutate(
        id = row_number(),
        sex = factor(sex),
        marital_status =  case_when(
            str_detect(marital_status, "arried") ~ "Married",
            TRUE ~ marital_status),
        nationality = case_when(
            nationality == "Ghanaian, Non-Ghanaian" ~ "Ghanaian",
            TRUE ~ nationality),
        ethnicity = case_when(
            ethnicity == "Akan, Ewe" ~ "Akan",
            TRUE ~ ethnicity
            ) %>% fct_lump_prop(prop = .1, other_level = "Others"),
        religion = case_when(
            religion == "Christian, Bhuddist" ~ "Christian",
            TRUE ~ religion),
        occupation = case_when(
            str_detect(occupation, "Private Sector") ~ "Private Sector",
            str_detect(occupation, "Public Sector") ~ "Public Sector",
            TRUE ~ occupation),
        prev_cad = case_when(
            prev_cad == "no" ~ "No", TRUE ~ prev_cad),
        across(marital_status:phy_inactivity, ~factor(.)), 
        risk_factors = (hpn == "Yes") + (t2dm == "Yes") + (smoking == "Yes") + 
            (dyslip == "Yes") + (old_age == "Yes") + (obesity == "Yes") +
            (alcohol == "Yes") + (f_hx_cad == "Yes") + (phy_inactivity == "Yes"),
        risk_factors_cat = case_when(
            risk_factors == 0 ~ "None",
            (risk_factors > 0 & risk_factors < 4) ~ "1 to 3",
            risk_factors >= 4 ~ "4 to 7") %>% 
            factor(levels = c("None", "1 to 3", "4 to 7")),
        agecat = case_when(
            age < 45 ~ "<45 years", 
            age >= 45 & age <= 65 ~ "45 to 65 years",
            age > 66 ~ ">65 years") %>% 
                factor(levels=c("<45 years","45 to 65 years", ">65 years")),
        type_of_lesion = factor(
            type_of_lesion, 
            levels = c("Normal" ,"MNOD", "1VD", "2VD", "3VD", "LMD")),
        race = fct_lump_prop(race, prop = 0.01,  other_level = "Others"),
        across(
            c(lad_dx, rca_dx, lcx_dx),
            ~factor(.x, levels = c("Normal", "Mild", "Moderate", "Severe"))),
        lad_dx_2 = case_when(
            lad_dx == "Normal" ~ "No", 
            lad_dx %in% c("Mild", "Moderate", "Severe") ~ "Yes"),
        rca_dx_2 = case_when(
            rca_dx == "Normal" ~ "No", 
            rca_dx %in% c("Mild", "Moderate", "Severe") ~ "Yes"),
        lcx_dx_2 = case_when(
            lcx_dx == "Normal" ~ "No", 
            lcx_dx %in% c("Mild", "Moderate", "Severe") ~ "Yes"),
        lm_severe_dxs = ifelse(lm_dx == "Severe", 1, 0),
        rca_severe_dxs = ifelse(rca_dx == "Severe", 1, 0),
        lcx_severe_dxs = ifelse(lcx_dx == "Severe", 1, 0),
        lad_severe_dxs = ifelse(lad_dx == "Severe", 1, 0),
        n_severe_dxs = (lm_dx == "Severe") + (rca_dx == "Severe") + 
            (lcx_dx == "Severe") + (lad_dx == "Severe"),
        severe_dxs = case_when(
            (lm_dx == "Severe" | rca_dx == "Severe" | 
                 lcx_dx == "Severe" | lad_dx == "Severe") ~ "Yes", 
            n_severe_dxs == 0 ~ "No")) %>% 
    filter(procedure != "RHC") %>% 
    rename(ageyrs = age)

Labelling data

Code
labelled::var_label(df_cathlab) <- 
    list(
        sex = "Sex of Patient",
        ageyrs = "Age (years)",
        agecat = "Age category",
        marital_status = "Marital Status",
        nationality = "Nationaliity",
        ethnicity ="Ethnicity",
        race = "Race",
        religion = "Religion",
        occupation = "Occupation",
        urgency_of_procedure = "Urgency of procedure", 
        procedure = "Procedure",
        hpn = "Hypertension",
        t2dm = "Type II DM",
        dyslip ="Dyslipidemia", 
        prev_cad = "Previous CAD",
        smoking = "Smoking",
        old_age = "Age >= 60 years",
        risk_factors = "No. of Risk factors",
        type_of_lesion = "Type of Coronary Lesion", 
        obesity = "Obesity", 
        alcohol = "Alcohol", 
        f_hx_cad = "Family History of CAD", 
        phy_inactivity = "Physical Inactivity",
        type_of_intervention = "Type of intervention",
        presentation = "Presentation",
        risk_factors_cat = "No. of Risk factors",
        in_hospital_outcome ="In-hospital Outcome",
        number_of_stents = "Number of Stents",
        coronary_anatomy ="Coronary Dominance",
        severe_dxs = "Severe Disease",
        n_severe_dxs = "Number of Severe Disease")

Generating data with severe disease

Code
df_cathlab_new <- 
    df_cathlab %>% 
    filter(lm_dx == "Severe" | rca_dx == "Severe" | lcx_dx == "Severe" | lad_dx == "Severe")

Data summaries

Code
df_cathlab %>% 
    select(
        sex, ageyrs, marital_status, ethnicity, religion, dyslip, 
        hpn, t2dm, smoking, obesity, alcohol, presentation, 
        coronary_anatomy, lm_dx, rca_dx, lcx_dx, lad_dx,
        lm_severe_dxs, lad_severe_dxs,lcx_severe_dxs, rca_severe_dxs, 
        severe_dxs, n_severe_dxs, type_of_lesion) %>% 
    summarytools::dfSummary() %>% 
    summarytools::stview(method = "render")

Data Frame Summary

df_cathlab

Dimensions: 463 x 24
Duplicates: 1
No Variable Label Stats / Values Freqs (% of Valid) Graph Valid Missing
1 sex [factor] Sex of Patient
1. Female
2. Male
111 ( 24.0% )
352 ( 76.0% )
463 (100.0%) 0 (0.0%)
2 ageyrs [numeric] Age (years)
Mean (sd) : 59.8 (11.3)
min ≤ med ≤ max:
28 ≤ 60 ≤ 90
IQR (CV) : 15 (0.2)
58 distinct values 463 (100.0%) 0 (0.0%)
3 marital_status [factor] Marital Status
1. Divorced
2. Married
3. Single
4. Widowed
9 ( 2.2% )
359 ( 86.3% )
34 ( 8.2% )
14 ( 3.4% )
416 (89.8%) 47 (10.2%)
4 ethnicity [factor] Ethnicity
1. Akan
2. Ewe
3. Ga-Adangbe
4. Others
201 ( 45.2% )
71 ( 16.0% )
65 ( 14.6% )
108 ( 24.3% )
445 (96.1%) 18 (3.9%)
5 religion [factor] Religion
1. Christian
2. Islamic
3. Others
399 ( 89.1% )
41 ( 9.2% )
8 ( 1.8% )
448 (96.8%) 15 (3.2%)
6 dyslip [factor] Dyslipidemia
1. No
2. Yes
280 ( 60.5% )
183 ( 39.5% )
463 (100.0%) 0 (0.0%)
7 hpn [factor] Hypertension
1. No
2. Yes
87 ( 18.8% )
376 ( 81.2% )
463 (100.0%) 0 (0.0%)
8 t2dm [factor] Type II DM
1. No
2. Yes
298 ( 64.4% )
165 ( 35.6% )
463 (100.0%) 0 (0.0%)
9 smoking [factor] Smoking
1. No
2. Yes
405 ( 87.5% )
58 ( 12.5% )
463 (100.0%) 0 (0.0%)
10 obesity [factor] Obesity
1. No
2. Yes
343 ( 74.1% )
120 ( 25.9% )
463 (100.0%) 0 (0.0%)
11 alcohol [factor] Alcohol
1. No
2. Yes
393 ( 84.9% )
70 ( 15.1% )
463 (100.0%) 0 (0.0%)
12 presentation [character] Presentation
1. ACS
2. CCS
3. Heart Failure
4. Pre-op
5. VHD
83 ( 17.9% )
334 ( 72.1% )
40 ( 8.6% )
5 ( 1.1% )
1 ( 0.2% )
463 (100.0%) 0 (0.0%)
13 coronary_anatomy [character] Coronary Dominance
1. Co-dominance
2. Lt Dominance
3. Not documented
4. Rt Dominance
15 ( 3.3% )
46 ( 10.2% )
273 ( 60.5% )
117 ( 25.9% )
451 (97.4%) 12 (2.6%)
14 lm_dx [character]
1. Mild
2. Normal
3. Severe
27 ( 5.8% )
396 ( 85.7% )
39 ( 8.4% )
462 (99.8%) 1 (0.2%)
15 rca_dx [factor]
1. Normal
2. Mild
3. Moderate
4. Severe
250 ( 55.2% )
56 ( 12.4% )
9 ( 2.0% )
138 ( 30.5% )
453 (97.8%) 10 (2.2%)
16 lcx_dx [factor]
1. Normal
2. Mild
3. Moderate
4. Severe
240 ( 53.5% )
50 ( 11.1% )
29 ( 6.5% )
130 ( 29.0% )
449 (97.0%) 14 (3.0%)
17 lad_dx [factor]
1. Normal
2. Mild
3. Moderate
4. Severe
171 ( 38.1% )
53 ( 11.8% )
40 ( 8.9% )
185 ( 41.2% )
449 (97.0%) 14 (3.0%)
18 lm_severe_dxs [numeric]
Min : 0
Mean : 0.1
Max : 1
0 : 423 ( 91.6% )
1 : 39 ( 8.4% )
462 (99.8%) 1 (0.2%)
19 lad_severe_dxs [numeric]
Min : 0
Mean : 0.4
Max : 1
0 : 264 ( 58.8% )
1 : 185 ( 41.2% )
449 (97.0%) 14 (3.0%)
20 lcx_severe_dxs [numeric]
Min : 0
Mean : 0.3
Max : 1
0 : 319 ( 71.0% )
1 : 130 ( 29.0% )
449 (97.0%) 14 (3.0%)
21 rca_severe_dxs [numeric]
Min : 0
Mean : 0.3
Max : 1
0 : 315 ( 69.5% )
1 : 138 ( 30.5% )
453 (97.8%) 10 (2.2%)
22 severe_dxs [character] Severe Disease
1. No
2. Yes
201 ( 44.8% )
248 ( 55.2% )
449 (97.0%) 14 (3.0%)
23 n_severe_dxs [integer] Number of Severe Disease
Mean (sd) : 1.1 (1.2)
min ≤ med ≤ max:
0 ≤ 1 ≤ 4
IQR (CV) : 2 (1.1)
0 : 201 ( 46.4% )
1 : 89 ( 20.6% )
2 : 69 ( 15.9% )
3 : 58 ( 13.4% )
4 : 16 ( 3.7% )
433 (93.5%) 30 (6.5%)
24 type_of_lesion [factor] Type of Coronary Lesion
1. Normal
2. MNOD
3. 1VD
4. 2VD
5. 3VD
6. LMD
127 ( 27.5% )
74 ( 16.0% )
90 ( 19.5% )
70 ( 15.2% )
70 ( 15.2% )
31 ( 6.7% )
462 (99.8%) 1 (0.2%)

Generated by summarytools 1.0.1 (R version 4.4.2)
2025-03-19

Table 1: Demofgrpahics agianst presence of severe disease

Code
table_1 <- 
    df_cathlab %>%
    gtsummary::tbl_summary(
        include = c(
            sex, ageyrs, marital_status, ethnicity, religion, 
            dyslip, hpn, t2dm, smoking, obesity, alcohol,presentation,
            coronary_anatomy, type_of_lesion, severe_dxs),
        by = severe_dxs,
        digits = gtsummary::all_categorical()~ c(0, 1),
        statistic = gtsummary::all_categorical() ~ "{n}({p})",
        missing = "no") %>%
    gtsummary::bold_labels() %>%
    
    gtsummary::modify_spanning_header(
        gtsummary::all_stat_cols() ~ "**Severe Disease**") %>%
    gtsummary::add_overall(last = T) %>%
    gtsummary::add_p(pvalue_fun = ~ gtsummary::style_pvalue(.x, digits = 3)) %>% 
    gtsummary::bold_p() %>% 
    gtsummary::modify_caption(
        caption = "**Table 1**: Demographic Charateristics of patients")
14 missing rows in the "severe_dxs" column have been removed.
Code
table_1 
Table 1: Demographic Charateristics of patients
Characteristic
Severe Disease
Overall
N = 4491
p-value2
No
N = 2011
Yes
N = 2481
Sex of Patient


0.032
    Female 58(28.9) 50(20.2) 108(24.1)
    Male 143(71.1) 198(79.8) 341(75.9)
Age (years) 59 (51, 68) 60 (53, 67) 60 (52, 67) 0.292
Marital Status


0.696
    Divorced 5(2.7) 4(1.8) 9(2.2)
    Married 158(84.9) 191(88.0) 349(86.6)
    Single 17(9.1) 14(6.5) 31(7.7)
    Widowed 6(3.2) 8(3.7) 14(3.5)
Ethnicity


0.135
    Akan 101(51.0) 94(40.0) 195(45.0)
    Ewe 30(15.2) 39(16.6) 69(15.9)
    Ga-Adangbe 25(12.6) 39(16.6) 64(14.8)
    Others 42(21.2) 63(26.8) 105(24.2)
Religion


0.200
    Christian 181(92.3) 208(87.0) 389(89.4)
    Islamic 12(6.1) 26(10.9) 38(8.7)
    Others 3(1.5) 5(2.1) 8(1.8)
Dyslipidemia 69(34.3) 107(43.1) 176(39.2) 0.057
Hypertension 162(80.6) 203(81.9) 365(81.3) 0.734
Type II DM 63(31.3) 98(39.5) 161(35.9) 0.073
Smoking 20(10.0) 36(14.5) 56(12.5) 0.145
Obesity 57(28.4) 57(23.0) 114(25.4) 0.193
Alcohol 30(14.9) 37(14.9) 67(14.9) 0.999
Presentation


<0.001
    ACS 17(8.5) 65(26.2) 82(18.3)
    CCS 154(76.6) 167(67.3) 321(71.5)
    Heart Failure 24(11.9) 16(6.5) 40(8.9)
    Pre-op 5(2.5) 0(0.0) 5(1.1)
    VHD 1(0.5) 0(0.0) 1(0.2)
Coronary Dominance


<0.001
    Co-dominance 8(4.1) 6(2.5) 14(3.2)
    Lt Dominance 27(13.7) 19(7.9) 46(10.5)
    Not documented 89(45.2) 175(72.6) 264(60.3)
    Rt Dominance 73(37.1) 41(17.0) 114(26.0)
Type of Coronary Lesion


<0.001
    Normal 123(61.2) 1(0.4) 124(27.6)
    MNOD 68(33.8) 0(0.0) 68(15.1)
    1VD 8(4.0) 78(31.5) 86(19.2)
    2VD 1(0.5) 69(27.8) 70(15.6)
    3VD 1(0.5) 69(27.8) 70(15.6)
    LMD 0(0.0) 31(12.5) 31(6.9)
1 n(%); Median (Q1, Q3)
2 Pearson’s Chi-squared test; Wilcoxon rank sum test; Fisher’s exact test
Code
file.remove("table_1.docx")
[1] TRUE
Code
table_1 %>% 
    gtsummary::as_gt() %>% 
    gt::gtsave(filename = "table_1.docx")

Distribution of Coronary Artery Diseases

Code
data2 <-
    df_cathlab %>% 
    select(lm_dx, lad_dx, lcx_dx, rca_dx) %>% 
    drop_na()

data2 %>% 
    pivot_longer(cols = c(lm_dx, lad_dx, lcx_dx, rca_dx)) %>% 
    mutate(
        name = case_when(
            name == "lm_dx" ~ "Left Main",
            name == "lad_dx" ~ "Left Anterior Descending", 
            name == "lcx_dx" ~ "Left Circumflex",
            name == "rca_dx" ~ "Right Coronary Artery")) %>% 
    group_by(name, value) %>% 
    count() %>% 
    ggplot(
        aes(
            x = name, 
            y = n, 
            label = n,
            fill = factor(
                value, 
                levels = c("Normal","Mild","Moderate", "Severe")))) +
    geom_col(position = position_dodge(.9)) +
    geom_text(position = position_dodge(0.9), vjust=-0.3)+
    labs(fill = "Disease Severity", y = "Frequency", x = NULL) +
    theme_light()+
    scale_fill_brewer(palette = "Set2")+
    theme(
        legend.position = "top",
        axis.title = element_text(face = "bold"),
        axis.text.x = element_text(face = "bold"))

Relationship between the various Coronary artery diseases

Logistitic regression

Code
data <-
    df_cathlab %>% 
    select(lm_severe_dxs, lad_severe_dxs, lcx_severe_dxs, rca_severe_dxs) %>% 
    drop_na()

lm_lcx <- 
    glm(lm_severe_dxs ~ lcx_severe_dxs, family=binomial, data = data) %>% 
    broom::tidy(conf.int=T, exponentiate = T)

lm_lad <- 
    glm(lm_severe_dxs ~ lad_severe_dxs, family=binomial, data = data) %>% 
    broom::tidy(conf.int=T, exponentiate = T)

lm_rca <- 
    glm(lm_severe_dxs ~ rca_severe_dxs, family=binomial, data = data) %>% 
    broom::tidy(conf.int=T, exponentiate = T)

lad_lcx <- 
    glm(lad_severe_dxs ~ lcx_severe_dxs, family=binomial, data = data) %>% 
    broom::tidy(conf.int=T, exponentiate = T)

lad_rca <- 
    glm(lad_severe_dxs ~ rca_severe_dxs, family=binomial, data = data) %>% 
    broom::tidy(conf.int=T, exponentiate = T)

lcx_rca <- 
    glm(lcx_severe_dxs ~ rca_severe_dxs, family=binomial, data = data) %>% 
    broom::tidy(conf.int=T, exponentiate = T)

bind_rows(lm_lcx, lm_lad, lm_rca, lad_lcx, lad_rca, lcx_rca) %>% 
    filter(term != "(Intercept)") %>% 
    mutate(Vessels = c("LM - LCX", "LM - LAD", "LM - RCA", "LAD - LCX", "LAD - RCA", "LCX - RCA")) %>% 
    rstatix::adjust_pvalue() %>% 
    select(Vessels, OR = estimate, conf.low, conf.high, p.value.adj) %>% 
    mutate(`OR (95%CI)` = paste(round(OR, 2), "(", round(conf.low, 2), " - ", round(conf.high, 2), ")")) %>% 
    rstatix::p_format() %>% 
    select(Vessels, `OR (95%CI)`, p.value.adj) %>% 
    gt::gt()
Vessels OR (95%CI) p.value.adj
LM - LCX 8.61 ( 4.04 - 20.02 ) <0.0001
LM - LAD 8.25 ( 3.58 - 22.44 ) <0.0001
LM - RCA 6.17 ( 2.99 - 13.52 ) <0.0001
LAD - LCX 8.06 ( 5.07 - 13.11 ) <0.0001
LAD - RCA 7.52 ( 4.76 - 12.12 ) <0.0001
LCX - RCA 5.98 ( 3.8 - 9.49 ) <0.0001

Correlation matrix

Code
data %>% 
    rstatix::cor_mat(method = 'spearman') %>% 
    gt::gt()
lm_severe_dxs lad_severe_dxs lcx_severe_dxs rca_severe_dxs
lm_severe_dxs 1.00 0.25 0.30 0.25
lad_severe_dxs 0.25 1.00 0.44 0.43
lcx_severe_dxs 0.30 0.44 1.00 0.39
rca_severe_dxs 0.25 0.43 0.39 1.00

correlation plot

Code
data <- 
    data %>% 
        rename(LM = lm_severe_dxs, LAD = lad_severe_dxs, LCX = lcx_severe_dxs, RCA = rca_severe_dxs) 

GGally::ggcorr(
    data = data, 
    method = c("pairwise", "spearman"), label = T, label_round = 3)
Registered S3 method overwritten by 'GGally':
  method from   
  +.gg   ggplot2

Ordinal regression showing association between factors and number of severe diseases

Code
df_cathlab_new <- 
    df_cathlab_new %>% 
    mutate(n_severe_dxs = factor(n_severe_dxs, ordered = T))

gtsummary::tbl_uvregression(
    df_cathlab_new,
    include = c(
        sex, ageyrs, marital_status, ethnicity, religion, 
        dyslip, hpn, t2dm, smoking, obesity, alcohol,presentation,
        coronary_anatomy, type_of_lesion, n_severe_dxs),
    method = ordinal::clm,
    y = n_severe_dxs,
    exponentiate = TRUE,
    pvalue_fun = ~ gtsummary::style_pvalue(.x, digits = 3),
    add_estimate_to_reference_rows = TRUE,
    hide_n = TRUE,
    tidy_fun = function(x, ...) broom::tidy(x, ..., p.values = TRUE)
    ) %>%
    gtsummary::bold_labels() %>% 
    gtsummary::bold_p()
Characteristic OR1 95% CI1 p-value
Sex of Patient


    Female 1.00
    Male 1.58 0.87, 2.91 0.134
Age (years) 1.04 1.02, 1.07 <0.001
Marital Status


    Divorced 1.00
    Married 1.46 0.29, 7.95 0.643
    Single 0.34 0.05, 2.49 0.279
    Widowed 0.70 0.08, 6.17 0.747
Ethnicity


    Akan 1.00
    Ewe 0.55 0.27, 1.12 0.105
    Ga-Adangbe 1.37 0.68, 2.77 0.373
    Others 0.65 0.35, 1.19 0.162
Religion


    Christian 1.00
    Islamic 1.37 0.64, 2.93 0.410
    Others 0.74 0.14, 3.51 0.702
Dyslipidemia


    No 1.00
    Yes 1.53 0.95, 2.47 0.078
Hypertension


    No 1.00
    Yes 2.42 1.29, 4.66 0.007
Type II DM


    No 1.00
    Yes 1.43 0.89, 2.32 0.144
Smoking


    No 1.00
    Yes 0.49 0.24, 0.99 0.050
Obesity


    No 1.00
    Yes 1.10 0.64, 1.89 0.718
Alcohol


    No 1.00
    Yes 1.17 0.59, 2.33 0.654
Presentation


    ACS 1.00
    CCS 2.42 1.41, 4.21 0.002
    Heart Failure 1.70 0.59, 4.84 0.317
Coronary Dominance


    Co-dominance 1.00
    Lt Dominance 2.29 0.40, 18.5 0.378
    Not documented 4.46 0.96, 31.6 0.077
    Rt Dominance 3.10 0.62, 23.0 0.199
Type of Coronary Lesion


    Normal 1.00
    1VD 0.00 0.00, 0.00 <0.001
    2VD 0.01 0.00, 0.63 0.031
    3VD 0.43 0.01, 21.0 0.673
    LMD 4.61 0.09, 249 0.450
1 OR = Odds Ratio, CI = Confidence Interval