Load the packagehce and check the version:
For citing the package, runcitation("hce")(Gasparyan 2025).
Themaraca plot (named for its visual similarity to themusical instrument) has been recently introduced(Karpefors, Lindholm, and Gasparyan 2023) forthe visualization of HCEs, which combine multiple dichotomous outcomeswith a single continuous endpoint. The maraca plot visualizes thecontribution of components of a hierarchical composite endpoint (HCE)over time. It is formed by adjoining, from left to right, uniformlyscaled Kaplan–Meier plots of times to each dichotomous outcome amongthose without more severe outcomes, with a superimposed box/violin plotof the continuous outcome.
The maraca plot is implemented in themaraca package(Martin Karpefors, Samvel B. Gasparyan, andMonika Huhn 2024), which depends on thehce package.Themaraca package includes aplot.hce()method to visualize objects of typehce. Consider thefollowing example:
library(maraca)Rates_A<-10Rates_P<-15dat<-simHCE(n =1000,n0 =500,TTE_A = Rates_A,TTE_P = Rates_P,CM_A =0.2,CM_P =0,seed =2,shape =0.35)plot(dat)The example illustrates a maraca plot with a single dishotomousoutcome combined with a continuous outcome. The dischotmous outcomesover time are simulated from a Weibull distribution withshape = 0.35 in both treatment groups. Therate parameter in the active group is 10 per 100 patientsper year, and 15 in the control group (100 patients per year is thedefault value).