[R] Query about finding correlations

Alberto Monteiro albmont at centroin.com.br
Wed May 2 19:35:33 CEST 2007


Lalitha Viswanath wrote:
> 
> We are trying to find out, which of A or B cause C
> i.e. We are hypothesising that C is the effect and
> either A or B, not both is the cause.
> (...) 
> I would greatly appreciate any inputs on the best
> statistcal approach to tackle this problem. 
> I am thinking that we can find correlation
> coefficients between A and C, and between B and C, but
> I am not sure this answers the question.
> Also we do not know whether the correlation between
> them is linear or non linear.
> 
If the causation (not the correlation) is not linear,
then the correlation (which is linear, always) may not
be the best indicator.

Take, as an extreme case, this:

A <- (-50:50) + 100 * rnorm(101)
B <- abs((-50):50) + 10 * rnorm(101)
C <- A^2 / 50 + rnorm(101)
cor(A, C)
cor(B, C)

A is obviously the "cause" of C, but B (in some cases)
is better correlated to C than A to C.

Alberto Monteiro



More information about the R-help mailing list