8
$\begingroup$

A website (on page 4) says:

The correlation coefficient is a measure of linear relationship and thus a value of r = 0 does not imply there is no relationship between the variables. For example in the following scatterplot which implies no (linear) correlation however there is a perfect quadratic relationship.

What is the meaning of a perfect quadratic relationship?

$\endgroup$
  • $\begingroup$ I just wanna mention if the distribution is gaussian, that, $r=0$, does imply independence. $\endgroup$ – Media Apr 23 at 4:03
  • 1
    $\begingroup$ What @Media means is when the joint distribution is Gaussian. Uncorrelated univariate Gaussians can be dependent; they just won’t be jointly Gaussian. $\endgroup$ – Dave Apr 23 at 4:11
  • 1
    $\begingroup$ There also is a good description on Wikipedia: en.wikipedia.org/wiki/Pearson_correlation_coefficient $\endgroup$ – Peter Apr 23 at 10:34
6
$\begingroup$

Below I have graphed a linear and quadratic function, $y = 50x + 3$ and $y=5x^2 - 1000$, respectively.

Before calculating anything, we can observe that $x$ and $y$ are related to one another in some form. If we describe in words, we can say for the left plot that as $x$ increases so does $y$.

Similarly, for the right plot, we can say that as $x$ moves towards 0, from the left, $y$ decreases towards 0, and as $x$ moves away from 0 towards the right, $y$ increases.

In fact, $x$ and $y$ have a perfect linear relationship in the left plot, while $x$ and $y$ has a perfect quadratic relationship in the right plot. We can say this because the points, in both plots, lie on the red line

enter image description here

If we take it a step further and calculate the correlation between x and y.

We observe for the linear relationship that $x$ and $y$ has a correlation of 1. In contrast, for the quadratic relation, $x$ and $y$ has a correlation of 0.

Below you will find R code for the plot above, in addition, code to calculate the correlation coefficients

set.seed(1)
library(ggplot2)
library(dplyr)
library(gridExtra)

# Linear Function
linear = function(x){(50)*x + 3 }

# Quadratic Function
quadratic = function(x){(5)*x^2 - 1000}

# Create Data Frame
df = data.frame(x = c(-20:20), 
                y = c(sapply(-20:20, quadratic),sapply(-20:20, linear)), 
                type = c(rep('quadratic',41),rep('linear',41)) )

# Plot Functions
lp = ggplot(subset(df,type == 'linear'), aes(x,y)) + geom_point() + 
  stat_function(fun=linear, colour="red") + ggtitle('Linear Relationship')

qp = ggplot(subset(df,type == 'quadratic'), aes(x,y)) + geom_point() + 
  stat_function(fun=quadratic, colour="red") + ggtitle('Quadratic Relationship')

grid.arrange(lp, qp, ncol=2)


# Calculate correlation coefficients
df %>% filter(type =='linear') %>% select(x,y) %>% cor %>% (function(x){x[1,2]})
df %>% filter(type =='quadratic') %>% select(x,y) %>% cor %>% (function(x){x[1,2]})

| improve this answer | |
$\endgroup$
5
$\begingroup$

The perfect quadratic relationship means that the point lie perfectly on some parabola.

Consider a perfect linear relationship: points lying in a straight line, such as $(1,2)$, $(2,5)$, and $(5, 14)$ that are on $y=3x-1$.

Ditto for points lying perfectly on some parabola giving a perfect quadratic relationship. Consider $(-2,4)$, $(1,1)$, $(0,0)$, $(1,1)$, and $(2,4)$ that lie on $y=x^2$.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.