Paper-Two

Author

Samuel Blay Nguah

Published

September 24, 2024

Code
library(gtsummary)
library(tidyverse)
gtsummary::theme_gtsummary_compact()
df_avert <- dget("df_avert")

Table 1

Code
df_sbp <- 
    df_avert %>% 
    select(record_id, starts_with("sbp_m")) %>% 
    pivot_longer(
        cols = starts_with("sbp_m"), names_to = "month", values_to = "sbp") %>% 
    separate(col = month, into = c("x", "month"), sep = "_") %>% 
    select(-x) 

df_dbp <- 
    df_avert %>% 
    select(record_id, starts_with("dbp_m")) %>% 
    pivot_longer(
        cols = starts_with("dbp_m"), names_to = "month", values_to = "dbp") %>% 
    separate(col = month, into = c("x", "month"), sep = "_") %>% 
    select(-x)

df_bp_lt_140_90 <- 
    df_avert %>% 
    select(record_id, starts_with("bp_lt_140_90_m")) %>% 
    pivot_longer(
        cols = starts_with("bp_lt_140_90_m"), 
        names_to = "month", 
        values_to = "bp_lt_140_90") %>% 
    mutate(month = str_extract(month, "m\\d+$"))

df_bp_lt_130_80 <- 
    df_avert %>% 
    select(record_id, starts_with("bp_lt_130_80_m")) %>% 
    pivot_longer(
        cols = starts_with("bp_lt_130_80_m"), 
        names_to = "month", 
        values_to = "bp_lt_130_80") %>% 
    mutate(month = str_extract(month, "m\\d+$"))

df_sbp_cat <- 
    df_avert %>% 
    select(record_id, starts_with("sbp_cat_m")) %>% 
    pivot_longer(
        cols = starts_with("sbp_cat_m"), 
        names_to = "month", 
        values_to = "sbp_cat") %>% 
    mutate(month = str_extract(month, "m\\d+$"))

df_dbp_cat <- 
    df_avert %>% 
    select(record_id, starts_with("dbp_cat_m")) %>% 
    pivot_longer(
        cols = starts_with("dbp_cat_m"), 
        names_to = "month", 
        values_to = "dbp_cat") %>% 
    mutate(month = str_extract(month, "m\\d+$"))

df_new_avert <- 
    df_sbp %>% 
    full_join(df_dbp) %>% 
    full_join(df_bp_lt_140_90) %>% 
    full_join(df_bp_lt_130_80) %>%
    full_join(df_sbp_cat) %>% 
    full_join(df_dbp_cat)
Joining with `by = join_by(record_id, month)`
Joining with `by = join_by(record_id, month)`
Joining with `by = join_by(record_id, month)`
Joining with `by = join_by(record_id, month)`
Joining with `by = join_by(record_id, month)`
Code
df_new_avert %>% 
    select(-record_id) %>% 
    mutate(
        month = factor(
            month, 
            levels = c("m0", "m1", "m3", "m6", "m9", "m12"),
            labels = c("Month 0", "Month 1", "Month 3", "Month 6", "Month 9", 
                       "Month 12"))) %>% 
    gtsummary::tbl_summary(
                by = month,
                label = list(
                    sbp = "Systolic BP",
                    dbp = "Diastolic BP",
                    bp_lt_140_90 = "Blood Pressure < 140/90 mm Hg",
                    bp_lt_130_80 = "Blood Pressure < 130 / 80 mm Hg",
                    sbp_cat = "SBP categories",
                    dbp_cat = "DBP categories")) %>% 
    gtsummary::add_overall(last=TRUE) %>% 
    gtsummary::bold_labels() %>% 
    gtsummary::add_p()
The following errors were returned during `::()`, `gtsummary()`, and `add_p()`:
✖ For variable `sbp_cat` (`month`) and "estimate", "p.value", "conf.low", and
  "conf.high" statistics: FEXACT error 6.  LDKEY=620 is too small for this
  problem, (ii := key2[itp=1016] = 315670294, ldstp=18600) Try increasing the
  size of the workspace and possibly 'mult'

Characteristic

Month 0
N = 62

1

Month 1
N = 62

1

Month 3
N = 62

1

Month 6
N = 62

1

Month 9
N = 62

1

Month 12
N = 62

1

Overall
N = 372

1

p-value

2
Systolic BP 155 (144, 172) 145 (135, 156) 145 (135, 158) 151 (133, 166) 145 (136, 155) 141 (134, 150) 146 (136, 159) 0.003
    Unknown 0 5 11 11 6 5 38
