Papre 21: 12 Month BP Control

Author

Dr Solomon Gyabaah

Published

September 21, 2026


Note
  • Everyone was hypertensive at baseline so that is not included in the tables
  • Only 39 participants are current alcohol users. Should we still use that criteria?

Importing Data

Show the code
df_pings2_bp <- 
    dget("Data/pings_2_data_with_bps_ready")

df_baseline <- 
    dget("Data/df_for_papers") %>% 
    labelled::unlabelled() %>% 
    mutate(
        d_st_type = as.character(d_st_type),
        d_st_type = case_when(
            d_st_type == "Ischemic With Hemorrhagic Transformation" ~ 
            "Ischemic Stroke", 
            is.na(d_st_type) ~ "Untyped Stroke (no CT scan available)",
            TRUE ~ d_st_type)) |> 
    labelled::set_variable_labels(
            d_st_type = "Stroke Type")

df_antihypt <- 
    df_pings2_bp |> 
    filter(eventname == "Baseline") |> 
    select(
        pid, h_antihpt, h_ccb, h_acei, h_arb, h_bb, 
        h_alpha_md, h_diuretics, h_alpha_ab, h_antiplt, 
        h_statins)

df_drugs_temp <- 
  readxl::read_xlsx(
      "Data/drugs_data_clean_10122025.xlsx", sheet = 1) 

df_max_drug_doses_temp <- 
  readxl::read_xlsx(
      "Data/PINGS_Antihypertensive Maximum doses.xlsx", sheet = 2)

Data manipulation

Show the code
df_sbp <- 
    df_pings2_bp |> # labelled::look_for("acei")
    select(sbp, dbp, pid, eventname) |> 
    mutate(
        mth = parse_number(eventname),
        mth = case_when(
            eventname == "Baseline" ~ 0, 
            TRUE ~ mth)) |> 
    pivot_wider(
        id_cols = pid, 
        values_from = sbp, 
        names_from = mth, 
        names_prefix = "sbp_m_") |> 
    drop_na()

df_dbp <- 
    df_pings2_bp |> # labelled::look_for("acei")
    select(sbp, dbp, pid, eventname) |> 
    mutate(
        mth = parse_number(eventname),
        mth = case_when(
            eventname == "Baseline" ~ 0, 
            TRUE ~ mth)) |> 
    pivot_wider(
        id_cols = pid, 
        values_from = dbp, 
        names_from = mth, 
        names_prefix = "dbp_m_") |> 
    drop_na()

df_drugs <-  
    df_drugs_temp %>% 
    left_join(df_max_drug_doses_temp, by = "drug") %>%
    mutate(
        dose_index = freq_number*dose_number/maxi,
        antihpt  = case_when(is.na(antihpt) ~ 0, TRUE ~ antihpt)) %>% 
    filter(antihpt == 1) %>% 
    group_by(pid, eventname, arm) %>% 
    summarize(
      n_hpts = sum(antihpt), 
      dose_index = sum(dose_index)) %>% 
    ungroup() |> 
    filter(eventname == "Baseline") |> 
    select(pid, dose_index)

