Differences between revisions 1 and 2
Revision 1 as of 2026-02-17 17:13:52
Size: 990
Comment: Initial commit
Revision 2 as of 2026-02-17 17:20:03
Size: 1067
Comment: Clarification
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
In this example, controlling for ''Z'' reveals the correlation. (Note that in [[R]], the [[Analysis/BernoulliDistribution|Bernoulli distribution]] is handled as a special case of the [[Analysis/BinomialDistribution|Binomial distribution]]. Comparing the sum of ''X'' and ''Y'' to 0 is effectively checking if either is 1.) In this example, controlling for ''Z'' 'creates' a correlation. (Note that in [[R]], the [[Analysis/BernoulliDistribution|Bernoulli distribution]] is handled as a special case of the [[Analysis/BinomialDistribution|Binomial distribution]]. Comparing the sum of ''X'' and ''Y'' to 0 is effectively checking if either is 1.)
Line 29: Line 29:
The important consequence is that colliders should not be controlled for.

Collider

A collider is a variable that is caused by multiple variables.


Description

Colliders are one possible failure of causal inference, although in an atypical manner. Generically a collider Z is associated with two independent variables, X and Y. Therefore when controlling for the collider X and Y become associated.

In this example, controlling for Z 'creates' a correlation. (Note that in R, the Bernoulli distribution is handled as a special case of the Binomial distribution. Comparing the sum of X and Y to 0 is effectively checking if either is 1.)

> X <- rbinom(1000, 1, 0.5)
> Y <- rbinom(1000, 1, 0.5)
> Z <- rbinom(1000, 1, ifelse(X+Y>0, 0.9, 0.2))
> cor(X,Y)
[1] -0.02387166
> cor(X[Z==1], Y[Z==1])
[1] -0.3387377
> cor(X[Z==0], Y[Z==0])
[1] 0.2764379

The important consequence is that colliders should not be controlled for.


CategoryRicottone

Statistics/Collider (last edited 2026-05-13 22:16:34 by DominicRicottone)