Diastolic BP 96 (86, 107) 90 (85, 95) 87 (82, 98) 93 (82, 109) 88 (81, 95) 85 (81, 95) 90 (82, 100) 0.004
    Unknown 0 5 11 11 6 5 38
Blood Pressure < 140/90 mm Hg 25 (40%) 35 (61%) 34 (67%) 20 (39%) 33 (59%) 40 (70%) 187 (56%) 0.001
    Unknown 0 5 11 11 6 5 38
Blood Pressure < 130 / 80 mm Hg 8 (13%) 13 (23%) 8 (16%) 13 (25%) 18 (32%) 16 (28%) 76 (23%) 0.12
    Unknown 0 5 11 11 6 5 38
SBP categories







    < 120 mm Hg 2 (3.2%) 3 (5.3%) 3 (5.9%) 6 (12%) 2 (3.6%) 3 (5.3%) 19 (5.7%)
    120 – 139 mm Hg 6 (9.7%) 17 (30%) 15 (29%) 10 (20%) 15 (27%) 23 (40%) 86 (26%)
    140 – 159 mm Hg 30 (48%) 27 (47%) 22 (43%) 18 (35%) 29 (52%) 21 (37%) 147 (44%)
    160 – 179 mm Hg 12 (19%) 4 (7.0%) 5 (9.8%) 13 (25%) 4 (7.1%) 9 (16%) 47 (14%)
    >=180 mm Hg 12 (19%) 6 (11%) 6 (12%) 4 (7.8%) 6 (11%) 1 (1.8%) 35 (10%)
    Unknown 0 5 11 11 6 5 38
DBP categories






0.003
    < 80 mm Hg 5 (8.1%) 9 (16%) 4 (7.8%) 9 (18%) 12 (21%) 12 (21%) 51 (15%)
    80 – 89 mm Hg 16 (26%) 19 (33%) 29 (57%) 8 (16%) 18 (32%) 26 (46%) 116 (35%)
    90 – 99 mm Hg 15 (24%) 16 (28%) 7 (14%) 15 (29%) 15 (27%) 11 (19%) 79 (24%)
    100 – 109 mm Hg 13 (21%) 7 (12%) 6 (12%) 7 (14%) 6 (11%) 4 (7.0%) 43 (13%)
    >=110 mm Hg 13 (21%) 6 (11%) 5 (9.8%) 12 (24%) 5 (8.9%) 4 (7.0%) 45 (13%)
    Unknown 0 5 11 11 6 5 38
1

Median (Q1, Q3); n (%)

2

Kruskal-Wallis rank sum test; Pearson’s Chi-squared test

Table 2

Code
df_avert %>% 
    drop_na(bp_lt_140_90_m12) %>% 
    select(
        bp_lt_140_90_m12, ageyrs, male, formal_education, income_in_usd, 
        type_of_domicile, cigarette, alcohol, anti_hpt_b4s, anti_hpt_as, 
        anti_diabetics_as, ccb_as, arb_acei_as, diuretic_as, betablocker_as, 
        vaso_hydralazine_as, mra_as, methyldopa_as, tmt_aspirin, statins_as,
        bmi_m0, whr_m0, sbp_m0, dbp_m0, no_of_antihyp, whr_m0, rbs_m0, moca_m0, 
        mrs_m0, nihss_m0, hillbone_m0,  morisky_m1, hpt_med_side_eff_m1, 
        hillbone_m12, morisky_m12, hpt_med_side_eff_m12) %>% 
    gtsummary::tbl_summary(
        type = list(
            mrs_m0 = "continuous", 
            no_of_antihyp = "continuous", 
            hillbone_m0 = "continuous", 
            hillbone_m12 = "continuous", 
            morisky_m1 = "continuous", 
            morisky_m12 = "continuous"), 
        by = bp_lt_140_90_m12,
        digits = list(
            gtsummary::all_categorical() ~ c(0,1),
            gtsummary::all_continuous() ~ c(0,1),
            no_of_antihyp ~ c(0,0)),
        statistic = list(
            gtsummary::all_categorical() ~ "{n} ({p})",
            gtsummary::all_continuous() ~ "{mean} ({sd})",
            no_of_antihyp ~ "{median} ({min},{max})"),
        missing_text = "Missing"
        ) %>% 
    gtsummary::add_overall(last = TRUE) %>% 
    gtsummary::modify_spanning_header(
        gtsummary::all_stat_cols() ~ "**BP Controlled (<140 / 90 mm Hg) at month 12**") %>% 
    gtsummary::add_p(
        pvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)) %>% 
    gtsummary::bold_labels() %>% 
    gtsummary::add_stat_label(location = "column") 
