cs_results <- claus_2020 |>
cs_percentage(
id,
time,
hamd,
pre = 1,
post = 4,
pct_improvement = 0.3
)
cs_results
summary(cs_results)
plot(cs_results)
# You can set different thresholds for improvement and deterioration
cs_results_2 <- claus_2020 |>
cs_percentage(
id,
time,
hamd,
pre = 1,
post = 4,
pct_improvement = 0.3,
pct_deterioration = 0.2
)
cs_results_2
summary(cs_results_2)
plot(cs_results_2)
# You can group the analysis by providing a group column from the data
cs_results_grouped <- claus_2020 |>
cs_percentage(
id,
time,
hamd,
pre = 1,
post = 4,
pct_improvement = 0.3,
group = treatment
)
cs_results_grouped
summary(cs_results_grouped)
plot(cs_results_grouped)
# The analyses can be performed for positive outcomes as well, i.e., outcomes
# for which a higher value is beneficial
cs_results_who <- claus_2020 |>
cs_percentage(
id,
time,
who,
pre = 1,
post = 4,
pct_improvement = 0.3,
better_is = "higher"
)
cs_results_who
summary(cs_results_who)
plot(cs_results_who)
plot(cs_results_who, show = category)
Run the code above in your browser using DataLab