df_paper_20 <- 
    df_pings2_bp |> # labelled::look_for("acei")
    select(sbp, dbp, pid, eventname) |> 
    mutate(
        sbp_high = sbp >= 140, 
        dbp_high = dbp >= 90, 
        hpt = sbp_high | dbp_high, 
        mth = parse_number(eventname),
        mth = case_when(
            eventname == "Baseline" ~ 0, 
            TRUE ~ mth)) |> 
    select(pid, mth, hpt) |> 
    arrange(pid, mth) |> 
    pivot_wider(
        id_cols = pid, 
        values_from = hpt, 
        names_from = mth, 
        names_prefix = "m_") |> 
    drop_na() |> 
    mutate(
        m_0 = case_when(m_0 == FALSE ~ TRUE, TRUE ~ m_0),
        total_1 = rowSums(across(c(m_0:m_12))),
        hpt_class = case_when(
             total_1 == 1 ~ "Early",
             total_1 == 6 ~ "Persistent", 
             total_1 == 5 & m_12 == FALSE ~ "Late", 
             total_1 == 5 ~ "Fluctuating", 
             total_1 == 4 & m_9 == FALSE & m_12 == FALSE~ "Late",
             m_0 & m_1 & m_3 == FALSE & m_6 == FALSE & m_9 == FALSE & 
                 m_12 == FALSE~ "Early", 
             m_0 & m_1 & m_3 & m_6 == FALSE & m_9 == FALSE & m_12 == FALSE~ "Early", 
             m_0 & m_1 & m_3 & m_6 & m_9 == FALSE & m_12 == FALSE~ "Late",
             m_0 & m_1 & m_3 & m_6 & m_9 & m_12 == FALSE~ "Late", 
             m_0 & m_1 & m_3 & m_6 == FALSE & m_9 & m_12 == FALSE~ "Fluctuating", 
             m_0 & m_1 & m_3 & m_6 == FALSE & m_9 == FALSE & m_12 ~ "Fluctuating",
             m_0 & m_1 & m_3 == FALSE & m_6 & m_9 & m_12 == FALSE~ "Fluctuating", 
             total_1 == 4 & m_9 == FALSE & m_12 ~ "Fluctuating", 
             total_1 == 4 & m_9 & m_12 == FALSE~ "Fluctuating", 
             total_1 == 4 ~ "Fluctuating", 
             total_1 == 3 ~ "Fluctuating", 
             total_1 == 2 ~ "Fluctuating")) |> 
    left_join(df_baseline) |> 
    left_join(df_antihypt) |> 
    left_join(df_sbp) |> 
    left_join(df_dbp) |>
    left_join(df_drugs) |> 
    mutate(
        no_of_hpts = 
            (h_acei == "Checked") + (h_arb == "Checked") + 
            (h_bb == "Checked") + (h_ccb == "Checked") + 
            (h_diuretics  == "Checked") + (h_alpha_md  == "Checked") + 
            (h_alpha_ab == "Checked"),
        arm = case_when(
            arm == "Arm 1- Intervention Arm" ~ "Intervention", 
            arm == "Arm 2- Routine Care" ~ "Routine"),
        alcohol_curr = case_when(
            g_alcohol == "Currently uses alcohol" ~ "Yes",
            g_alcohol %in% c(
                "Never used alcohol", 
                "Past 12 months", 
                "Past 30 days", 
                "Formerly used alcohol", 
                "Stopped after the stroke occured") ~ "No"))



df_ready <- 
    df_paper_20 |> 
    select(
        hpt_class, a_agebase, a_gender, educ, maristat, arm, income,    
        a_religion, d_stroke_ct, d_st_type, nihss_scale, ranking, 
        dm, hyperlipidemia, tobacco_use, bmi, waist_hip_ratio, 
        alcohol_curr, ff_hba1c_0, ff_creat_0, ee_sbp_0, ee_dbp_0, h_acei, 
        h_arb, h_bb, h_ccb, h_diuretics, h_alpha_md, h_alpha_ab, 
        no_of_hpts, h_antiplt, h_statins, hillbone, aa_hkq, eq_5d, 
        hosp_cat, dose_index)

Labelling data

Show the code
df_ready <- 
    df_ready |> 
    labelled::set_variable_labels(
            h_arb = "Angiotensin Receptor Blocker",
            h_acei = "ACE-Inhibitors",
            h_alpha_md = "Alpha Methyl Dopa",
            h_bb = "Beta blockers",
            h_ccb = "Calcium Channel Blocker",
            h_diuretics = "Diuretics",
            h_alpha_ab = "Alpha Adrenergic Blockers", 
            no_of_hpts = "No. of Antihypertensives", 
            h_antiplt = "Antiplatelet", 
            h_statins = "Statins",
            dose_index = "Antihypertensive treatment intensity",
            eq_5d = "Health Related QoL",)

Table 0

Show the code
gtsummary::theme_gtsummary_compact()
Setting theme "Compact"
Show the code
gtsummary::theme_gtsummary_eda()
Setting theme "Exploratory Data Analysis"
Show the code
df_ready |> # labelled::look_for("alc")
    gtsummary::tbl_summary(missing_text = "Missing") |> 
    gtsummary::bold_labels()
Characteristic N = 3651
hpt_class
    Early 64 (17.5%)
    Fluctuating 171 (46.8%)
    Late 43 (11.8%)
    Persistent 87 (23.8%)
Age in years
    Median (Q1, Q3) 58 (50, 67)
    Mean (SD) 58 (11)
    Min, Max 29, 86
Gender
    Male 207 (56.7%)
    Female 158 (43.3%)
Educational Status
    None 31 (8.49%)
    Primary 152 (41.6%)
    Secondary 117 (32.1%)
    Tertiary 65 (17.8%)
Marital Status
    Currently Married 244 (66.8%)
    Previously Married 101 (27.7%)
    Never Married 20 (5.48%)
