What dependence is implied by a chi square test for independence?

I have a question on subject chi-square test for independence.

I have, for example, two events A and B. If chi square test is not passed: is A dependent on B (A|B) or B on A (B|A)? Or does be valid both? (A|B and B|A).

-

There's nothing wrong with the existing answers, but I suspect that you're looking for a causal sense of dependence rather than an associational one, that is: whether A causes B rather than whether B is more predictable when you know A. The chi^2 test is working with the second sense.

Even in the simplest case of the first kind of dependence you would ideally experimentally manipulate B and observe the effect on A and vice versa. Judea Pearl points out that this is the difference between the ordinary sense of conditional probability

P("I observe that A has value a" | "I observe that B has value b")

and a quite different thing that we might slightly misleadingly write as

P("I observe that A has value a" | "I fix B to have value b")

These need not, of course, be the same number.

-
+1 for the creative (and insightful) interpretation and explaining the distinction. –  whuber Oct 30 '10 at 15:11

I assume A and B are both random variables taking discrete values and you are thinking of a chi-squared test on the two-way frequency table formed by the counts of observations on the two variables.

In that case, a significant result indicates both directions of dependence: A|B and B|A.

If you think about Bayes' theorem, it is clear that one always implies the other:

P(A|B) = P(B|A) P(A) / P(B)

So P(A|B) = P(A) if and only if P(B|A)=P(B).

-
You don't need assumption about 2x2 table but rather kxm table. –  Wojtek Aug 13 '10 at 6:06
Of course. Now fixed. –  Rob Hyndman Aug 13 '10 at 6:32

There are two definitions of statistical independence: 1) P(A,B)=P(A)*P(B) <=> 2) P(A|B)=P(A) <=> 2a) P(B|A)=P(B).

(<=> means if and only if)