CRISP Grant Application

Author
Affiliation

Kwame Nkrumah University of Science & Technology

Published

October 27, 2024

Reading the data

Show the code
library(tidyverse)

df_crisp_m0 <- 
    readxl::read_xlsx(
        "CONTROLLINGRESISTANT_DATA_2024-NEW FINAL.xlsx", 
        sheet = "m0") %>% 
    janitor::clean_names()%>% 
    select(
        record_id, age_years, gender_mf, treatment_arm,
        sbp_m0 = i_blood_pressure_1systolic, 
        dbp_m0 = i_blood_pressure_1diastolic)

df_crisp_m1 <- 
    readxl::read_xlsx(
        "CONTROLLINGRESISTANT_DATA_2024-NEW FINAL.xlsx", 
        sheet = "m1") %>% 
    janitor::clean_names() %>% 
    select(
        record_id, 
        sbp_m1 = i_blood_pressure_1systolic, 
        dbp_m1 = i_blood_pressure_1diastolic)

df_crisp_m3 <- 
    readxl::read_xlsx(
        "CONTROLLINGRESISTANT_DATA_2024-NEW FINAL.xlsx", 
        sheet = "m3") %>% 
    janitor::clean_names() %>% 
    select(
        record_id, 
        sbp_m3 = i_blood_pressure_1systolic, 
        dbp_m3 = i_blood_pressure_1diastolic)


df_crisp_m6 <- 
    readxl::read_xlsx(
        "CONTROLLINGRESISTANT_DATA_2024-NEW FINAL.xlsx", 
        sheet = "m6") %>% 
    janitor::clean_names() %>% 
    select(
        record_id, 
        sbp_m6 = i_blood_pressure_1systolic, 
        dbp_m6 = i_blood_pressure_1diastolic)

df_crisp <- 
    df_crisp_m0 %>% 
    full_join(df_crisp_m1) %>% 
    full_join(df_crisp_m3) %>% 
    full_join(df_crisp_m6) %>% 
    filter(record_id != 4) %>% 
    mutate(
        gender_mf = factor(gender_mf),
        treatment_arm = factor(treatment_arm),
        sbp_m3_m0 = sbp_m3 - sbp_m0,
        dbp_m3_m0 = dbp_m3 - dbp_m0,
        sbp_m6_m0 = sbp_m6 - sbp_m0,
        dbp_m6_m0 = dbp_m6 - dbp_m0,
        bp_m0_140_90 = case_when(
            (sbp_m0 < 140) & (dbp_m0 < 90) ~ "Yes",
            (sbp_m0 >= 140) | (dbp_m0 >= 90) ~ "No") %>% 
            factor(levels = c("No", "Yes")),
        bp_m1_140_90 = case_when(
            (sbp_m1 < 140) & (dbp_m1 < 90) ~ "Yes",
            (sbp_m1 >= 140) | (dbp_m1 >= 90) ~ "No"),
        bp_m3_140_90 = case_when(
            (sbp_m3 < 140) & (dbp_m3 < 90) ~ "Yes",
            (sbp_m3 >= 140) | (dbp_m3 >= 90) ~ "No"),
        bp_m6_140_90 = case_when(
            (sbp_m6 < 140) & (dbp_m6 < 90) ~ "Yes",
            (sbp_m6 >= 140) | (dbp_m6 >= 90) ~ "No"),
        bp_m3_140_90_x = case_when(
            (sbp_m3 < 140) & (dbp_m3 < 90) ~ "Yes",
            TRUE ~ "No"),
        bp_m6_140_90_x = case_when(
            (sbp_m6 < 140) & (dbp_m6 < 90) ~ "Yes",
            TRUE ~ "No"))

labelled::var_label(df_crisp) <- 
    list(
        age_years = "Age (years)", 
        gender_mf = "Gender",
        treatment_arm = " Treatment arm",
        sbp_m0 = "SBP M0 (mmHg)",
        dbp_m0 = "DBP M0 (mmHg)",
        sbp_m1 = "SBP M1 (mmHg)",
        dbp_m1 = "DBP M1 (mmHg)",
        sbp_m3 = "SBP M3 (mmHg)",
        dbp_m3 = "DBP M3 (mmHg)",
        sbp_m6 = "SBP M6 (mmHg)",
        dbp_m6 = "DBP M6 (mmHg)",
        sbp_m3_m0 = "SBP M3-SBP M0",
        sbp_m6_m0 = "SBP M6-SBP M0",
        dbp_m3_m0 = "DBP M3-SBP M0",
        dbp_m6_m0 = "DBP M6-SBP M0",
        bp_m0_140_90 = "Proportion BP <140/90, month 0",
        bp_m1_140_90 = "Proportion BP <140/90, month 1",
        bp_m3_140_90 = "Proportion BP <140/90, month 3",
        bp_m6_140_90 = "Proportion BP <140/90, month 6",
        bp_m3_140_90_x = "Proportion BP <140/90, month 3**",
        bp_m6_140_90_x = "Proportion BP <140/90, month 6**")

Generate summary of data

