Code
library(gtsummary)
library(tidyverse)
::theme_gtsummary_compact()
gtsummary<- dget("df_avert") df_avert
library(gtsummary)
library(tidyverse)
::theme_gtsummary_compact()
gtsummary<- dget("df_avert") df_avert
%>%
df_avert group_by(tmt_statin, tmt_aspirin) %>%
summarise(across(mrs_diff_0_12, epiDisplay::ci.numeric)) %>%
unnest(mrs_diff_0_12) %>%
mutate(
tmt_aspirin = factor(tmt_aspirin, levels = c(0, 75), labels = c("0mg", "75mg")),
tmt_statin = factor(tmt_statin, levels = c(0, 20, 80), labels = c("0mg", "20mg", "80mg"))) %>%
ggplot(aes(x = tmt_statin, y = mean, group = tmt_aspirin)) +
geom_point() +
geom_line(aes(x = tmt_statin, y = mean, color = tmt_aspirin)) +
labs(x = "Statin Dose", y = "MRS", color = "Aspirin",
title = "Change in mean Modified Ranking Score from recruitemt to month 12 \n for the dose combination of Aspirin and Statin ")+
theme_light() +
scale_x_discrete(expand = c(0.05,0.05))+
scale_y_continuous(expand = c(0.02,0.02))+
theme(legend.position = "top")
`summarise()` has grouped output by 'tmt_statin'. You can override using the
`.groups` argument.
library(gtsummary)
library(tidyverse)
::theme_gtsummary_compact()
gtsummary
%>%
df_avert group_by(tmt_statin, tmt_aspirin) %>%
summarise(across(moca_diff_0_12, epiDisplay::ci.numeric)) %>%
unnest(moca_diff_0_12) %>%
mutate(
tmt_aspirin = factor(tmt_aspirin, levels = c(0, 75), labels = c("0mg", "75mg")),
tmt_statin = factor(tmt_statin, levels = c(0, 20, 80), labels = c("0mg", "20mg", "80mg"))) %>%
ggplot(aes(x = tmt_statin, y = mean, group = tmt_aspirin)) +
geom_point() +
geom_line(aes(x = tmt_statin, y = mean, color = tmt_aspirin)) +
labs(x = "Statin Dose", y = "MOCA", color = "Aspirin",
title = "Change in mean MOCA from recruitemt to month 12 \n for the dose combination of Aspirin and Statin ")+
theme_light() +
scale_x_discrete(expand = c(0.05,0.05))+
scale_y_continuous(expand = c(0.02,0.02))+
theme(legend.position = "top")
<-
tab1 %>%
df_avert select(mrs_diff_0_12, treatment) %>%
::tbl_uvregression(
gtsummaryy = mrs_diff_0_12,
method = lm,
pvalue_fun = function(x) style_pvalue(x, digits = 3)) %>%
modify_header(
update = list(estimate ~ "**Estimate**", label ~ "**Variable**"))
<-
tab2 %>%
df_avert select(mrs_diff_0_12, treatment, mrs_m0) %>%
lm(mrs_diff_0_12 ~ treatment + mrs_m0, data=.) %>%
tbl_regression(
include = treatment,
pvalue_fun = function(x) style_pvalue(x, digits = 3)) %>%
modify_header(
update = list(estimate ~ "**Estimate**", label ~ "**Variable**"))
::tbl_merge(
gtsummarytbls = list(tab1, tab2),
tab_spanner = c("Unadjusted estimates", "Adjusted for baseline MRS"))%>%
modify_caption(
caption = "**TABLE 3: Effect size estimates of atherosclerotic interventions/regimens change in Modified Rankin Score (MRS) at Month 12 compared with baseline**")
Variable | Unadjusted estimates | Adjusted for baseline MRS | |||||
---|---|---|---|---|---|---|---|
N | Estimate | 95% CI1 | p-value | Estimate | 95% CI1 | p-value | |
Treatment | 60 | ||||||
Statin 0mg + Aspirin 0mg | — | — | — | — | |||
Statin 0mg + Aspirin 75mg | -0.40 | -1.2, 0.43 | 0.337 | -0.40 | -1.2, 0.44 | 0.343 | |
Statin 20mg + Aspirin 0mg | -0.04 | -0.90, 0.81 | 0.917 | -0.04 | -0.90, 0.81 | 0.917 | |
Statin 20mg + Aspirin 75mg | -0.24 | -1.0, 0.57 | 0.561 | -0.24 | -1.1, 0.58 | 0.564 | |
Statin 80mg + Aspirin 0mg | -0.20 | -1.0, 0.63 | 0.630 | -0.20 | -1.0, 0.64 | 0.632 | |
Statin 80mg + Aspirin 75mg | -0.50 | -1.3, 0.33 | 0.231 | -0.50 | -1.3, 0.34 | 0.236 | |
1 CI = Confidence Interval |
<-
tab1 %>%
df_avert mutate(moca_diff_0_12 = moca_m12 - moca_m0) %>%
select(moca_diff_0_12, treatment) %>%
::tbl_uvregression(
gtsummaryy = moca_diff_0_12,
method = lm,
pvalue_fun = function(x) style_pvalue(x, digits = 3)) %>%
modify_header(
update = list(estimate ~ "**Estimate**", label ~ "**Variable**"))
<-
tab2 %>%
df_avert select(moca_diff_0_12, treatment, moca_m0) %>%
lm(moca_diff_0_12 ~ treatment + moca_m0, data=.) %>%
tbl_regression(
include = treatment,
pvalue_fun = function(x) style_pvalue(x, digits = 3)) %>%
modify_header(
update = list(estimate ~ "**Estimate**", label ~ "**Variable**"))
::tbl_merge(
gtsummarytbls = list(tab1, tab2),
tab_spanner = c("Unadjusted estimates", "Adjusted for baseline MOCA"))%>%
modify_caption(
caption = "**TABLE 4: Effect size estimates of atherosclerotic interventions/regimens- change in MOCA at Month 12 compared with Month 3**")
Variable | Unadjusted estimates | Adjusted for baseline MOCA | |||||
---|---|---|---|---|---|---|---|
N | Estimate | 95% CI1 | p-value | Estimate | 95% CI1 | p-value | |
Treatment | 57 | ||||||
Statin 0mg + Aspirin 0mg | — | — | — | — | |||
Statin 0mg + Aspirin 75mg | 4.3 | -0.48, 9.0 | 0.077 | 1.0 | -2.1, 4.1 | 0.513 | |
Statin 20mg + Aspirin 0mg | 1.5 | -3.5, 6.6 | 0.545 | -0.61 | -3.8, 2.6 | 0.700 | |
Statin 20mg + Aspirin 75mg | -0.86 | -5.5, 3.8 | 0.713 | -2.6 | -5.5, 0.36 | 0.084 | |
Statin 80mg + Aspirin 0mg | 1.0 | -3.9, 5.9 | 0.683 | -1.1 | -4.2, 2.0 | 0.483 | |
Statin 80mg + Aspirin 75mg | 2.7 | -2.1, 7.4 | 0.264 | -0.14 | -3.2, 2.9 | 0.925 | |
1 CI = Confidence Interval |
::tbl_uvregression(
gtsummary%>% mutate(mrs_m12 = factor(mrs_m12, ordered = T)),
df_avert include = c(treatment, mrs_m12),
method = ordinal::clm,
y = mrs_m12,
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),
%>%
) ::bold_labels() %>%
gtsummary::bold_p() %>%
gtsummary::add_n() %>%
gtsummarymodify_caption(caption = "**TABLE 5A: ORDINAL LOGISTIC REGRESSION OF CHANGES IN MODIFIED RANKIN SCORE**")
Characteristic | N | OR1 | 95% CI1 | p-value |
---|---|---|---|---|
Treatment | 60 | |||
Statin 0mg + Aspirin 0mg | 1.00 | — | ||
Statin 0mg + Aspirin 75mg | 0.80 | 0.16, 3.97 | 0.784 | |
Statin 20mg + Aspirin 0mg | 1.16 | 0.22, 6.06 | 0.860 | |
Statin 20mg + Aspirin 75mg | 1.19 | 0.26, 5.47 | 0.826 | |
Statin 80mg + Aspirin 0mg | 0.87 | 0.15, 4.86 | 0.878 | |
Statin 80mg + Aspirin 75mg | 0.86 | 0.17, 4.19 | 0.855 | |
1 OR = Odds Ratio, CI = Confidence Interval |
%>%
df_avert select(mrs_m12_cat, treatment) %>%
drop_na(mrs_m12_cat) %>%
tbl_summary(
by = mrs_m12_cat
%>%
) ::add_p(
gtsummarypvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)) %>%
::bold_labels() %>%
gtsummarymodify_caption(
caption = "**TABLE 5B: Chisquare analysis of MRS at month 12 categorised**")
Characteristic | Favourable, N = 471 | Unfavourable, N = 131 | p-value2 |
---|---|---|---|
Treatment | 0.912 | ||
Statin 0mg + Aspirin 0mg | 7 (15%) | 3 (23%) | |
Statin 0mg + Aspirin 75mg | 8 (17%) | 2 (15%) | |
Statin 20mg + Aspirin 0mg | 7 (15%) | 2 (15%) | |
Statin 20mg + Aspirin 75mg | 9 (19%) | 2 (15%) | |
Statin 80mg + Aspirin 0mg | 7 (15%) | 3 (23%) | |
Statin 80mg + Aspirin 75mg | 9 (19%) | 1 (7.7%) | |
1 n (%) | |||
2 Fisher’s exact test |
%>%
df_avert select(
treatment, ageyrs, male, formal_education, income_in_usd,
type_of_domicile, cigarette, alcohol, anti_hpt_b4s, antiplatelet_b4s,
anti_coagulants_b4s, anti_diabetics_b4s, statins_b4s, anti_hpt_as,
anti_diabetics_as, ccb_as, arb_acei_as, diuretic_as, betablocker_as,
vaso_hydralazine_as, mra_as, methyldopa_as, bmi_m0, whr_m0, sbp_m0, %>%
dbp_m0, no_of_antihyp, whr_m0, rbs_m0, moca_m0, mrs_m0, nihss_m0) ::tbl_summary(
gtsummarytype = list(mrs_m0 = "continuous", no_of_antihyp = "continuous"),
by = treatment,
digits = list(
::all_categorical() ~ c(0,1),
gtsummary::all_continuous() ~ c(0,1),
gtsummary~ c(0,0)),
no_of_antihyp statistic = list(
::all_categorical() ~ "{n} ({p})",
gtsummary::all_continuous() ~ "{mean} ({sd})",
gtsummary~ "{median} ({min},{max})"),
no_of_antihyp missing_text = "Missing"
%>%
) ::add_p(
gtsummarypvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)) %>%
::bold_labels() %>%
gtsummary::add_stat_label(location = "column") %>%
gtsummarymodify_caption(
caption = "**Table 1: Comparison of baseline characteristics By Treatment Allocation**")
Characteristic | Statistic | Statin 0mg + Aspirin 0mg, N = 10 | Statin 0mg + Aspirin 75mg, N = 10 | Statin 20mg + Aspirin 0mg, N = 10 | Statin 20mg + Aspirin 75mg, N = 11 | Statin 80mg + Aspirin 0mg, N = 10 | Statin 80mg + Aspirin 75mg, N = 11 | p-value1 |
---|---|---|---|---|---|---|---|---|
Age (years) | Mean (SD) | 50 (15.1) | 50 (7.2) | 50 (12.9) | 56 (13.0) | 60 (7.5) | 52 (10.7) | 0.242 |
Sex, male (%) | n (%) | 3 (30.0) | 4 (40.0) | 5 (50.0) | 5 (45.5) | 5 (50.0) | 8 (72.7) | 0.538 |
Educational level | 0.642 | |||||||
0 | n (%) | 2 (20.0) | 1 (11.1) | 1 (10.0) | 0 (0.0) | 2 (20.0) | 1 (9.1) | |
1 | n (%) | 4 (40.0) | 3 (33.3) | 7 (70.0) | 6 (54.5) | 6 (60.0) | 7 (63.6) | |
2 | n (%) | 4 (40.0) | 3 (33.3) | 2 (20.0) | 5 (45.5) | 2 (20.0) | 2 (18.2) | |
3 | n (%) | 0 (0.0) | 2 (22.2) | 0 (0.0) | 0 (0.0) | 0 (0.0) | 1 (9.1) | |
Missing | n | 0 | 1 | 0 | 0 | 0 | 0 | |
Income (USD) | 0.317 | |||||||
0 | n (%) | 1 (11.1) | 1 (10.0) | 2 (28.6) | 0 (0.0) | 1 (10.0) | 2 (20.0) | |
1 | n (%) | 4 (44.4) | 4 (40.0) | 3 (42.9) | 9 (90.0) | 6 (60.0) | 7 (70.0) | |
2 | n (%) | 4 (44.4) | 5 (50.0) | 2 (28.6) | 1 (10.0) | 3 (30.0) | 1 (10.0) | |
Missing | n | 1 | 0 | 3 | 1 | 0 | 1 | |
Type of domicile | 0.774 | |||||||
1 | n (%) | 1 (10.0) | 1 (10.0) | 2 (20.0) | 2 (18.2) | 1 (10.0) | 0 (0.0) | |
2 | n (%) | 9 (90.0) | 9 (90.0) | 8 (80.0) | 9 (81.8) | 9 (90.0) | 11 (100.0) | |
Cigarette smoking | n (%) | 0 (0.0) | 0 (0.0) | 0 (0.0) | 0 (0.0) | 3 (30.0) | 2 (18.2) | 0.030 |
Alcohol use | n (%) | 3 (30.0) | 2 (20.0) | 1 (10.0) | 1 (9.1) | 4 (40.0) | 3 (27.3) | 0.550 |
Antihypertensive before ICH | n (%) | 4 (40.0) | 7 (70.0) | 5 (50.0) | 7 (63.6) | 5 (50.0) | 7 (63.6) | 0.777 |
Anti-platelet before ICH | n (%) | 0 (0.0) | 1 (10.0) | 0 (0.0) | 0 (0.0) | 0 (0.0) | 0 (0.0) | 0.645 |
Anti-coagulant before ICH | n (%) | 0 (0.0) | 0 (0.0) | 0 (0.0) | 0 (0.0) | 0 (0.0) | 0 (0.0) | >0.999 |
Anti-glycemics before ICH | n (%) | 1 (10.0) | 0 (0.0) | 0 (0.0) | 0 (0.0) | 1 (10.0) | 0 (0.0) | 0.471 |
Statins before ICH | n (%) | 0 (0.0) | 0 (0.0) | 0 (0.0) | 0 (0.0) | 0 (0.0) | 0 (0.0) | >0.999 |
Antihypertensive after ICH | n (%) | 10 (100.0) | 10 (100.0) | 8 (80.0) | 11 (100.0) | 9 (90.0) | 11 (100.0) | 0.164 |
Anti-diabetics after ICH | n (%) | 1 (10.0) | 1 (10.0) | 0 (0.0) | 3 (27.3) | 2 (20.0) | 2 (18.2) | 0.688 |
CCB | n (%) | 8 (80.0) | 8 (80.0) | 7 (70.0) | 7 (63.6) | 8 (80.0) | 9 (81.8) | 0.938 |
ARB/ACE-I | n (%) | 10 (100.0) | 7 (70.0) | 7 (70.0) | 7 (63.6) | 7 (70.0) | 11 (100.0) | 0.073 |
DIURETICS | n (%) | 6 (60.0) | 8 (80.0) | 5 (50.0) | 1 (9.1) | 4 (40.0) | 4 (36.4) | 0.029 |
BETABLOCKER | n (%) | 5 (50.0) | 5 (50.0) | 3 (30.0) | 3 (27.3) | 4 (40.0) | 5 (45.5) | 0.866 |
VASODILATOR | n (%) | 4 (40.0) | 1 (10.0) | 3 (30.0) | 3 (27.3) | 1 (10.0) | 4 (36.4) | 0.495 |
MRA | n (%) | 1 (10.0) | 1 (10.0) | 0 (0.0) | 2 (18.2) | 1 (10.0) | 0 (0.0) | 0.779 |
CENTRALLY ACTING | n (%) | 1 (10.0) | 1 (10.0) | 1 (10.0) | 2 (18.2) | 1 (10.0) | 1 (9.1) | >0.999 |
BMI (Month 0) | Mean (SD) | 26 (5.8) | 25 (3.4) | 24 (4.3) | 24 (5.7) | 25 (7.5) | 31 (24.9) | 0.899 |
WAIST-TO-HIP RATIO (Month 0) | Mean (SD) | 1 (0.1) | 1 (0.1) | 1 (0.1) | 1 (0.1) | 1 (0.1) | 1 (0.1) | 0.886 |
Baseline systolic BP (Month 0) | Mean (SD) | 151 (16.0) | 154 (22.7) | 154 (32.6) | 157 (22.0) | 165 (32.2) | 163 (18.5) | 0.727 |
Baseline diastolic BP (Month 0) | Mean (SD) | 98 (12.2) | 97 (15.5) | 98 (19.0) | 95 (18.4) | 103 (27.9) | 96 (11.6) | 0.994 |
Antihypertensive meds) | Median (Minimum,Maximum) | 4 (2,5) | 3 (2,5) | 3 (0,5) | 2 (1,4) | 3 (0,5) | 3 (2,4) | 0.278 |
Random blood glucose (Month 0) | Mean (SD) | 6 (2.2) | 7 (2.7) | 6 (1.1) | 7 (2.4) | 6 (1.6) | 7 (1.7) | 0.842 |
Missing | n | 1 | 0 | 0 | 0 | 0 | 0 | |
MOCA (Month 0) | Mean (SD) | 18 (9.3) | 15 (6.3) | 15 (7.5) | 17 (6.0) | 16 (6.8) | 16 (5.2) | 0.886 |
Modified Rankin Score (Month 0) | Mean (SD) | 2 (1.4) | 2 (1.1) | 2 (1.2) | 2 (0.9) | 3 (1.2) | 2 (0.9) | 0.997 |
NIHSS (Month 0) | Mean (SD) | 2 (3.0) | 3 (5.2) | 4 (9.4) | 2 (3.3) | 3 (3.1) | 2 (3.4) | 0.893 |
1 Kruskal-Wallis rank sum test; Fisher’s exact test |
%>%
df_avert select(
treatment, died, recurrent_stroke, major_adverse_events,
m12_follow_up_done, morisky_m12, tsq_m12, mrs_diff_0_12, moca_diff_3_12, %>%
sbp_diff_0_12, hamd_diff_0_12) ::tbl_summary(
gtsummarytype = list(c(mrs_diff_0_12, tsq_m12, morisky_m12) ~ "continuous"),
by = treatment,
digits = list(
::all_categorical() ~ c(0,1),
gtsummary::all_continuous() ~ c(0,1)),
gtsummarystatistic = list(
::all_categorical() ~ "{n}",
gtsummary::all_continuous() ~ "{mean} ({sd})")
gtsummary%>%
) ::add_p(
gtsummarypvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)) %>%
::bold_labels() %>%
gtsummarymodify_caption(
caption = "**Table 2: Comparison of Study Outcomes By Treatment Allocation**")
Characteristic | Statin 0mg + Aspirin 0mg, N = 101 | Statin 0mg + Aspirin 75mg, N = 101 | Statin 20mg + Aspirin 0mg, N = 101 | Statin 20mg + Aspirin 75mg, N = 111 | Statin 80mg + Aspirin 0mg, N = 101 | Statin 80mg + Aspirin 75mg, N = 111 | p-value2 |
---|---|---|---|---|---|---|---|
All-cause deaths | 1 | 0 | 1 | 0 | 1 | 0 | 0.523 |
Recurrent strokes | 0 | 0 | 0 | 1 | 0 | 1 | >0.999 |
SAE | 1 | 0 | 1 | 1 | 1 | 1 | >0.999 |
Completion of 12 months follow-up | 9 | 10 | 8 | 11 | 9 | 10 | 0.610 |
Adherence scores at month 12 | 0 (0.7) | 0 (0.7) | 0 (0.4) | 0 (0.8) | 0 (1.0) | 0 (0.3) | 0.956 |
Unknown | 1 | 0 | 2 | 0 | 1 | 1 | |
Treatment satisfaction score at month 12 | 53 (0.0) | 53 (2.0) | 53 (1.1) | 53 (0.0) | 53 (1.0) | 53 (0.0) | 0.777 |
Unknown | 1 | 0 | 2 | 0 | 1 | 1 | |
Modified Rankin Score change(0 to 12 months) | 0 (1.1) | -1 (0.8) | 0 (0.9) | -1 (0.7) | -1 (1.2) | -1 (0.9) | 0.877 |
Unknown | 0 | 0 | 1 | 0 | 0 | 1 | |
MOCA (3 to 12 months) | 3 (2.7) | 4 (3.6) | 3 (2.8) | 4 (4.9) | 4 (4.1) | 4 (2.3) | 0.970 |
Unknown | 1 | 2 | 4 | 0 | 1 | 3 | |
Sytstolic Blood Pressure (3 to 12 months) | -12 (18.3) | -13 (23.3) | -20 (30.4) | -18 (19.7) | -12 (16.1) | -9 (16.5) | 0.894 |
Unknown | 1 | 0 | 2 | 0 | 1 | 1 | |
Hamd change (0 to 12 months) | -5 (2.6) | -3 (2.6) | -2 (1.8) | -3 (2.7) | -4 (2.5) | -4 (2.9) | 0.322 |
Unknown | 1 | 0 | 2 | 0 | 1 | 1 | |
1 n; Mean (SD) | |||||||
2 Fisher’s exact test; Kruskal-Wallis rank sum test |
<-
tbl_mrs %>%
df_avert select(treatment, mrs_m0, mrs_m12) %>%
pivot_longer(
cols = c(mrs_m0, mrs_m12), names_to = "mth", values_to = "mrs") %>%
mutate(mth = str_extract(mth, "m\\d+$")) %>%
tbl_strata(
strata = treatment,
.tbl_fun =
~ .x |>
tbl_summary(
by = mth,
missing = "no",
type = mrs ~ "continuous",
statistic = mrs ~ "{mean}({sd})",
digits = mrs ~ c(1,1)) |>
add_p(
~ "t.test",
mrs pvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)),
bold_p(),
.header = "**{strata}**, N = {n}"
)
<-
tbl_moca %>%
df_avert select(treatment, moca_m0, moca_m12) %>%
pivot_longer(
cols = c(moca_m0, moca_m12), names_to = "mth", values_to = "moca") %>%
mutate(mth = str_extract(mth, "m\\d+$")) %>%
tbl_strata(
strata = treatment,
.tbl_fun =
~ .x |>
tbl_summary(
by = mth,
missing = "no",
type = moca ~ "continuous",
statistic = moca ~ "{mean}({sd})",
digits = moca ~ c(1,1)) |>
add_p(
~ "t.test",
moca pvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)),
bold_p(),
.header = "**{strata}**, N = {n}"
)
<-
tbl_sbp %>%
df_avert select(treatment, sbp_m0, sbp_m12) %>%
pivot_longer(
cols = c(sbp_m0, sbp_m12), names_to = "mth", values_to = "sbp") %>%
mutate(mth = str_extract(mth, "m\\d+$")) %>%
tbl_strata(
strata = treatment,
.tbl_fun =
~ .x |>
tbl_summary(
by = mth,
missing = "no",
type = sbp ~ "continuous",
statistic = sbp ~ "{mean}({sd})",
digits = sbp ~ c(1,1)) |>
add_p(
~ "t.test",
sbp pvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)),
bold_p(),
.header = "**{strata}**, N = {n}"
)
<-
tbl_dbp %>%
df_avert select(treatment, dbp_m0, dbp_m12) %>%
pivot_longer(
cols = c(dbp_m0, dbp_m12), names_to = "mth", values_to = "dbp") %>%
mutate(mth = str_extract(mth, "m\\d+$")) %>%
tbl_strata(
strata = treatment,
.tbl_fun =
~ .x |>
tbl_summary(
by = mth,
missing = "no",
type = dbp ~ "continuous",
statistic = dbp ~ "{mean}({sd})",
digits = dbp ~ c(1,1)) |>
add_p(
~ "t.test",
dbp pvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)),
bold_p(),
.header = "**{strata}**, N = {n}"
)
<-
tbl_hamd %>%
df_avert select(treatment, hamd_m0, hamd_m12) %>%
pivot_longer(
cols = c(hamd_m0, hamd_m12), names_to = "mth", values_to = "hamd") %>%
mutate(
mth = str_extract(mth, "m\\d+$")) %>%
tbl_strata(
strata = treatment,
.tbl_fun =
~ .x |>
tbl_summary(
by = mth,
missing = "no",
type = hamd ~ "continuous",
statistic = hamd ~ "{mean}({sd})",
digits = hamd ~ c(1,1)) |>
add_p(
~ "t.test",
hamd pvalue_fun = function(x) gtsummary::style_pvalue(x, digits = 3)),
bold_p(),
.header = "**{strata}**, N = {n}"
)
tbl_stack(tbls = list(tbl_mrs, tbl_moca, tbl_sbp, tbl_dbp, tbl_hamd))
Characteristic | Statin 0mg + Aspirin 0mg, N = 20 | Statin 0mg + Aspirin 75mg, N = 20 | Statin 20mg + Aspirin 0mg, N = 20 | Statin 20mg + Aspirin 75mg, N = 22 | Statin 80mg + Aspirin 0mg, N = 20 | Statin 80mg + Aspirin 75mg, N = 22 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
m0, N = 101 | m12, N = 101 | p-value2 | m0, N = 101 | m12, N = 101 | p-value2 | m0, N = 101 | m12, N = 101 | p-value2 | m0, N = 111 | m12, N = 111 | p-value2 | m0, N = 101 | m12, N = 101 | p-value2 | m0, N = 111 | m12, N = 111 | p-value2 | |
mrs | 2.4(1.4) | 2.0(1.8) | 0.593 | 2.3(1.1) | 1.5(1.1) | 0.112 | 2.4(1.2) | 2.0(1.7) | 0.569 | 2.5(0.9) | 1.8(1.0) | 0.135 | 2.5(1.2) | 1.9(2.0) | 0.422 | 2.4(0.9) | 1.5(1.0) | 0.051 |
moca | 17.6(9.3) | 25.8(3.2) | 0.023 | 14.5(6.3) | 25.0(2.7) | <0.001 | 15.0(7.5) | 24.0(2.7) | 0.004 | 16.9(6.0) | 22.3(5.9) | 0.048 | 15.9(6.8) | 23.6(3.5) | 0.007 | 16.0(5.2) | 24.1(3.7) | <0.001 |
sbp | 151.3(16.0) | 137.0(14.9) | 0.060 | 154.1(22.7) | 140.9(16.8) | 0.158 | 154.2(32.6) | 138.9(14.2) | 0.205 | 156.5(22.0) | 138.6(8.7) | 0.026 | 165.1(32.2) | 143.3(13.8) | 0.074 | 162.7(18.5) | 156.9(22.6) | 0.528 |
dbp | 98.2(12.2) | 85.6(10.7) | 0.028 | 97.1(15.5) | 87.1(8.8) | 0.097 | 97.8(19.0) | 85.0(9.9) | 0.087 | 94.8(18.4) | 84.1(8.8) | 0.102 | 102.9(27.9) | 86.2(12.8) | 0.113 | 96.3(11.6) | 98.7(16.7) | 0.706 |
hamd | 6.5(4.2) | 0.9(1.4) | 0.002 | 4.6(3.0) | 1.4(1.2) | 0.009 | 5.3(3.8) | 2.0(1.4) | 0.026 | 4.9(2.2) | 2.3(2.5) | 0.016 | 5.3(3.1) | 1.4(1.6) | 0.004 | 5.7(3.0) | 1.8(1.5) | 0.001 |
1 Mean(SD) | ||||||||||||||||||
2 Welch Two Sample t-test |