Primary endpoint
The first few graphs are an attempt to just visualize the data. I started by plotting the Kaplan-Meier Curves for the entire dataset stratified by whether patients received voriconazole or L-AMB.
Code
<-read_xlsx("LABOR_definitivo.xlsx")
data<- survfit(Surv(IA_to_90death_COX, death_3m) ~ terapia_antifungina_categorica , data = data) fit
Code
<-ggsurvplot(
Kmgraph
fit,data = data,
size = 1, # change line size
palette =
c("red", "#2E9FDF"),# custom color palettes
conf.int = TRUE, # Add confidence interval
pval = TRUE, # Add p-value
risk.table = TRUE, # Add risk table
risk.table.col = "strata",# Risk table color by groups
legend.labs =
c("Voriconazole", "Liposomal AMB"), # Change legend labels
risk.table.height = 0.25, # Useful to change when you have multiple groups
ggtheme = theme_bw() # Change ggplot2 theme
)
Kmgraph
These data demonstrate that overall, there is no significant differences (using Log-Rank test) in the rate of 90-day mortality between patients who received L-AMB versus voriconazle, although there seems to be consistent trend favoring voriconazole.
To confirm that the rates of mortality are similarly distributed between the two groups I created population time plots using the casebase package1. each grey line represents the time course of a single patients (the graph is arranged from shortest to longest) with red dots indicating the time of mortality. The distribution in time to death is relatively similar between the two groups although the highest incidence density of mortality appears in the first 25 days for both groups.
Code
library (data.table)
<- popTime(data = data, time="IA_to_90death_COX", event="death_3m")
pt_fungal class(pt_fungal)
[1] "popTime" "data.table" "data.frame"
Code
plot(popTime(pt_fungal, exposure = "terapia_antifungina_categorica"))
I noticed in your Table 1 there was significant differences in the switching to other antifungals between L-AMB and voriconazole patients. I reset the data to day +90 for the three key time variables (LOS in hospital, time to switch and time to death by 90 days) and compared the cumulative incidence curves. We can add length of ICU stay (LIS) later if desired although it will make the graph harder to read. Overall the mortality CID curves and hospital discharge curves are similar. However These data suggest that more than 2/3 of patients who received L-AMB were switched to an alternative antifungal within two weeks. This is consistent with empirical use and best clinical practice for use of the drug to avoid nephrotoxicity,2 but creates a bias in trying to demonstrate “equivalence” of the two treatment approaches. There what you mostly will be testing is a strategy of starting two weeks with liposomal amphotericin B.
Consider a table that describes patients (n=38) with aspergillosis who did not switch from liposomal amphotericin B
Code
library (readxl)
library (ggplot2)
<- read_excel("cif_LAMB.xlsx")
cif_LAMB <- read_excel("cif_voriconazole.xlsx")
cif_voriconazole
<-ggplot () +
graph1geom_area(data = cif_LAMB, aes(x = time, y = Surv), fill = "red", alpha = 0.5) +
geom_area(data = cif_LAMB, aes(x = time, y = Dschg), fill = "green", alpha = 0.5) +
geom_area(data = cif_LAMB, aes(x = time, y = Switch), fill = "blue", alpha = 0.5) +
labs(title = "Amphotericin B", x = "Days since diagnosis", y = "Incidence") + theme_minimal()
<-ggplot () +
graph2geom_area(data = cif_voriconazole, aes(x = time, y = Surv), fill = "red", alpha = 0.5) +
geom_area(data = cif_voriconazole, aes(x = time, y = Dschg), fill = "green", alpha = 0.5) +
geom_area(data = cif_voriconazole, aes(x = time, y = Switch), fill = "blue", alpha = 0.5) +
labs(title = "Voriconazole", x = "Days since diagnosis", y = "Incidence") + theme_minimal()
library("cowplot")
plot_grid(graph1, graph2,
ncol = 2, nrow = 1)
Indeed, if we go back and compare the Kaplan-Meir curves for liposomal AMB and voriconazole in patients who did not switch therapies, we see a significant difference in mortality by the KM curves. However, I recognize this analysis may be biased against L-AMB.
Code
<-ggsurvplot(
Kmgraph2
fit2,data = filtered_data,
size = 1,
palette =
c("red", "#2E9FDF"),
conf.int = TRUE,
pval = TRUE,
risk.table = TRUE,
risk.table.col = "strata",
legend.labs =
c("Voriconazole", "Liposomal AMB"), # Change legend labels
risk.table.height = 0.25, # Useful to change when you have multiple groups
ggtheme = theme_bw() # Change ggplot2 theme
)
Kmgraph2
A comparison of the specific switch in therapy shows marked differences in the types of molecules that were substituted (I do not know specifically which drugs these numerical codes represent).
Code
<-ggplot(vori_df, aes(x = tp_modif_molecola, y = percent, fill = tp_modif_molecola)) +
vori_change geom_bar(stat = "identity") +
labs(title = "Voriconazole", x = "Molecule", y = "Percent") +
theme_minimal() + scale_y_continuous(labels = scales::percent_format(scale = 1), limits = c(0, 100)) +
guides(fill = "none")
<-ggplot(lamb_df, aes(x = tp_modif_molecola, y = percent, fill = tp_modif_molecola)) +
lamb_change geom_bar(stat = "identity") +
labs(title = "Liposomal AMB", x = "Molecule", y = "Percent") +
theme_minimal() + scale_y_continuous(labels = scales::percent_format(scale = 1), limits = c(0, 100)) +
guides(fill = "none")
library("cowplot")
plot_grid(vori_change, lamb_change,
ncol = 2, nrow = 1)
The reasons were switching were also different, it would be pa
Code
<-ggplot(vori_df2, aes(x = tp_modif_motivo, y = percent, fill = tp_modif_motivo)) +
vori_change2 geom_bar(stat = "identity") +
labs(title = "Voriconazole", x = "Molecule", y = "Percent") +
theme_minimal() + scale_y_continuous(labels = scales::percent_format(scale = 1), limits = c(0, 100)) +
guides(fill = "none")
<-ggplot(lamb_df2, aes(x = tp_modif_motivo, y = percent, fill = tp_modif_motivo)) +
lamb_change2 geom_bar(stat = "identity") +
labs(title = "Liposomal AMB", x = "Molecule", y = "Percent") +
theme_minimal() + scale_y_continuous(labels = scales::percent_format(scale = 1), limits = c(0, 100)) +
guides(fill = "none")
library("cowplot")
plot_grid(vori_change2, lamb_change2,
ncol = 2, nrow = 1)