arm
    Intervention 181 (49.6%)
    Routine 184 (50.4%)
Income in GHC
    0-100 130 (35.8%)
    101-250 113 (31.1%)
    251-500 81 (22.3%)
    >500 39 (10.7%)
    Missing 2
Religion
    Christianity 332 (91.0%)
    Islam 31 (8.49%)
    Other 2 (0.55%)
Stroke Subtype ( with results of Brain CT scan)
    Ischaemic 237 (73.8%)
    Haemorrhage infarct 10 (3.12%)
    Haemorrhagic 66 (20.6%)
    Ischaemic and Haemorrhagic 8 (2.49%)
    Missing 44
Stroke Type
    Intracerebral Hemorrhagic Stroke 76 (20.8%)
    Ischemic Stroke 260 (71.2%)
    Untyped Stroke (no CT scan available) 29 (7.95%)
NIH Stroke Scale
    Median (Q1, Q3) 2.0 (0.0, 7.0)
    Mean (SD) 4.3 (4.9)
    Min, Max 0.0, 23.0
    Missing 4
Modified Ranking Score
    0 26 (7.12%)
    1 84 (23.0%)
    2 117 (32.1%)
    3 72 (19.7%)
    4 65 (17.8%)
    5 1 (0.27%)
Diabetes Mellitus 123 (33.7%)
Hyperlipidemia 120 (32.9%)
History of tobacco use 25 (7.00%)
    Missing 8
Body Mass Index
    Median (Q1, Q3) 26.0 (22.7, 30.0)
    Mean (SD) 26.6 (5.5)
    Min, Max 11.4, 47.9
    Missing 8
Waist-Hip Ratio
    Median (Q1, Q3) 0.93 (0.89, 0.96)
    Mean (SD) 1.17 (4.63)
    Min, Max 0.09, 88.30
    Missing 8
alcohol_curr 39 (10.7%)
HBA1C (Baseline)
    Median (Q1, Q3) 5.80 (5.40, 6.70)
    Mean (SD) 6.44 (2.03)
    Min, Max 3.00, 16.10
    Missing 69
Serum Creatinine (mmol/L)
    Median (Q1, Q3) 87 (71, 104)
    Mean (SD) 94 (37)
    Min, Max 11, 266
    Missing 43
Systolic blood pressure (mm Hg)-Baseline
    Median (Q1, Q3) 155 (148, 170)
    Mean (SD) 161 (19)
    Min, Max 114, 263
Diastolic Blood Pressure
    Median (Q1, Q3) 95 (88, 105)
    Mean (SD) 97 (14)
    Min, Max 64, 150
ACE-Inhibitors
    Unchecked 336 (92.1%)
    Checked 29 (7.95%)
Angiotensin Receptor Blocker
    Unchecked 332 (91.0%)
    Checked 33 (9.04%)
Beta blockers
    Unchecked 351 (96.2%)
    Checked 14 (3.84%)
Calcium Channel Blocker
    Unchecked 203 (55.6%)
    Checked 162 (44.4%)
Diuretics
    Unchecked 350 (95.9%)
    Checked 15 (4.11%)
Alpha Methyl Dopa
    Unchecked 348 (95.3%)
    Checked 17 (4.66%)
Alpha Adrenergic Blockers
    Unchecked 360 (98.6%)
    Checked 5 (1.37%)
No. of Antihypertensives
    0 175 (47.9%)
    1 121 (33.2%)
    2 56 (15.3%)
    3 12 (3.29%)
    6 1 (0.27%)
Antiplatelet 48 (14.0%)
    Missing 21
Statins 35 (10.4%)
    Missing 29
Total Hillbone Score
    Median (Q1, Q3) 53.0 (50.0, 53.0)
    Mean (SD) 51.4 (3.7)
    Min, Max 30.0, 56.0
    Missing 6
Total HKQ Score
    Median (Q1, Q3) 9 (6, 10)
    Mean (SD) 8 (3)
    Min, Max 0, 13
    Missing 15
Health Related QoL
    Median (Q1, Q3) 10.00 (8.00, 11.00)
    Mean (SD) 9.71 (1.94)
    Min, Max 6.00, 15.00
    Missing 144
Health institution category
    Primary 112 (30.7%)
    Secondary 81 (22.2%)
    Tertiary 172 (47.1%)
Antihypertensive treatment intensity
    Median (Q1, Q3) 1.44 (0.83, 1.92)
    Mean (SD) 1.48 (0.79)
    Min, Max 0.06, 4.50
    Missing 43
