7
$\begingroup$

I have two continuous variables that may have nonlinear relationship. Scatter plot of two variables showed an ellipse shape. Furthermore, both Pearson correlation coefficient and Spearman's rank correlation coefficient were calculated and they were 0.624 and 0.619 respectively.

Is this indicate a linear relationship? How can I verify whether it is a linear or nonlinear relationship, Is there a linearity test?

$\endgroup$
4
  • 1
    $\begingroup$ a related post stats.stackexchange.com/questions/218127/… $\endgroup$
    – Haitao Du
    Sep 9, 2016 at 14:38
  • 1
    $\begingroup$ A fairly simple test is to run a linear regression: $y = \alpha + \beta_1 x + \beta_2 x^2 + \beta_3 x^3 + \epsilon$ or something similar. Check that the coefficients on $\beta_2$ and $\beta_3$ are statistically zero. $\endgroup$
    – lmo
    Sep 9, 2016 at 14:40
  • $\begingroup$ The correlation measures the degree of linear dependency, it's does not by it self indicate that a linear relationship exists. Why not try both a linear and non linear method and see which work better? $\endgroup$
    – Repmat
    Sep 9, 2016 at 14:42
  • $\begingroup$ Thanks for the reply. But, if there is a test then my finding will be confirmed. I'll try both linear and nonlinear methods. $\endgroup$
    – SAN
    Sep 9, 2016 at 14:47

1 Answer 1

8
$\begingroup$

Furthermore, both Pearson correlation coefficient and Spearman's rank correlation coefficient were calculated and they were 0.624 and 0.619 respectively. Does this indicate a linear relationship?

No, not necessarily. You can build datasets which have 0.6, but dependence is strongly non-linear, or nearly linear/comonotonic but with anti-tail-dependence (high extreme values for ones correspond to low extreme values for the other, and conversely).

You can display an empirical copula: You sort the values for X (and divide by the number of values), you sort the values for Y (and divide by the number of values). You can then plot a 'normalized' scatterplot or an estimated density of this bivariate distribution of uniform marginals. The perfect positive dependence (comonotonic relationship) is depicted by the diagonal of $[0,1]^2$. For some python code and empirical copulas illustration, you can have a look there.

$\endgroup$
4
  • $\begingroup$ Could you please explain it more? $\endgroup$
    – SAN
    Sep 23, 2016 at 10:39
  • 1
    $\begingroup$ You can have a look at arxiv.org/pdf/1610.09659.pdf it is explained how to read the empirical copula measures to understand what kind of relationship there is between two variables. $\endgroup$
    – mic
    Nov 1, 2016 at 9:42
  • 1
    $\begingroup$ is there a source that describes that binning procedure of sorting values, dividing them by their sample frequency, etc? all of the copula textbooks are fixated on integrals/theory and not actual implementation, which is basically copula discretization $\endgroup$
    – develarist
    Aug 28, 2020 at 18:56
  • 1
    $\begingroup$ yes, but it's old and hard to find (and in French): fonction de dépendance empirique (empirical copula) by Paul Deheuvels, 1979 $\endgroup$
    – mic
    Aug 31, 2020 at 2:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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