The following warnings were returned during `::()`, `gtsummary()`, and
`add_p()`:
! For variable `ageyrs` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  p-value with ties
! For variable `ageyrs` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  confidence intervals with ties
! For variable `dbp_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  p-value with ties
! For variable `dbp_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  confidence intervals with ties
! For variable `hillbone_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  p-value with ties
! For variable `hillbone_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  confidence intervals with ties
! For variable `hillbone_m12` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  p-value with ties
! For variable `hillbone_m12` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  confidence intervals with ties
! For variable `moca_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  p-value with ties
! For variable `moca_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  confidence intervals with ties
! For variable `morisky_m1` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  p-value with ties
! For variable `morisky_m1` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  confidence intervals with ties
! For variable `morisky_m12` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  p-value with ties
! For variable `morisky_m12` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  confidence intervals with ties
! For variable `mrs_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  p-value with ties
! For variable `mrs_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  confidence intervals with ties
! For variable `nihss_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  p-value with ties
! For variable `nihss_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  confidence intervals with ties
! For variable `no_of_antihyp` (`bp_lt_140_90_m12`) and "estimate",
  "statistic", "p.value", "conf.low", and "conf.high" statistics: cannot
  compute exact p-value with ties
! For variable `no_of_antihyp` (`bp_lt_140_90_m12`) and "estimate",
  "statistic", "p.value", "conf.low", and "conf.high" statistics: cannot
  compute exact confidence intervals with ties