1 n (%)

Table 1

Show the code
gtsummary::reset_gtsummary_theme()
gtsummary::theme_gtsummary_compact()
Setting theme "Compact"
Show the code
df_ready |> 
    gtsummary::tbl_summary(
        by = hpt_class, 
        digits = gtsummary::all_categorical()~ c(0,1),
        statistic = gtsummary::all_categorical() ~ "{n} ({p})",
        missing = "ifany", 
        type = list(ranking ~ "continuous", no_of_hpts ~ "continuous")) |> 
    gtsummary::add_overall(last = TRUE) |> 
    gtsummary::bold_labels() |> 
    gtsummary::modify_spanning_header(
    gtsummary::all_stat_cols() ~ "**Hypertension Trajectories**") |>
    gtsummary::modify_caption("Table 1") %>% 
    gtsummary::add_p(
        pvalue_fun = ~ gtsummary::style_pvalue(.x, digits = 3), 
        test = list(
            gtsummary::all_categorical() ~ "fisher.test"), 
        test.args = list(
            gtsummary::all_categorical() ~ list(
                simulate.p.value = TRUE, B = 10000)))
Table 1
Characteristic
Hypertension Trajectories
p-value2
Early
N = 641
Fluctuating
N = 1711
Late
N = 431
Persistent
N = 871
Overall
N = 3651
Age in years 59 (52, 70) 58 (51, 67) 59 (55, 65) 56 (48, 65) 58 (50, 67) 0.410
Gender




0.750
    Male 38 (59.4) 100 (58.5) 22 (51.2) 47 (54.0) 207 (56.7)
    Female 26 (40.6) 71 (41.5) 21 (48.8) 40 (46.0) 158 (43.3)
Educational Status




0.419
    None 4 (6.3) 18 (10.5) 4 (9.3) 5 (5.7) 31 (8.5)
    Primary 28 (43.8) 66 (38.6) 18 (41.9) 40 (46.0) 152 (41.6)
    Secondary 19 (29.7) 57 (33.3) 18 (41.9) 23 (26.4) 117 (32.1)
    Tertiary 13 (20.3) 30 (17.5) 3 (7.0) 19 (21.8) 65 (17.8)
Marital Status




0.364
    Currently Married 49 (76.6) 113 (66.1) 24 (55.8) 58 (66.7) 244 (66.8)
    Previously Married 13 (20.3) 50 (29.2) 15 (34.9) 23 (26.4) 101 (27.7)
    Never Married 2 (3.1) 8 (4.7) 4 (9.3) 6 (6.9) 20 (5.5)
arm




<0.001
    Intervention 42 (65.6) 74 (43.3) 29 (67.4) 36 (41.4) 181 (49.6)
    Routine 22 (34.4) 97 (56.7) 14 (32.6) 51 (58.6) 184 (50.4)
Income in GHC




0.392
    0-100 28 (44.4) 52 (30.6) 14 (32.6) 36 (41.4) 130 (35.8)
    101-250 14 (22.2) 56 (32.9) 18 (41.9) 25 (28.7) 113 (31.1)
    251-500 14 (22.2) 40 (23.5) 9 (20.9) 18 (20.7) 81 (22.3)
    >500 7 (11.1) 22 (12.9) 2 (4.7) 8 (9.2) 39 (10.7)
    Unknown 1 1 0 0 2
Religion




0.422
    Christianity 58 (90.6) 157 (91.8) 36 (83.7) 81 (93.1) 332 (91.0)
    Islam 5 (7.8) 13 (7.6) 7 (16.3) 6 (6.9) 31 (8.5)
    Other 1 (1.6) 1 (0.6) 0 (0.0) 0 (0.0) 2 (0.5)
Stroke Subtype ( with results of Brain CT scan)




0.746
    Ischaemic 38 (67.9) 108 (73.5) 32 (82.1) 59 (74.7) 237 (73.8)
    Haemorrhage infarct 4 (7.1) 5 (3.4) 0 (0.0) 1 (1.3) 10 (3.1)
    Haemorrhagic 12 (21.4) 30 (20.4) 7 (17.9) 17 (21.5) 66 (20.6)
    Ischaemic and Haemorrhagic 2 (3.6) 4 (2.7) 0 (0.0) 2 (2.5) 8 (2.5)
    Unknown 8 24 4 8 44
Stroke Type