Show the code
df_crisp %>% summarytools::dfSummary(graph.col = F)
Data Frame Summary  
df_crisp  
Dimensions: 60 x 22  
Duplicates: 0  

---------------------------------------------------------------------------------------------------------------------------
No   Variable         Label                            Stats / Values             Freqs (% of Valid)   Valid      Missing  
---- ---------------- -------------------------------- -------------------------- -------------------- ---------- ---------
1    record_id                                         Mean (sd) : 31.4 (17.5)    60 distinct values   60         0        
     [numeric]                                         min < med < max:                                (100.0%)   (0.0%)   
                                                       1 < 31.5 < 61                                                       
                                                       IQR (CV) : 29.5 (0.6)                                               

2    age_years        Age (years)                      Mean (sd) : 58.4 (10.3)    31 distinct values   60         0        
     [numeric]                                         min < med < max:                                (100.0%)   (0.0%)   
                                                       38 < 58 < 86                                                        
                                                       IQR (CV) : 11 (0.2)                                                 

3    gender_mf        Gender                           1. 1                       28 (46.7%)           60         0        
     [factor]                                          2. 2                       32 (53.3%)           (100.0%)   (0.0%)   

4    treatment_arm    Treatment arm                    1. 1                       30 (50.0%)           60         0        
     [factor]                                          2. 2                       30 (50.0%)           (100.0%)   (0.0%)   

5    sbp_m0           SBP M0 (mmHg)                    Mean (sd) : 169.9 (18.8)   36 distinct values   60         0        
     [numeric]                                         min < med < max:                                (100.0%)   (0.0%)   
                                                       140 < 167 < 229                                                     
                                                       IQR (CV) : 23.5 (0.1)                                               

6    dbp_m0           DBP M0 (mmHg)                    Mean (sd) : 98.1 (16.7)    38 distinct values   60         0        
     [numeric]                                         min < med < max:                                (100.0%)   (0.0%)   
                                                       69 < 97 < 170                                                       
                                                       IQR (CV) : 16.8 (0.2)                                               

7    sbp_m1           SBP M1 (mmHg)                    Mean (sd) : 147.6 (23.8)   43 distinct values   60         0        
     [numeric]                                         min < med < max:                                (100.0%)   (0.0%)   
                                                       106 < 144 < 222                                                     
                                                       IQR (CV) : 21 (0.2)                                                 

8    dbp_m1           DBP M1 (mmHg)                    Mean (sd) : 87.8 (15.8)    35 distinct values   60         0        
     [numeric]                                         min < med < max:                                (100.0%)   (0.0%)   
                                                       57 < 84.5 < 146                                                     
                                                       IQR (CV) : 15.2 (0.2)                                               

9    sbp_m3           SBP M3 (mmHg)                    Mean (sd) : 146.2 (21.1)   41 distinct values   58         2        
     [numeric]                                         min < med < max:                                (96.7%)    (3.3%)   
                                                       89 < 140.5 < 205                                                    
                                                       IQR (CV) : 26.8 (0.1)                                               

10   dbp_m3           DBP M3 (mmHg)                    Mean (sd) : 86.3 (15.6)    38 distinct values   58         2        
     [numeric]                                         min < med < max:                                (96.7%)    (3.3%)   
                                                       55 < 86 < 133                                                       
                                                       IQR (CV) : 17.5 (0.2)                                               

11   sbp_m6           SBP M6 (mmHg)                    Mean (sd) : 141.1 (19.7)   35 distinct values   56         4        
     [numeric]                                         min < med < max:                                (93.3%)    (6.7%)   
                                                       102 < 137 < 214                                                     
                                                       IQR (CV) : 17.8 (0.1)                                               

12   dbp_m6           DBP M6 (mmHg)                    Mean (sd) : 84.6 (14.3)    35 distinct values   56         4        
     [numeric]                                         min < med < max:                                (93.3%)    (6.7%)   
                                                       51 < 83 < 123                                                       
                                                       IQR (CV) : 16.5 (0.2)                                               

13   sbp_m3_m0        SBP M3-SBP M0                    Mean (sd) : -23.8 (28.9)   44 distinct values   58         2        
     [numeric]                                         min < med < max:                                (96.7%)    (3.3%)   
                                                       -98 < -28.5 < 51                                                    
                                                       IQR (CV) : 35.8 (-1.2)                                              

14   dbp_m3_m0        DBP M3-SBP M0                    Mean (sd) : -11.8 (24.6)   40 distinct values   58         2        
     [numeric]                                         min < med < max:                                (96.7%)    (3.3%)   
                                                       -84 < -7.5 < 41                                                     
                                                       IQR (CV) : 21 (-2.1)                                                

15   sbp_m6_m0        SBP M6-SBP M0                    Mean (sd) : -28.8 (27)     42 distinct values   56         4        
     [numeric]                                         min < med < max:                                (93.3%)    (6.7%)   
                                                       -78 < -30 < 66                                                      
                                                       IQR (CV) : 28.8 (-0.9)                                              

16   dbp_m6_m0        DBP M6-SBP M0                    Mean (sd) : -13 (22.3)     37 distinct values   56         4        
     [numeric]                                         min < med < max:                                (93.3%)    (6.7%)   
                                                       -73 < -13.5 < 35                                                    
                                                       IQR (CV) : 25.5 (-1.7)                                              

