knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
In this tutorial, we will explore the percentage-change approach to clinical significance using R. The percentage-change approach is centered around a predefined relative change, expressed in percent, that needs to be achieved in order to inferr a clinically significant change. If, for instance, the percentage-change cutoff is believed to be 30%, and a patient demonstrated a score change of at least 30%, then this change is believed to be clinically significant. We will be working with the antidepressants
and claus_2020
datasets, and the cs_percentage()
function to demonstrate various aspects of this approach.
Before we begin, ensure that you have the following prerequisites in place:
First, let's have a look at the datasets, which come with the package.
library(clinicalsignificance)
antidepressants
claus_2020
The cs_percentage()
function is a tool for assessing clinical significance. It allows you to determine if changes in patient outcomes are practically significant. Let's go through the basic usage and some advanced features of this function.
Let's start with a basic clinical significance distribution analysis using the antidepressants
dataset. We are interested in the Mind over Mood Depression Inventory (mom_di
) measurements and want to set the percentage cutoff for an improvement to a value of 0.3.
pct_results <- antidepressants |> cs_percentage( id = patient, time = measurement, outcome = mom_di, pct_improvement = 0.3 )
Sometimes, as in the example above, you may encounter warnings when using this function. You can turn off the warning by explicitly specifying the pre-measurement time point using the pre parameter. This can be helpful when your data lacks clear pre-post measurement labels.
# Turning off the warning by specifying pre-measurement time pct_results <- antidepressants |> cs_percentage( id = patient, time = measurement, outcome = mom_di, pre = "Before", pct_improvement = 0.5 )
Here's a breakdown of the code:
patient
, measurement
, and mom_di
represent the patient identifier, assessment time points, and HAM-D scores, respectively.pre
and post
specify the time points for the pre and post-assessment.pct_improvement
sets the percentage change threshold for improvement to 30%.# Print the results pct_results # Get a summary summary(pct_results)
Visualizing the results can help you better understand the clinical significance of changes in patient outcomes.
# Plot the results plot(pct_results) # Show clinical significance categories plot(pct_results, show = category)
When working with data that has more than two measurements, you must explicitly define the pre and post measurement time points using the pre
and post
parameters.
# Clinical significance distribution analysis with more than two measurements cs_results <- claus_2020 |> cs_percentage( id, time, bdi, pre = 1, post = 4, pct_improvement = 0.3 ) # Display the results cs_results summary(cs_results) plot(cs_results)
You can set different thresholds for improvement and deterioration by adjusting the pct_deterioration
argument Let's see an example:
# Clinical significance analysis with different improvement and deterioration thresholds cs_results_2 <- claus_2020 |> cs_percentage( id = id, time = time, outcome = hamd, pre = 1, post = 4, pct_improvement = 0.3, pct_deterioration = 0.2 ) # Display the results cs_results_2 # Visualize the results plot(cs_results_2)
You can also perform a grouped analysis by providing a group column from the data. This is useful when comparing treatment groups or other categories.
cs_results_grouped <- claus_2020 |> cs_percentage( id = id, time = time, outcome = hamd, pre = 1, post = 4, pct_improvement = 0.3, group = treatment ) # Display and visualize the results cs_results_grouped plot(cs_results_grouped)
In some cases, higher values of an outcome may be considered better. You can specify this using the better_is
argument. Let's see an example with the WHO-5 score where higher values are considered better.
# Clinical significance analysis for outcomes where higher values are better cs_results_who <- claus_2020 |> cs_percentage( id = id, time = time, outcome = who, pre = 1, post = 4, pct_improvement = 0.3, better_is = "higher" ) # Display the results cs_results_who
In this tutorial, you've learned how to perform clinical significance analysis using the cs_percentage()
function in R. This analysis may be crucial for determining the practical importance of changes in patient outcomes. By adjusting thresholds and considering grouped analyses, you can gain valuable insights for healthcare and clinical research applications.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.