0.871
    Intracerebral Hemorrhagic Stroke 17 (26.6) 35 (20.5) 8 (18.6) 16 (18.4) 76 (20.8)
    Ischemic Stroke 44 (68.8) 121 (70.8) 32 (74.4) 63 (72.4) 260 (71.2)
    Untyped Stroke (no CT scan available) 3 (4.7) 15 (8.8) 3 (7.0) 8 (9.2) 29 (7.9)
NIH Stroke Scale 4.5 (1.0, 8.0) 1.0 (0.0, 5.0) 4.0 (0.0, 9.0) 4.0 (0.0, 8.0) 2.0 (0.0, 7.0) 0.002
    Unknown 0 2 0 2 4
Modified Ranking Score 2.00 (1.00, 4.00) 2.00 (1.00, 3.00) 2.00 (1.00, 3.00) 2.00 (2.00, 3.00) 2.00 (1.00, 3.00) 0.149
Diabetes Mellitus 19 (29.7) 56 (32.7) 22 (51.2) 26 (29.9) 123 (33.7) 0.085
Hyperlipidemia 22 (34.4) 58 (33.9) 12 (27.9) 28 (32.2) 120 (32.9) 0.902
History of tobacco use 8 (12.5) 11 (6.7) 2 (4.7) 4 (4.7) 25 (7.0) 0.309
    Unknown 0 6 0 2 8
Body Mass Index 26.0 (22.9, 30.3) 25.8 (22.5, 29.1) 26.0 (24.1, 30.6) 26.2 (22.5, 30.3) 26.0 (22.7, 30.0) 0.825
    Unknown 2 4 2 0 8
Waist-Hip Ratio 0.93 (0.89, 0.95) 0.93 (0.89, 0.97) 0.93 (0.89, 0.98) 0.93 (0.87, 0.97) 0.93 (0.89, 0.96) 0.826
    Unknown 1 5 1 1 8
alcohol_curr 7 (10.9) 23 (13.5) 2 (4.7) 7 (8.0) 39 (10.7) 0.333
HBA1C (Baseline) 5.70 (5.40, 6.10) 5.90 (5.30, 6.80) 6.00 (5.40, 8.70) 5.75 (5.35, 6.30) 5.80 (5.40, 6.70) 0.164
    Unknown 7 41 6 15 69
Serum Creatinine (mmol/L) 88 (69, 106) 89 (73, 103) 90 (75, 97) 85 (68, 102) 87 (71, 104) 0.589
    Unknown 1 26 5 11 43
Systolic blood pressure (mm Hg)-Baseline 152 (145, 160) 154 (146, 168) 159 (152, 175) 164 (152, 180) 155 (148, 170) <0.001
Diastolic Blood Pressure 93 (86, 99) 95 (86, 102) 100 (89, 110) 98 (91, 108) 95 (88, 105) 0.006
ACE-Inhibitors




0.851
    Unchecked 59 (92.2) 156 (91.2) 39 (90.7) 82 (94.3) 336 (92.1)
    Checked 5 (7.8) 15 (8.8) 4 (9.3) 5 (5.7) 29 (7.9)
Angiotensin Receptor Blocker




0.764
    Unchecked 59 (92.2) 154 (90.1) 38 (88.4) 81 (93.1) 332 (91.0)
    Checked 5 (7.8) 17 (9.9) 5 (11.6) 6 (6.9) 33 (9.0)
Beta blockers




0.814
    Unchecked 62 (96.9) 165 (96.5) 42 (97.7) 82 (94.3) 351 (96.2)
    Checked 2 (3.1) 6 (3.5) 1 (2.3) 5 (5.7) 14 (3.8)
Calcium Channel Blocker




0.734
    Unchecked 33 (51.6) 93 (54.4) 26 (60.5) 51 (58.6) 203 (55.6)
    Checked 31 (48.4) 78 (45.6) 17 (39.5) 36 (41.4) 162 (44.4)
Diuretics




0.626
    Unchecked 63 (98.4) 163 (95.3) 42 (97.7) 82 (94.3) 350 (95.9)
    Checked 1 (1.6) 8 (4.7) 1 (2.3) 5 (5.7) 15 (4.1)
Alpha Methyl Dopa




0.133
    Unchecked 63 (98.4) 158 (92.4) 42 (97.7) 85 (97.7) 348 (95.3)
    Checked 1 (1.6) 13 (7.6) 1 (2.3) 2 (2.3) 17 (4.7)
Alpha Adrenergic Blockers




0.470
    Unchecked 63 (98.4) 167 (97.7) 43 (100.0) 87 (100.0) 360 (98.6)
    Checked 1 (1.6) 4 (2.3) 0 (0.0) 0 (0.0) 5 (1.4)