17   bp_m0_140_90     Proportion BP <140/90, month 0   1. No                      60 (100.0%)          60         0        
     [factor]                                          2. Yes                      0 (  0.0%)          (100.0%)   (0.0%)   

18   bp_m1_140_90     Proportion BP <140/90, month 1   1. No                      36 (60.0%)           60         0        
     [character]                                       2. Yes                     24 (40.0%)           (100.0%)   (0.0%)   

19   bp_m3_140_90     Proportion BP <140/90, month 3   1. No                      33 (56.9%)           58         2        
     [character]                                       2. Yes                     25 (43.1%)           (96.7%)    (3.3%)   

20   bp_m6_140_90     Proportion BP <140/90, month 6   1. No                      26 (46.4%)           56         4        
     [character]                                       2. Yes                     30 (53.6%)           (93.3%)    (6.7%)   

21   bp_m3_140_90_x   Proportion BP <140/90, month 3   1. No                      35 (58.3%)           60         0        
     [character]                                       2. Yes                     25 (41.7%)           (100.0%)   (0.0%)   

22   bp_m6_140_90_x   Proportion BP <140/90, month 6   1. No                      30 (50.0%)           60         0        
     [character]                                       2. Yes                     30 (50.0%)           (100.0%)   (0.0%)   
---------------------------------------------------------------------------------------------------------------------------
Show the code
df_crisp %>% DataExplorer::plot_boxplot(by = "treatment_arm")
Warning: Removed 16 rows containing non-finite outside the scale range
(`stat_boxplot()`).

Warning: Removed 8 rows containing non-finite outside the scale range
(`stat_boxplot()`).

Show the code
df_crisp %>% DataExplorer::plot_histogram(
    geom_histogram_args = list(bins = 10))

Show the code
df_crisp %>% DataExplorer::plot_bar()

Table

Show the code
Setting theme "Compact"
Show the code
df_crisp %>% 
    select(-record_id) %>% 
    gtsummary::tbl_summary(
        by = treatment_arm,
        statistic = list(
            gtsummary::all_continuous() ~ "{mean} ({sd})"),
        missing_text = "Missing") %>% 
    gtsummary::modify_spanning_header(
        gtsummary::all_stat_cols() ~ "**Treatment Arm**") %>% 
    gtsummary::add_overall(last = TRUE) %>% 
    gtsummary::add_p(
        pvalue_fun = ~ gtsummary::style_pvalue(.x, digits = 3),
        test = gtsummary::all_continuous() ~ "t.test") %>% 
    gtsummary::bold_labels() %>% 
    gtsummary::bold_p()

Characteristic

Treatment Arm

Overall
N = 60

1

p-value

2

1
N = 30

1

2
N = 30

1
Age (years) 59 (11) 58 (9) 58 (10) 0.656
Gender


0.301
    1 12 (40%) 16 (53%) 28 (47%)
    2 18 (60%) 14 (47%) 32 (53%)
SBP M0 (mmHg) 168 (18) 172 (20) 170 (19) 0.431
DBP M0 (mmHg) 97 (14) 100 (19) 98 (17) 0.486
SBP M1 (mmHg) 138 (16) 157 (27) 148 (24) 0.002
DBP M1 (mmHg) 84 (10) 92 (19) 88 (16) 0.069
SBP M3 (mmHg) 143 (24) 149 (18) 146 (21) 0.282
    Missing 0 2 2
DBP M3 (mmHg) 84 (16) 88 (15) 86 (16) 0.342
    Missing 0 2 2
SBP M6 (mmHg) 138 (23) 144 (16) 141 (20) 0.228
    Missing 1 3 4
DBP M6 (mmHg) 81 (13) 88 (14) 85 (14) 0.057
    Missing 1 3 4
SBP M3-SBP M0 -25 (31) -23 (27) -24 (29) 0.803
    Missing 0 2 2
DBP M3-SBP M0 -12 (22) -11 (27) -12 (25) 0.898
    Missing 0 2 2
SBP M6-SBP M0 -31 (30) -26 (24) -29 (27) 0.546
    Missing 1 3 4
DBP M6-SBP M0 -16 (22) -10 (23) -13 (22) 0.394
    Missing 1 3 4
Proportion BP <140/90, month 0 0 (0%) 0 (0%) 0 (0%) >0.999
Proportion BP <140/90, month 1 16 (53%) 8 (27%) 24 (40%) 0.035
Proportion BP <140/90, month 3 15 (50%) 10 (36%) 25 (43%) 0.272
    Missing 0 2 2
Proportion BP <140/90, month 6 19 (66%) 11 (41%) 30 (54%) 0.063
    Missing 1 3 4
Proportion BP <140/90, month 3** 15 (50%) 10 (33%) 25 (42%) 0.190
Proportion BP <140/90, month 6** 19 (63%) 11 (37%) 30 (50%) 0.039
1

Mean (SD); n (%)

2

Welch Two Sample t-test; Pearson’s Chi-squared test; Fisher’s exact test