Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

R/ counterexample correlation

  1. Nov 3, 2012 #1
    Hi,

    Are you aware of any dataset (in R or elsewhere) consisting of a sample from two variables where the correlation coefficient is (approximately) equal to 1, but the variables refer to completely irrelevent things, i.e. one measuring something that happens on earth and the other something on a distant planet?

    or

    a case where a parameter causauly affects a measure, but because other such 'causual' parameters also exist, a sample from the respective two variables has correlation coefficient far distant from 1 or -1?

    My point is that the correlation coefficient is really an indicator that is informative?

    Any suggestions?

    thanx, alex
     
  2. jcsd
  3. Nov 3, 2012 #2

    Stephen Tashi

    User Avatar
    Science Advisor

    Perhaps you should look at the correlation between two nearly constant "random" variables. Something like X = 1 if there are at least 100 sunny days this year and Y = 1 if the Cubs don't win the world series this year. ( I supose you need a little variation to prevent the covriances from being 0.)
     
  4. Nov 4, 2012 #3
    You could create your own data, for example:

    Code (Text):

    > z<-rnorm(1000)
    > w<-rnorm(1000)
    > # spurious correlation (random walks)
    > cor(cumsum(z),cumsum(w))
    [1] 0.6556251
    > # perfectly correlated but correlation less than 1
    > cor(exp(z),exp(2*z))
    [1] 0.8726321
    > # perfectly anticorrelated but correlation is almost zero
    > cor(exp(z),exp(-2*z))
    [1] -0.08543019
     
    Other measures of dependence such as rank correlation have much nicer properties.
     
  5. Nov 6, 2012 #4
    Thanks Stephen,

    I know that it is possible to create such a dataset, however so far I havent found any real-world dataset with the data I have access to.
     
  6. Nov 6, 2012 #5
    Thanks Stephen,

    I know that it is possible to create such a dataset, however so far I havent found any real-world dataset with the data I have access to.
     
  7. Nov 6, 2012 #6

    Stephen Tashi

    User Avatar
    Science Advisor

    You'll have to distinguish between the existence of data and the existence of datasets. There are cultural reasons why people would not bother to publish a dataset of nearly constant random variables. This doesn't mean that the data isn't "real world".
     
  8. Nov 7, 2012 #7
    Stock price data has properties very similar to the examples described in post #3.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: R/ counterexample correlation
  1. Interclass correlation (Replies: 3)

  2. Correlation coefficient (Replies: 15)

Loading...