No. of Antihypertensives 1 (0, 1) 1 (0, 1) 0 (0, 1) 0 (0, 1) 1 (0, 1) 0.619
Antiplatelet 10 (16.1) 24 (14.6) 3 (8.1) 11 (13.6) 48 (14.0) 0.746
    Unknown 2 7 6 6 21
Statins 5 (8.1) 21 (13.4) 5 (13.9) 4 (4.9) 35 (10.4) 0.158
    Unknown 2 14 7 6 29
Total Hillbone Score 52.0 (50.0, 53.0) 53.0 (51.0, 53.0) 52.0 (48.0, 53.0) 53.0 (51.0, 53.0) 53.0 (50.0, 53.0) 0.483
    Unknown 1 3 0 2 6
Total HKQ Score 9 (7, 11) 9 (6, 10) 8 (7, 10) 8 (6, 10) 9 (6, 10) 0.495
    Unknown 3 7 2 3 15
Health Related QoL 10.00 (9.00, 12.00) 9.00 (8.00, 10.50) 10.00 (8.00, 10.00) 10.00 (9.00, 10.00) 10.00 (8.00, 11.00) 0.021
    Unknown 18 75 17 34 144
Health institution category




0.001
    Primary 20 (31.3) 36 (21.1) 22 (51.2) 34 (39.1) 112 (30.7)
    Secondary 19 (29.7) 41 (24.0) 5 (11.6) 16 (18.4) 81 (22.2)
    Tertiary 25 (39.1) 94 (55.0) 16 (37.2) 37 (42.5) 172 (47.1)
Antihypertensive treatment intensity 1.33 (0.83, 1.83) 1.50 (1.00, 2.10) 1.17 (0.83, 1.71) 1.33 (0.83, 1.75) 1.44 (0.83, 1.92) 0.128
    Unknown 10 22 3 8 43
1 Median (Q1, Q3); n (%)
2 Kruskal-Wallis rank sum test; Fisher’s Exact Test for Count Data with simulated p-value (based on 10000 replicates)

Figure 1

Show the code
df_paper_20 |> 
    select(pid, hpt_class, eventname, starts_with("sbp_m_")) |> 
    pivot_longer(cols = sbp_m_0:sbp_m_12) |> 
    group_by(hpt_class, name) %>% 
    reframe(across(value, ~epiDisplay::ci.numeric(.x))) %>% 
    unnest(value) |> 
    mutate(
        hpt_class = factor(
            hpt_class, 
            levels = c("Early", "Late", "Fluctuating", "Persistent")),
        Month = parse_number(name)) %>% 
    ggplot(
        aes(
            x = Month, 
            y = mean, 
            ymin = mean - se, 
            ymax = mean+ se,
            color = hpt_class)) +
    geom_errorbar(
        position = position_dodge2(width = 0.4),
        width = 0.2) +    
    geom_point(
        position = position_dodge2(width = 0.2),
        size = 3)+
    geom_line(aes(group = hpt_class)) +
    labs(
        x = "Month", 
        y = "Systolic Blood Pressure (mmHg)",
        color = NULL)+
    theme_bw()+
    scale_x_continuous(
        breaks = c(0, 1, 3, 6, 9, 12),
        labels = c(0, 1, 3, 6, 9, 12))

Figure 2 - Comparative graph

Show the code
df_paper_20 |> 
    select(pid, hpt_class, eventname, arm, starts_with("sbp_m_")) |> 
    pivot_longer(cols = sbp_m_0:sbp_m_12) |> 
    group_by(hpt_class, name, arm) %>% 
    reframe(across(value, ~epiDisplay::ci.numeric(.x))) %>% 
    unnest(value) |> 
    mutate(
        hpt_class = factor(
            hpt_class, 
            levels = c("Early", "Late", "Fluctuating", "Persistent")),
        Month = parse_number(name)) %>% 
    ggplot(
        aes(
            x = Month, 
            y = mean, 
            ymin = mean - se, 
            ymax = mean+ se,
            color = hpt_class)) +
    geom_errorbar(
        position = position_dodge2(width = 0.4),
        width = 0.2) +    
    geom_point(
        position = position_dodge2(width = 0.2),
        size = 3)+
    geom_line(aes(group = hpt_class)) +
    facet_wrap(vars(arm), nrow= 1) + 
    labs(
        x = "Month", 
        y = "Systolic Blood Pressure (mmHg)",
        color = NULL)+
    theme_bw()+
    scale_x_continuous(
        breaks = c(0, 1, 3, 6, 9, 12),
        labels = c(0, 1, 3, 6, 9, 12))+
    theme(legend.position = "bottom")

