# Meaning of this scatter plot

I have two types of treatment, a and b, and I want to know if one is more painful than the other. I can apply both treatments to each patient, and ask for the pain experienced with each on a scale 0-10.

> head(df_long)
n_patient type pain
1    a    2
1    b    1
2    a    7
2    b    2
3    a    1
3    b    2


Here are the results for a survey with 20 patients. I can test for normality of the distributions. I can test for significant differences in mean pain, etc. I can also make a scatter plot with points associated to patients, (x, y)=(pain_a, pain_b), which, it seems to me, will contain useful information.

However, I'm having trouble interpreting the plot. Patients have different pain tolerances. It seems natural that a patient giving a high pain score to treatment "a" will tend to rate highly the other one (at least for a certain range of pain similarity). In this plot, a positive correlation means that as patient's pain tolerance decreases, pain ratings for both treatments increase. A perfect correlation of 1 would mean that pain experienced in both treatments is the same. In my case, I obtain the following results:

      > cor.test(pain_a, pain_b,
alternative = "greater",
method = "pearson")

Pearson's product-moment correlation

data:  pain_a and pain_b
t = 2.1551, df = 18, p-value = 0.02247
alternative hypothesis: true correlation is greater than 0
95 percent confidence interval:
0.08914837 1.00000000
sample estimates:
cor
0.452883

> lm(b ~ a, df)

Call:
lm(formula = b ~ a, data = df)

Coefficients:
(Intercept)            a
1.0746       0.4102


How do I read this r = 0.45? I would say that it's relevant that this r is smaller than 1, but I don't know the formal way of stating a conclusion out of this, or if this plot is just talking about pain tolerance in general, and it's not useful for distinguishing between treatments.

EDITED

Following Bernhard's answer, one thing I can do is changing the basis of my problem, to look at the total pain experienced by the patient, $sum = a + b$, and the difference in pain, $diff = b - a$. Now variable $diff$ is restricted to the domain $[-sum, sum]$ for each $sum$ pain experienced by each patient, and the correlation and linear model that can be extracted from the scatter plot make much more sense.

For my invented example data though, I don't get any relevant results

> cor.test(pain_sum, pain_diff, method = "pearson")

Pearson's product-moment correlation

data:  pain_sum and pain_diff
t = -0.47175, df = 18, p-value = 0.6428
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.5272479  0.3490807
sample estimates:
cor
-0.1105114

> lm(diff ~ sum, df_sd)

Call:
lm(formula = diff ~ sum, data = df_sd)

Coefficients:
(Intercept)          sum
-1.050       -0.068


But I think this is one useful thing to do in this type of scenarios. Thanks everyone for the answers!

• When you have an ordered scale 0 to 10, and it's not a measurement but a personal score, it's not clear that normal distributions are a good reference, if only because (although not only because) the scores are discrete and bounded. Assuming that you have, or should have, many more than 20 patients, then you need a graphic that shows the number of data points for each pair of scores, such as a two-way bar chart. – Nick Cox May 29 '18 at 16:02
• your treatment groups should be between subjects and not within subjects. I am sure you can apply the treatment to the same patients but you are contaminating your results by doing this. If I was looking at this study I would reject whatever claims you were making. The correlation between the two treatment groups means nothing if all patients received treatment a before b. – knk May 29 '18 at 16:07
• Nick, I'm not assuming normality at any moment, not necessary for the content of the question; in fact, for such data, which as you're saying is personal scoring, typically you want to do non-parametric test. Although, in the literature people tend to say that if you have this type of data, and it's not crazy away from normal distributions, then parametric tests will serve you just as well. Anyway, this is off-topic from the original question. Also, I hadn't thought about looking two-way chart, thanks for the tip, I appreciate it. – Santiago May 30 '18 at 9:49
• knk, I haven't described at all the specific scenario we are dealing with here; I can imagine certain situations in which this paired measurement is a horrible idea, and some for which is not. I hadn't thought at all in this possibility here, this is not my experiment, I'm just helping with the analysis, and I will ask them for the protocol the used to test one treatment and then the other, if it was randomized, etc. Also, I could make predictions with only the first treatment used, reducing my data to half, to see differences. Thanks for the comment. – Santiago May 30 '18 at 9:53
• Also, for the sake of giving more importance to the scatter plot question itself, let's think of this scenario: A cooking contest, two teams a and b, 20 people jury, they test both meals in random order, and rate them from 0 to 10. – Santiago May 30 '18 at 9:56

