Demographics (Pyramid Chart)


demography |>
  dplyr::mutate(
    Type = as.factor(paste0("Type ", Type)),
    figprev = ifelse(
      Gender == "Females", -1 * Prevalence / 100000, Prevalence / 100000
    ),
    Sex = Gender
  ) |>
  pyramid_chart(
    levelvar = "Type", xvar = "figprev", yvar = "Age",
    groupvar = "Sex", alpha_set = 0.7, chartcolors = colfun()$fig2_colors,
    xlab = "Prevalence (x 100 000)"
  )

How to read

  • The horizontal bars represent the prevalence of each disease type (A or B) in the patient population ranging from 0 to 30 (x 100,000) on the X-axis.

  • The bars are color coded for females (teal) and males (yellow).

  • The bars are stacked according to 5 or 10-year age groups (0-85+ years) specified on the Y-axis.

Key Conclusions:

  • The left chart shows that type A has more females than males, while type B has more males than females.

  • The highest disease prevalence in type A is centered around ages 50-59 years, while centered around ages 70-74 years in type B.

  • The difference in distributions between disease types A and B can impact patient engagement, patient enrollment, and generalization of results.

  • Stratifying the randomization on disease type might be necessary if clinical evidence is needed for disease type B, particularly for younger age groups.