# Visualization of HCE using maraca plots

#### Samvel B. Gasparyan

## Visualization

### Setup

Load the package `hce` and check the version

    library(hce)
    packageVersion("hce")
    #> [1] '0.6.0'

For citing the package run `citation("hce")` (Gasparyan 2024).

### The maraca plot

The maraca plot (named after its visual similarity to its namesake musical instrument) has been recently introduced (Karpefors, Lindholm, and Gasparyan 2023) for visualization of HCEs which combine multiple dichotomous outcomes with a single continuous endpoint. The maraca plot visualizes the contribution of components of a hierarchical composite endpoint (HCE) over time. It is formed by end-to-end adjoining, from left to right by declining severity of uniformly scaled Kaplan–Meier plots of times to each dichotomous outcome among those without more severe outcomes, with superimposed box/violin plot of the continuous outcome.

The maraca plot is implemented in the package Martin Karpefors, Samvel B. Gasparyan, and Monika Huhn (2023) which depends on the package `hce`. The maraca package has a `plot.hce()` method to visualize objects of the type `hce`. Consider the following example.

    library(maraca)
    Rates_A <- 10
    Rates_P <- 15
    dat <- 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)

## References

Gasparyan, Samvel B. 2024. hce: Design and Analysis of Hierarchical Composite Endpoints. CRAN: The Comprehensive R Archive Network, R Package, Version 0.6.0. https://CRAN.R-project.org/package=hce.
Karpefors, Martin, Daniel Lindholm, and Samvel B Gasparyan. 2023. “The Maraca Plot: A Novel Visualization of Hierarchical Composite Endpoints.” Clinical Trials 20 (1): 84–88. https://doi.org/10.1177/17407745221134949.
Martin Karpefors, Samvel B. Gasparyan, and Monika Huhn. 2023. Maraca: The Maraca Plot: Visualization of Hierarchical Composite Endpoints in Clinical Trials. https://CRAN.R-project.org/package=maraca.