Create a scatterplot of your sample in which the x-axis maps to the pre-scores, the y-axis maps to the post-scores and several graphical elements (lines, colors) allow you to gain a quick overview about reliable changes in these scores. An example of this kind of plot is Figure 2 of Jacobson & Truax (1991). Jacobson-Truax classification (represented in point colors) is always based on `recovery_cutoff`, not on any other plotted horizontal line (e.g. mid of means).
rciplot(
data,
pre = NULL,
post = NULL,
group = NULL,
reliability = NULL,
reliable_change_alpha = 0.05,
recovery_cutoff = NULL,
classification_method = "recovery cutoff",
show_classification_counts = TRUE,
show_classification_percentages = TRUE,
higher_is_better = TRUE,
pre_jitter = 0,
post_jitter = 0,
opacity = 0.5,
size_points = 1,
size_lines = 0.3,
draw_meanmid_line = FALSE,
draw_2sd_functional_line = FALSE,
draw_2sd_dysfunctional_line = FALSE,
mean_functional = NULL,
mean_dysfunctional = NULL,
sd_functional = 1,
sd_dysfunctional = 1
)A list containing:
higher_is_better | Exactly the input parameter higher_is_better |
reliable_change | Pre-Post differences larger than this difference are regarded reliable |
plot | ggplot2 scatter plot analogous to Figure 2 of Jacobson & Truax (1991) |
categorization | List containing categorization of all samples given in data.
Thus, has as many items as data has rows. |
Dataframe containing all relevant data
Name of the column in `data` containing pre values
Name of the column in `data` containing post values
Name of column by which cases are to be grouped (controls shape of scatter plot points)
Reliability of the used test / instrument
Probability of alpha error for the calculation of the critical distance which is the minimum pre-post difference to be regarded statistically significant
Test score below which individuals are considered healthy / recovered
What cutoff value is to be used to classify individuals into healthy / unhealthy individuals? Possible values: "recovery cutoff" = the so-named function parameter, "mid of means" = the exact numeric mid between the two function parameters mean_functional and mean_dysfunctional, "2 sd dysfunctional" = everybody with a score higher than 2 SD above the dysfunctional group mean is healthy "2 sd functional" = everybody with a score higher than 2 SD below the functional group mean is healthy
If TRUE, show number of cases for each classification (e.g. reliable improvement, no reliable change, ...) in legend
Expanding on `show_classification_counts`.If TRUE, show the respective percentage of the whole sample each classification makes up.
TRUE if higher values indicate a remission / healthy individual. FALSE if higher values indicate worse health.
Jitter factor to apply to pre values
Jitter factor to apply to post values
Alpha value of scatter plot points
Size of scatter plot points.
Size (thickness) of lines in plot.
Draw a horizontal line indicating the middle between the population means for a functional (healthy) population and a dysfunctional (diseased) population, described as criterion *c* in Jacobson & Truax (1991).
Draw a horizontal line indicating a cutoff at a 2 SD distance from `mean_functional`, described as criterion *b* in Jacobson & Truax (1991).
Draw a horizontal line indicating a cutoff at a 2 SD distance from `mean_dysfunctional`, described as criterion *a* in Jacobson & Truax (1991).
Required if `draw_meanmid_line = T` or `draw_2sd_[dys]functional_line = T`. Mean test score of the functional population.
Required if `draw_meanmid_line = T` or `draw_2sd_[dys]functional_line`. Mean test score of the dysfunctional population.
Optional for `draw_meanmid_line = T`. Standard deviation of the functional population.
Optional for `draw_meanmid_line = T`. Standard deviation of the dysfunctional population.
# Using example data from `sample_data.rda` to recreate Figure 2 of
# Jacobson & Truax (1991):
rciplot(
data = sample_data,
pre = 'pre_data',
post = 'post_data',
reliability = 0.88,
recovery_cutoff = 104,
opacity = 1
)
Run the code above in your browser using DataLab