Table 2 - Early vrs Late

Show the code
df_ready |> 
    filter(hpt_class %in% c("Early", "Late")) %>%
    mutate(y_binary = ifelse(hpt_class == "Late", 1, 0)) |> 
    select(
        y_binary, arm, a_gender, ee_sbp_0, ee_dbp_0, 
        d_st_type, nihss_scale, dm, bmi, hyperlipidemia,
        tobacco_use, dose_index, no_of_hpts, hillbone, aa_hkq, eq_5d, 
        hosp_cat) |> 
    gtsummary::tbl_uvregression(
        method = glm,
        y = y_binary,
        method.args = list(family = poisson),
        exponentiate = TRUE, 
        pvalue_fun = function(x) style_pvalue(x, digits = 3)) |>
    gtsummary::bold_labels() |> 
    gtsummary::bold_p()
Characteristic N IRR 95% CI p-value
arm 107


    Intervention

    Routine
0.95 0.49, 1.77 0.880
Gender 107


    Male

    Female
1.22 0.67, 2.22 0.517
Systolic blood pressure (mm Hg)-Baseline 107 1.01 1.00, 1.03 0.084
Diastolic Blood Pressure 107 1.02 1.00, 1.04 0.042
Stroke Type 107


    Intracerebral Hemorrhagic Stroke

    Ischemic Stroke
1.32 0.64, 3.07 0.487
    Untyped Stroke (no CT scan available)
1.56 0.34, 5.40 0.510
NIH Stroke Scale 107 1.00 0.94, 1.06 0.994
Diabetes Mellitus 107


    No

    Yes
1.69 0.92, 3.08 0.087
Body Mass Index 103 1.01 0.95, 1.07 0.835
Hyperlipidemia 107


    No

    Yes
0.83 0.41, 1.58 0.586
History of tobacco use 107


    No

    Yes
0.47 0.08, 1.54 0.301
Antihypertensive treatment intensity 94 0.97 0.61, 1.48 0.906
No. of Antihypertensives 107 0.96 0.65, 1.37 0.833
Total Hillbone Score 106 0.97 0.90, 1.06 0.436
Total HKQ Score 102 0.97 0.88, 1.08 0.591
Health Related QoL 72 0.89 0.72, 1.08 0.262
Health institution category 107


    Primary

    Secondary
0.40 0.13, 0.97 0.063
    Tertiary
0.75 0.38, 1.41 0.370
Abbreviations: CI = Confidence Interval, IRR = Incidence Rate Ratio

Table 2 - Early vrs Fluctuating

Show the code
df_ready |> 
    filter(hpt_class %in% c("Early", "Fluctuating")) %>%
    mutate(y_binary = ifelse(hpt_class == "Fluctuating", 1, 0)) |> 
    select(
        y_binary, arm, a_gender, ee_sbp_0, ee_dbp_0, 
        d_st_type, nihss_scale, dm, bmi, hyperlipidemia,
        tobacco_use, dose_index, no_of_hpts, hillbone, aa_hkq, eq_5d, 
        hosp_cat) |> 
    gtsummary::tbl_uvregression(
        method = glm,
        y = y_binary,
        method.args = list(family = poisson),
        exponentiate = TRUE, 
        pvalue_fun = function(x) style_pvalue(x, digits = 3)) |>
    gtsummary::bold_labels() |> 
    gtsummary::bold_p()
Characteristic N IRR 95% CI p-value
arm 235


    Intervention

    Routine
1.28 0.95, 1.73 0.112
Gender 235


    Male

    Female
1.01 0.74, 1.37 0.948
Systolic blood pressure (mm Hg)-Baseline 235 1.00 0.99, 1.01 0.519
Diastolic Blood Pressure 235 1.00 0.99, 1.01 0.473
Stroke Type 235


    Intracerebral Hemorrhagic Stroke

    Ischemic Stroke
1.09 0.76, 1.61 0.655
    Untyped Stroke (no CT scan available)
1.24 0.66, 2.22 0.489
NIH Stroke Scale 233 0.97 0.94, 1.01 0.127
Diabetes Mellitus 235


    No

    Yes
1.04 0.75, 1.42 0.815
Body Mass Index 229 1.00 0.97, 1.03 0.970
Hyperlipidemia 235


    No

    Yes
