cs_results <- antidepressants |>
cs_percentage(
patient,
measurement,
pre = "Before",
mom_di,
pct_improvement = 0.4
)
# Plot the results "as is"
plot(cs_results)
# Change the axis labels
plot(cs_results, x_lab = "Before Intervention", y_lab = "After Intervention")
# Show the individual categories
plot(cs_results, show = category)
# Show a specific category
plot(cs_results, show = improved)
# Show groups as specified in the data
cs_results_grouped <- antidepressants |>
cs_percentage(
patient,
measurement,
pre = "Before",
mom_di,
pct_improvement = 0.4,
group = condition
)
plot(cs_results_grouped)
# To avoid overplotting, generic ggplot2 code can be used to facet the plot
library(ggplot2)
plot(cs_results_grouped) +
facet_wrap(~ group)
# Adjust the transparency of individual data points
plot(cs_results, point_alpha = 0.3)
# Adjust the fill and transparency of the "unchanged" (PCC) region
plot(cs_results, pct_fill = "firebrick", pct_alpha = 0.2)
# Control the overplotting
plot(cs_results, overplotting = 0.1)
# Or adjust the axis limits by hand
plot(cs_results, lower_limit = 0, upper_limit = 80)
Run the code above in your browser using DataLab