# Negative relationship but regression analytics gives positive correlation coefficient

I've been trying to look for a question like this but I simply see positive correlation coefficients. I'm new to this so forgive me if I'm not really familiar with the terms.

I'm doing an analysis on the proportion of females in national parliament and mortality rate. I was expecting a negative correlation coefficient since the relationship is negative, however it came out positive in my regression data analytics from Excel. Did I do something wrong?  As you can see the R^2 = 0.7208 but the trend line is going down so I'm quite confused. I hope someone can clarify this for me, thank you!

• Are you surprised that R^2 is positive? I think you've answered your own question while asking it! Jan 20, 2020 at 23:47
• R^2 is the squared correlation. It cannot be negative - a negative correlation, squared, makes a positive R^2 (as does a positive correlation). You need to look at r (lower case). Jan 21, 2020 at 3:22

The correlation coefficient is $$r$$. $$R^2$$ is the square of $$r$$, and it is of course always positive, regardless of the sign of $$r$$. Taking the square root gives that $$r= \pm 0.8489$$, and since the relationship is negative, you can conclude that $$r = -0.8489$$.

• Ohhh thank goodness! I was worried for awhile there! Thank you so much for your answer. Hahaha.
– Yena
Jan 19, 2020 at 22:40
• Upvoted for speed of correct reply and clarity. Jan 20, 2020 at 1:21

For additional context, $$R^2$$ is known as the coefficient of determination (often also called Pearson's R-squared) https://en.wikipedia.org/wiki/Coefficient_of_determination

$$R^2$$ is a common measure of goodness of fit - it tells you something about how well your models predicts the test data. R in this interpretation is the correlation between the predicted y values (according to the line of best fit) and the test y values.

In the single independent variable case, this is the same as the correlation between the independent and dependent variables, but this is not true in the multi regression.

The other answers are correct, but I just wanted to add more detail in case you are interested in what is meant by these numbers.

Suppose you were to draw a horizontal line on your graph which represented the average value of y, ie the average of the mortality rates in your data. For your example, 9.02 is approximately the average mortality. If you didn't have an explanatory variable (the proportion of women in parliament), the average of the mortality values (the horizontal line) would actually be your best guess for predicting a countries mortality. After all, if you didn't have any other data than the mortality values, what else could you do?

The purpose of regression is to take one or more explanatory variables (the x variables) and find a better predictor of mortality for the country than simply the average of the mortality values. In other words, for your example, what you are saying is that if you know the countries proportion of women in parliament, you can make a much better guess of that countries mortality than simply saying "9.02". You instead give the value found on the dashed line. The value given by the dashed line is a much better estimate than simply using the horizontal line (the average value)!

Thus, R^2 represents a percentage which can be thought of in this way:

We can see there is a variation in the values of mortality for all the countries. How much of that variation in mortality values can we explain by using the dashed line instead of the horizontal line? In this case, we can explain about 72% of the variation in mortality values by also knowing the proportion of women in parliament. This is good, but not quite as good as an R^2 value of 1. If it was 1 then we would know exactly what the mortality value should be for each country by knowing the proportion of women in parliament, because the amount of variation explained would be 100%! Which is to say, if all the points fell on the dashed line there would be no variation from the points to the line.

Further analysis and Conclusion

Suppose that in addition to having the proportion of women in parliament, you also had a variable which represented the proportion of people in the country who are in poverty. One would suspect that using both of those variables together would give you an even better prediction of mortality rate for a country than either alone! And that's what regression hopes to accomplish. You consider all things which have a positive or negative correlation to the outcome variable of interest and come up with an equation that relates these explanatory variables to the outcome. As you add in more and more explanatory variables, you will find that you explain more and more of the variation in your outcome, which is to say your R^2 will be closer and closer to 1.