! For variable `rbs_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  p-value with ties
! For variable `rbs_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  confidence intervals with ties
! For variable `sbp_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  p-value with ties
! For variable `sbp_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  confidence intervals with ties
! For variable `whr_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  p-value with ties
! For variable `whr_m0` (`bp_lt_140_90_m12`) and "estimate", "statistic",
  "p.value", "conf.low", and "conf.high" statistics: cannot compute exact
  confidence intervals with ties

Characteristic

Statistic

BP Controlled (<140 / 90 mm Hg) at month 12

p-value

1

No
N = 17

Yes
N = 40

Overall
N = 57

Age (years) Mean (SD) 51 (8.4) 53 (12.1) 52 (11.1) 0.496
Sex, male (%) n (%) 11 (64.7) 16 (40.0) 27 (47.4) 0.087
Educational level



0.958
    0 n (%) 2 (11.8) 3 (7.7) 5 (8.9)
    1 n (%) 10 (58.8) 21 (53.8) 31 (55.4)
    2 n (%) 5 (29.4) 13 (33.3) 18 (32.1)
    3 n (%) 0 (0.0) 2 (5.1) 2 (3.6)
    Missing n 0 1 1
Income (USD)



0.912
    0 n (%) 1 (6.7) 5 (12.8) 6 (11.1)
    1 n (%) 9 (60.0) 23 (59.0) 32 (59.3)
    2 n (%) 5 (33.3) 11 (28.2) 16 (29.6)
    Missing n 2 1 3
Type of domicile



>0.999
    1 n (%) 2 (11.8) 5 (12.5) 7 (12.3)
    2 n (%) 15 (88.2) 35 (87.5) 50 (87.7)
Cigarette smoking n (%) 1 (5.9) 4 (10.0) 5 (8.8) >0.999
Alcohol use n (%) 4 (23.5) 9 (22.5) 13 (22.8) >0.999
Antihypertensive before ICH n (%) 8 (47.1) 23 (57.5) 31 (54.4) 0.469
Antihypertensive after ICH n (%) 17 (100.0) 38 (95.0) 55 (96.5) >0.999
Anti-diabetics after ICH n (%) 2 (11.8) 6 (15.0) 8 (14.0) >0.999
CCB n (%) 13 (76.5) 31 (77.5) 44 (77.2) >0.999
ARB/ACE-I n (%) 16 (94.1) 30 (75.0) 46 (80.7) 0.146
DIURETICS n (%) 10 (58.8) 17 (42.5) 27 (47.4) 0.259
BETABLOCKER n (%) 7 (41.2) 17 (42.5) 24 (42.1) 0.926
VASODILATOR n (%) 3 (17.6) 12 (30.0) 15 (26.3) 0.513
MRA n (%) 3 (17.6) 2 (5.0) 5 (8.8) 0.151
CENTRALLY ACTING n (%) 1 (5.9) 6 (15.0) 7 (12.3) 0.662
Treatment: Aspirin



0.308
    0 n (%) 6 (35.3) 20 (50.0) 26 (45.6)
    75 n (%) 11 (64.7) 20 (50.0) 31 (54.4)
Statin use after stroke n (%) 10 (58.8) 24 (60.0) 34 (59.6) 0.934
BMI (Month 0) Mean (SD) 26 (6.6) 26 (13.4) 26 (11.8) 0.622
WAIST-TO-HIP RATIO (Month 0) Mean (SD) 1 (0.0) 1 (0.1) 1 (0.1) 0.834
Baseline systolic BP (Month 0) Mean (SD) 158 (22.3) 156 (18.1) 157 (19.3) 0.469
Baseline diastolic BP (Month 0) Mean (SD) 100 (13.4) 95 (13.8) 96 (13.7) 0.303
Antihypertensive meds) Median (Min,Max) 3 (2,5) 3 (0,5) 3 (0,5) 0.606
Random blood glucose (Month 0) Mean (SD) 7 (1.5) 7 (2.2) 7 (2.0) 0.688
MOCA (Month 0) Mean (SD) 19 (6.1) 15 (6.0) 16 (6.2) 0.070
Modified Rankin Score (Month 0) Mean (SD) 2 (1.1) 2 (1.0) 2 (1.0) 0.270
NIHSS (Month 0) Mean (SD) 1 (2.7) 3 (3.7) 2 (3.5) 0.305
Hillbone (Month 0) Mean (SD) 53 (1.9) 53 (1.5) 53 (1.6) 0.731
Morisky (Month 1) Mean (SD) 0 (0.2) 0 (0.4) 0 (0.3) 0.811
    Missing n 0 1 1
HTN Side Effects (Month 1) n (%) 0 (0.0) 3 (7.9) 3 (5.5) 0.544
    Missing n 0 2 2
Hillbone (Month 12) Mean (SD) 52 (1.1) 53 (0.9) 53 (1.0) 0.300
Adherence scores at month 12 Mean (SD) 0 (0.7) 0 (0.7) 0 (0.7) 0.336
HTN Side Effects (Month 12) n (%) 0 (0.0) 1 (2.5) 1 (1.8) >0.999
1

Wilcoxon rank sum test; Pearson’s Chi-squared test; Fisher’s exact test; Wilcoxon rank sum exact test

Table 3

Code
df_avert %>% 
    drop_na(bp_lt_140_90_m12) %>% 
    select(
        bp_lt_140_90_m12, ageyrs, male, formal_education, income_in_usd, 
        type_of_domicile, cigarette, alcohol, anti_hpt_b4s, anti_hpt_as, 
        anti_diabetics_as, ccb_as, arb_acei_as, diuretic_as, betablocker_as, 
        vaso_hydralazine_as, mra_as, methyldopa_as, tmt_aspirin, statins_as,
        bmi_m0, whr_m0, sbp_m0, dbp_m0, no_of_antihyp, whr_m0, rbs_m0, moca_m0, 
        mrs_m0, nihss_m0, hillbone_m0,  morisky_m1, hpt_med_side_eff_m1, 
        hillbone_m12, morisky_m12, hpt_med_side_eff_m12) %>%
    tbl_uvregression(
        method = glm,
        y = bp_lt_140_90_m12,
        method.args = family(binomial),
        exponentiate = TRUE,
        pvalue_fun = function(x) style_pvalue(x, digits = 3)) %>%
    gtsummary::bold_p() %>% 
    gtsummary::modify_header(
        update = list(estimate ~ "**Estimate**", label ~ "**Variable**"))
There was a warning running `tbl_regression()` for variable "formal_education".
See message below.
! glm.fit: fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: fitted probabilities numerically 0 or 1
  occurred, glm.fit: fitted probabilities numerically 0 or 1 occurred, glm.fit:
  fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: algorithm did not converge, glm.fit:
  fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: fitted probabilities numerically 0 or 1
  occurred, glm.fit: fitted probabilities numerically 0 or 1 occurred, glm.fit:
  fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: fitted probabilities numerically 0 or 1
  occurred, and glm.fit: fitted probabilities numerically 0 or 1 occurred
There was a warning running `tbl_regression()` for variable "anti_hpt_as". See
message below.
! glm.fit: fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: fitted probabilities numerically 0 or 1
  occurred, glm.fit: fitted probabilities numerically 0 or 1 occurred, glm.fit:
  fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: fitted probabilities numerically 0 or 1
  occurred, glm.fit: fitted probabilities numerically 0 or 1 occurred, glm.fit:
  fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: fitted probabilities numerically 0 or 1
  occurred, glm.fit: fitted probabilities numerically 0 or 1 occurred, glm.fit:
  fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: fitted probabilities numerically 0 or 1
  occurred, and glm.fit: fitted probabilities numerically 0 or 1 occurred
There was a warning running `tbl_regression()` for variable
"hpt_med_side_eff_m1". See message below.
! glm.fit: fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: fitted probabilities numerically 0 or 1
  occurred, glm.fit: fitted probabilities numerically 0 or 1 occurred, glm.fit:
  fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: fitted probabilities numerically 0 or 1
  occurred, and glm.fit: fitted probabilities numerically 0 or 1 occurred
There was a warning running `tbl_regression()` for variable
"hpt_med_side_eff_m12". See message below.
! glm.fit: fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: fitted probabilities numerically 0 or 1
  occurred, glm.fit: fitted probabilities numerically 0 or 1 occurred, glm.fit:
  fitted probabilities numerically 0 or 1 occurred, glm.fit: fitted
  probabilities numerically 0 or 1 occurred, glm.fit: fitted probabilities
  numerically 0 or 1 occurred, glm.fit: fitted probabilities numerically 0 or 1
  occurred, glm.fit: fitted probabilities numerically 0 or 1 occurred, and
  collapsing to unique 'x' values
Warning: The `update` argument of `modify_header()` is deprecated as of gtsummary 2.0.0.
ℹ Use `modify_header(...)` input instead. Dynamic dots allow for syntax like
  `modify_header(!!!list(...))`.
ℹ The deprecated feature was likely used in the gtsummary package.
  Please report the issue at <https://github.com/ddsjoberg/gtsummary/issues>.

Variable

N

Estimate

1

95% CI

1

p-value

Age (years) 57 1.01 0.96, 1.07 0.620
Sex, male (%) 57


    No

    Yes
0.36 0.11, 1.15 0.093
Educational level 56


    0

    1
1.40 0.16, 9.81 0.734
    2
1.73 0.19, 13.9 0.602
    3
10,434,241 0.00,
0.992
Income (USD) 54


    0

    1
0.51 0.02, 3.79 0.564
    2
0.44 0.02, 3.81 0.501
Type of domicile 57


    1

    2
0.93 0.12, 4.89 0.938
Cigarette smoking 57


    No

    Yes
1.78 0.24, 36.3 0.619
Alcohol use 57


    No

    Yes
0.94 0.26, 3.98 0.932
Antihypertensive before ICH 57


    No

    Yes
1.52 0.49, 4.86 0.470
Antihypertensive after ICH 57


    No

    Yes
0.00
0.993
Anti-diabetics after ICH 57


    No

    Yes
1.32 0.27, 9.75 0.748
CCB 57


    No

    Yes
1.06 0.25, 3.92 0.932
ARB/ACE-I 57


    No

    Yes
0.19 0.01, 1.11 0.126
DIURETICS 57


    No

    Yes
0.52 0.16, 1.62 0.262
BETABLOCKER 57


    No

    Yes
1.06 0.34, 3.44 0.926
VASODILATOR 57


    No

    Yes
2.00 0.53, 9.82 0.338
MRA 57


    No

    Yes
0.25 0.03, 1.63 0.146
CENTRALLY ACTING 57


    No

    Yes
2.82 0.43, 55.7 0.355
Treatment: Aspirin 57


    0

    75
0.55 0.16, 1.72 0.311
Statin use after stroke 57


    No

    Yes
1.05 0.32, 3.32 0.934
BMI (Month 0) 57 1.00 0.95, 1.08 0.926
WAIST-TO-HIP RATIO (Month 0) 57 1.86 0.00, 11,022 0.886
Baseline systolic BP (Month 0) 57 0.99 0.96, 1.02 0.644
Baseline diastolic BP (Month 0) 57 0.97 0.93, 1.02 0.240
Antihypertensive meds) 57 0.83 0.50, 1.36 0.472
Random blood glucose (Month 0) 57 1.04 0.79, 1.44 0.808
MOCA (Month 0) 57 0.91 0.81, 1.00 0.055
Modified Rankin Score (Month 0) 57 1.33 0.75, 2.50 0.339
NIHSS (Month 0) 57 1.11 0.93, 1.39 0.277
Hillbone (Month 0) 57 0.97 0.68, 1.39 0.876
Morisky (Month 1) 56 1.54 0.29, 26.4 0.665
HTN Side Effects (Month 1) 55 20,664,623 0.00,
0.994
Hillbone (Month 12) 57 1.35 0.75, 2.44 0.305
Adherence scores at month 12 57 0.76 0.34, 1.82 0.510
HTN Side Effects (Month 12) 57 2,509,816 0.00,
0.992
1

OR = Odds Ratio, CI = Confidence Interval

Table 4

Code
df_sbp_long <- 
    df_avert %>% 
    pivot_longer(
        cols = c(sbp_m0, sbp_m1, sbp_m3, sbp_m6, sbp_m9, sbp_m12), 
        names_to = "month", 
        values_to = "sbp") %>% 
    mutate(month = str_extract(month, "\\d+") %>% as.numeric())

df_sbp_long %>% 
    ggplot(aes(x = month, y = sbp, group = record_id)) + 
    geom_line()
Warning: Removed 18 rows containing missing values or values outside the scale range
(`geom_line()`).

Code
x <- bind_rows(
    nlme::lme(
    sbp ~ month*ageyrs, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*male, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*formal_education, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*income_in_usd, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*type_of_domicile, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*cigarette, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*alcohol, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*anti_hpt_b4s, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*anti_hpt_as, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*anti_diabetics_as, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*ccb_as, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*arb_acei_as, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*diuretic_as, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*betablocker_as, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*vaso_hydralazine_as, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*mra_as, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*methyldopa_as, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*tmt_aspirin, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*statins_as, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*bmi_m0, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*whr_m0, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*dbp_m0, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*no_of_antihyp, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*whr_m0, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*rbs_m0, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*moca_m0, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*mrs_m0, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*nihss_m0, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*hillbone_m0, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*morisky_m1, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*hpt_med_side_eff_m1, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*hillbone_m12, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*morisky_m12, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    sbp ~ month*hpt_med_side_eff_m12, 
    random = ~month|record_id, 
    data = df_sbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"))

y <-  
    nlme::lme(
        sbp ~ month*ageyrs + month*dbp_m0, 
        random = ~month|record_id, 
        data = df_sbp_long, 
        na.action = na.omit, method = "ML") %>% 
        broom.mixed::tidy(conf.int=T,  effects = "fixed") %>% 
    rename(
        effect2 = effect, estimate2 = estimate, std.error2 = std.error, 
        df2 = df, statistic2 = statistic, p.value2 = p.value, 
        conf.low2 = conf.low, conf.high2 = conf.high)

x %>% 
    left_join(y)%>% 
    filter(str_detect(term,":")) %>% 
    select(term, estimate, conf.low, conf.high, p.value,
           estimate2, conf.low2, conf.high2, p.value2) %>% 
    mutate(
        across(c(estimate:conf.high, estimate2:conf.high2), ~round(.x, 2)),
        across(c(p.value, p.value2), ~round(.x, 3)), 
        Crude_Est. = paste(estimate, "(", conf.low, ", ", conf.high, ")", sep=""),
        Adj_Est. = paste(estimate2, "(", conf.low2, ", ", conf.high2, ")", sep=""),
        Adj_Est. = case_when(Adj_Est. == "NA(NA, NA)" ~ "", TRUE ~ Adj_Est.),
        term = str_remove(term, "visit:")
        ) %>% 
    select(
        term, `Crude Estimate` = Crude_Est., `Crude p-value` = p.value,
        `Adj Estimate` = Adj_Est., `Adj p-value` = p.value2
        ) %>%
    rstatix::p_format(digits = 3, accuracy = 0.001)%>% 
    mutate(term = str_remove(term, "month:")) %>% 
    flextable::flextable(cwidth = 1) %>%
    flextable::width(j=c(2,4), width = 1.6) %>% 
    flextable::theme_vanilla()
Joining with `by = join_by(term)`

term

Crude Estimate

Crude p-value

Adj Estimate

Adj p-value

ageyrs

-0.05(-0.09, 0)

0.030

-0.04(-0.07, 0)

0.055

maleYes

-0.24(-1.19, 0.71)

0.621

formal_education1

-0.52(-2.17, 1.14)

0.543

formal_education2

-0.93(-2.68, 0.82)

0.302

formal_education3

-0.91(-3.6, 1.78)

0.512

income_in_usd1

-0.82(-2.38, 0.73)

0.304

income_in_usd2

-0.77(-2.45, 0.9)

0.368

type_of_domicile2

0.53(-0.93, 1.99)

0.477

cigaretteYes

0.21(-1.5, 1.91)

0.812

alcoholYes

-0.42(-1.55, 0.71)

0.466

anti_hpt_b4sYes

-0.5(-1.45, 0.45)

0.302

anti_hpt_asYes

-0.67(-3.14, 1.79)

0.592

anti_diabetics_asYes

0.05(-1.32, 1.41)

0.947

ccb_asYes

0.99(-0.08, 2.07)

0.072

arb_acei_asYes

-0.32(-1.51, 0.87)

0.597

diuretic_asYes

-0.04(-0.99, 0.91)

0.936

betablocker_asYes

-0.21(-1.18, 0.75)

0.664

vaso_hydralazine_asYes

0.19(-0.89, 1.27)

0.734

mra_asYes

1.09(-0.58, 2.77)

0.203

methyldopa_asYes

0.58(-0.88, 2.04)

0.438

tmt_aspirin75

0.24(-0.72, 1.2)

0.630

statins_asYes

0.18(-0.79, 1.16)

0.714

bmi_m0

-0.01(-0.05, 0.03)

0.577

whr_m0

-5.02(-12.07, 2.03)

0.165

dbp_m0

-0.06(-0.09, -0.03)

0.000

-0.06(-0.09, -0.03)

0.000

no_of_antihyp

0.18(-0.22, 0.58)

0.372

whr_m0

-5.02(-12.07, 2.03)

0.165

rbs_m0

-0.09(-0.32, 0.15)

0.486

moca_m0

0.02(-0.06, 0.09)

0.659

mrs_m0

-0.25(-0.71, 0.22)

0.305

nihss_m0

-0.01(-0.14, 0.12)

0.875

hillbone_m0

-0.02(-0.31, 0.28)

0.918

morisky_m1

-0.66(-1.98, 0.66)

0.328

hpt_med_side_eff_m1

0.55(-1.49, 2.6)

0.596

hillbone_m12

-0.33(-0.8, 0.15)

0.178

morisky_m12

0.17(-0.51, 0.85)

0.624

hpt_med_side_eff_m12

-0.48(-3.93, 2.97)

0.786

Table 5

Code
df_dbp_long <- 
    df_avert %>% 
    pivot_longer(
        cols = c(dbp_m0, dbp_m1, dbp_m3, dbp_m6, dbp_m9, dbp_m12), 
        names_to = "month", 
        values_to = "dbp") %>% 
    mutate(month = str_extract(month, "\\d+") %>% as.numeric())

df_dbp_long %>% 
    ggplot(aes(x = month, y = dbp, group = record_id)) + 
    geom_line()
Warning: Removed 18 rows containing missing values or values outside the scale range
(`geom_line()`).

Code
x <- bind_rows(
    nlme::lme(
    dbp ~ month*ageyrs, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*male, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*formal_education, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*income_in_usd, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*type_of_domicile, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*cigarette, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*alcohol, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*anti_hpt_b4s, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*anti_hpt_as, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*anti_diabetics_as, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*ccb_as, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*arb_acei_as, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*diuretic_as, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*betablocker_as, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*vaso_hydralazine_as, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*mra_as, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*methyldopa_as, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*tmt_aspirin, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*statins_as, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*bmi_m0, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*whr_m0, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*no_of_antihyp, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*whr_m0, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*rbs_m0, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*moca_m0, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*mrs_m0, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*nihss_m0, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*hillbone_m0, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*morisky_m1, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*hpt_med_side_eff_m1, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*hillbone_m12, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*morisky_m12, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed"),
    
    nlme::lme(
    dbp ~ month*hpt_med_side_eff_m12, 
    random = ~month|record_id, 
    data = df_dbp_long, 
    na.action = na.omit, 
    method = "ML") %>% 
    broom.mixed::tidy(conf.int=T,  effects = "fixed")
    )

y <-  
    nlme::lme(
        dbp ~ month*ageyrs, 
        random = ~month|record_id, 
        data = df_dbp_long, 
        na.action = na.omit, method = "ML") %>% 
        broom.mixed::tidy(conf.int=T,  effects = "fixed") %>% 
    rename(
        effect2 = effect, estimate2 = estimate, std.error2 = std.error, 
        df2 = df, statistic2 = statistic, p.value2 = p.value, 
        conf.low2 = conf.low, conf.high2 = conf.high)

x %>% 
    left_join(y)%>% 
    filter(str_detect(term,":")) %>% 
    select(term, estimate, conf.low, conf.high, p.value,
           estimate2, conf.low2, conf.high2, p.value2) %>% 
    mutate(
        across(c(estimate:conf.high, estimate2:conf.high2), ~round(.x, 2)),
        across(c(p.value, p.value2), ~round(.x, 3)), 
        Crude_Est. = paste(estimate, "(", conf.low, ", ", conf.high, ")", sep=""),
        Adj_Est. = paste(estimate2, "(", conf.low2, ", ", conf.high2, ")", sep=""),
        Adj_Est. = case_when(Adj_Est. == "NA(NA, NA)" ~ "", TRUE ~ Adj_Est.),
        term = str_remove(term, "visit:")
        ) %>% 
    select(
        term, `Crude Estimate` = Crude_Est., `Crude p-value` = p.value,
        `Adj Estimate` = Adj_Est., `Adj p-value` = p.value2
        ) %>%
    rstatix::p_format(digits = 3, accuracy = 0.001)%>% 
    mutate(term = str_remove(term, "month:")) %>% 
    flextable::flextable(cwidth = 1) %>%
    flextable::width(j=c(2,4), width = 1.6) %>% 
    flextable::theme_vanilla()
Joining with `by = join_by(term)`

term

Crude Estimate

Crude p-value

Adj Estimate

Adj p-value

ageyrs

-0.04(-0.06, -0.01)

0.015

-0.04(-0.06, -0.01)

0.015

maleYes

0.22(-0.44, 0.87)

0.519

formal_education1

-0.33(-1.48, 0.82)

0.578

formal_education2

-0.35(-1.57, 0.87)

0.575

formal_education3

0.05(-1.83, 1.93)

0.959

income_in_usd1

-0.17(-1.25, 0.91)

0.760

income_in_usd2

-0.25(-1.42, 0.92)

0.676

type_of_domicile2

0.69(-0.29, 1.67)

0.169

cigaretteYes

0.18(-0.99, 1.35)

0.762

alcoholYes

-0.25(-1.02, 0.53)

0.529

anti_hpt_b4sYes

-0.39(-1.04, 0.26)

0.243

anti_hpt_asYes

-0.72(-2.41, 0.97)

0.406

anti_diabetics_asYes

-0.06(-0.99, 0.87)

0.898

ccb_asYes

0.25(-0.52, 1.02)

0.523

arb_acei_asYes

-0.15(-0.97, 0.67)

0.729

diuretic_asYes

0.15(-0.51, 0.8)

0.663

betablocker_asYes

-0.16(-0.82, 0.5)

0.639

vaso_hydralazine_asYes

0.24(-0.5, 0.99)

0.518

mra_asYes

0.62(-0.55, 1.78)

0.301

methyldopa_asYes

0.05(-0.96, 1.05)

0.927

tmt_aspirin75

0.41(-0.25, 1.06)

0.223

statins_asYes

0.13(-0.54, 0.79)

0.710

bmi_m0

0(-0.03, 0.03)

0.964

whr_m0

-3.32(-8.16, 1.53)

0.182

no_of_antihyp

0.1(-0.18, 0.38)

0.479

whr_m0

-3.32(-8.16, 1.53)

0.182

rbs_m0

-0.08(-0.24, 0.08)

0.326

moca_m0

0(-0.05, 0.06)

0.856

mrs_m0

-0.1(-0.42, 0.22)

0.554

nihss_m0

0.03(-0.06, 0.12)

0.503

hillbone_m0

0.01(-0.19, 0.21)

0.943

morisky_m1

-0.65(-1.54, 0.23)

0.149

hpt_med_side_eff_m1

0.64(-0.74, 2.02)

0.365

hillbone_m12

-0.21(-0.53, 0.11)

0.192

morisky_m12

0.02(-0.44, 0.47)

0.948

hpt_med_side_eff_m12

-0.22(-2.54, 2.09)

0.851