0.99 0.72, 1.36 0.973
History of tobacco use 229


    No

    Yes
0.79 0.40, 1.39 0.449
Antihypertensive treatment intensity 203 1.10 0.90, 1.33 0.345
No. of Antihypertensives 235 1.03 0.88, 1.21 0.678
Total Hillbone Score 231 1.00 0.96, 1.05 0.851
Total HKQ Score 225 0.99 0.94, 1.04 0.558
Health Related QoL 142 0.91 0.82, 1.01 0.068
Health institution category 235


    Primary

    Secondary
1.06 0.68, 1.67 0.789
    Tertiary
1.23 0.85, 1.83 0.293
Abbreviations: CI = Confidence Interval, IRR = Incidence Rate Ratio

Table 2 - Early vrs Persistent

Show the code
df_ready |> 
    filter(hpt_class %in% c("Early", "Persistent")) %>%
    mutate(y_binary = ifelse(hpt_class == "Persistent", 1, 0)) |> 
    select(
        y_binary, arm, a_gender, ee_sbp_0, ee_dbp_0, 
        d_st_type, nihss_scale, dm, bmi, hyperlipidemia,
        tobacco_use, dose_index, no_of_hpts, hillbone, aa_hkq, eq_5d, 
        hosp_cat) |> 
    gtsummary::tbl_uvregression(
        method = glm,
        y = y_binary,
        method.args = list(family = poisson),
        exponentiate = TRUE, 
        pvalue_fun = function(x) style_pvalue(x, digits = 3)) |>
    gtsummary::bold_labels() |> 
    gtsummary::bold_p()
Characteristic N IRR 95% CI p-value
arm 151


    Intervention

    Routine
1.51 0.99, 2.34 0.057
Gender 151


    Male

    Female
1.10 0.72, 1.67 0.670
Systolic blood pressure (mm Hg)-Baseline 151 1.01 1.00, 1.02 0.028
Diastolic Blood Pressure 151 1.01 1.00, 1.03 0.036
Stroke Type 151


    Intracerebral Hemorrhagic Stroke

    Ischemic Stroke
1.21 0.72, 2.17 0.488
    Untyped Stroke (no CT scan available)
1.50 0.61, 3.41 0.349
NIH Stroke Scale 149 0.99 0.95, 1.04 0.766
Diabetes Mellitus 151


    No

    Yes
1.00 0.62, 1.57 0.986
Body Mass Index 149 1.01 0.97, 1.05 0.642
Hyperlipidemia 151


    No

    Yes
0.96 0.60, 1.49 0.854
History of tobacco use 149


    No

    Yes
0.56 0.17, 1.35 0.263
Antihypertensive treatment intensity 133 1.03 0.75, 1.40 0.860
No. of Antihypertensives 151 0.97 0.74, 1.25 0.844
Total Hillbone Score 148 1.00 0.95, 1.07 0.980
Total HKQ Score 145 0.97 0.90, 1.04 0.384
Health Related QoL 99 0.92 0.80, 1.06 0.258
Health institution category 151


    Primary

    Secondary
0.73 0.39, 1.29 0.291
    Tertiary
0.95 0.59, 1.52 0.822
Abbreviations: CI = Confidence Interval, IRR = Incidence Rate Ratio

Figure 3 - Sensitivity Analysis with Diastolic BP

Show the code
df_paper_20 |> 
    select(pid, hpt_class, eventname, starts_with("dbp_m_")) |> 
    pivot_longer(cols = dbp_m_0:dbp_m_12) |> 
    group_by(hpt_class, name) %>% 
    reframe(across(value, ~epiDisplay::ci.numeric(.x))) %>% 
    unnest(value) |> 
    mutate(
        hpt_class = factor(
            hpt_class, 
            levels = c("Early", "Late", "Fluctuating", "Persistent")),
        Month = parse_number(name)) %>% 
    ggplot(
        aes(
            x = Month, 
            y = mean, 
            ymin = mean - se, 
            ymax = mean+ se,
            color = hpt_class)) +
    geom_errorbar(
        position = position_dodge2(width = 0.4),
        width = 0.2) +    
    geom_point(
        position = position_dodge2(width = 0.2),
        size = 3)+
    geom_line(aes(group = hpt_class)) +
    labs(
        x = "Month", 
        y = "Diastolic Blood Pressure (mmHg)",
        color = NULL)+
    theme_bw()+
    scale_x_continuous(
        breaks = c(0, 1, 3, 6, 9, 12),
        labels = c(0, 1, 3, 6, 9, 12))