The plot as such is useful; the linear regression and the correlation coefficient are not. You might instead consider drawing a line according to the function $y(x)=x$ of $a=b$ in the scatter plot so that you can see which dots are above and which below the line, thus indicating more or less pain in $b$. The $a=b$ line depicts equal pain in both conditions. Also, this plot has a lot of potential for overplotting (many points on top of each other). ggplot2 has a number of ways to address that. geom_count is but one example.

However, you might want to look into mean-difference plots, a.k.a. Bland-Altman plots for an often superior alternative to the simple scatter plot:

# Edit after Edit of the question

Following my answer you came up with an edit, where you plotted the differences as a function of the sum (instead of the mean) of the pains and state, that you do not get any results from that. You may not get any results from correlation, but you get an interesting result from the plot: You can now easily see, that the difference between the pains is almost always negative, which means, that $b$ is associated with less pain than $a$. You can also see that this is true for probands with low pain scores as with probands with middle or high pain scores. The linear regression starts with a negative intercept at -1.05 and then drops even further with higher sums. You can conclude, that the prediction line is negative (meaning $a$ being more painfull) over the whole range of sums. That is some new information, we did not have before. You will need summary(lm(diff ~ sum, df_sd)) to see, whether this is significant. I cannot think of any value of the dashed lines through the origin. One of them follows the advice I gave for the original scatter plot, not for the mean-differences plot.

Again: You appear to have $20$ probands but only $17$ dots in your plot. This comes by overplotting and you should do something against it (ich geom_count is not to your taste, how about a sunflower plot?

• Thank you for helping with spelling an punctuation! Very much appreciated. – Bernhard May 29 '18 at 15:26
• Very interesting, this helps me very much to get back on track. Thanks a lot! – Santiago May 29 '18 at 15:29
• I upvoted your answer as helpful. Plotting difference versus mean is a good idea. Bland and Altman are clear that they didn't invent these plots, and the name was supplied by others. Bland and Altman deserve much credit for their work, but difference-mean or mean-difference plots is a clearer term, especially outside medical statistics. They go back some decades earlier. – Nick Cox May 29 '18 at 15:30
• ... and someone downvoted. That was not explained or constructive. – Nick Cox May 29 '18 at 16:03
• @NickCox Unexplained downvotes happen and should not be reason to spend too much thought on. As for naming Bland-Altman-plots: The questions seems to come from a medical background and we love to name things after people in medicine. Sometimes the same thing after different people in different countries. – Bernhard May 30 '18 at 6:55

Although the Pearson correlation coefficient $r$ can be great for assessing the direction and strength of the relationship between two variables (e.g. pain scores for treatment $a$ and for treatment $b$), it does not have as contextual of a meaning as the coefficient of determination $r^2$.

The coefficient of determination $r^2=.45^2=.2025$ tells us that $20.25$% of the variance in pain score for treatment $a$ can be accounted for by the pain score for treatment $b$ (and vice versa). This interpretation, in a way, may leave room for the influence of variables other than pain tolerance. Perhaps some of the variance in either pain score may be attributed to the impact/quality of the treatment.

• I hadn't thought of making this higher order type of analysis, thanks for the tip!! Very interesting. – Santiago May 30 '18 at 9:57

Pearson correlation coefficient is a measure of the linear correlation between these two variables. Here the coefficient is equal to 0.45, so we do not observe a strong linear correlation between these two variables.

The sample size for running Pearson's r varies according to authors. In most cases it is written that a sample size equal or superior to 25 suffices. Sample size requirements for estimating pearson, kendall and spearman correlations

• The thing here is that a correlation coefficient of 1 would mean that patients experience the same pain with both treatments. I want to see the differences in pain experienced, whether there was more pain associated to one of the two. So here the coefficient wouldn't have the regular interpretation since it is with 1 that you have to compare it, not 0. Any ideas on how to read this result in this particular context? – Santiago May 29 '18 at 15:19
• @Santiago Not so; you would get a correlation of 1 for any linear relationship with positive slope $y = a + bx, b > 0$. A correlation of 1 does not imply agreement, i.e. $a = 0, b = 1$. You're right that correlation is not helpful here, as Bernhard also explains. – Nick Cox May 29 '18 at 15:24
• To summarize differences in pain between the two, there are more useful measures then $r$. How about $mean(\sum{|a-b|})$? – Bernhard May 29 '18 at 15:24
• Apart from Pearson correlation you could count on the Paired Sample T-Test for checking if the mean difference between the two sets of observations is zero as you have it already. – Christos Karatsalos May 29 '18 at 15:30
• My formula above is obviously ridiculous. You get the gist though: Average difference or root-mean-squared difference or anything that is easier to comprehend then correlation indices is superior to summarize and test pain differences. – Bernhard May 30 '18 at 8:34