What does "controlling for" mean? Conditioning on a confouding variable: demonstration using a three-dimensional scatterplot

In this demonstration I use simulated data to show how a third variable that affects two other variables generates correlation between those two variables even if those two variables have no effect on each other, and I show how conditioning on the third variable eliminates the correlation.


The importance of interactive control variables when testing interactive hypotheses

When testing hypotheses about how the effect of one variable on the outcome variable depends on the value of a third moderating variable, it is possible for a fourth confouding variable to produce spurious correlations between the hypothesized moderator and the effect of interest. Modeling the interaction with the confounding variable is important if one wishes to alleviate this threat to causal inference.


Demonstration of Central Limit Theorem and Law of Large Numbers: Simulated rolls of a die

Excel file (12MB): CLT_die_roll_simulation.xlsx

In this demonstration I use simulated data from rolls of a six-sided die to show that the relative frequency distribution of individual rolls in a sample becomes more similar to the probability distribution of individual rolls as the sample size gets larger (Sheet 1). I also show that the distribution of sample means approximates a normal distribution centered on the true mean of the probability distribution and that the distribution of sample means gets narrower as the sample size gets larger (Sheet 2).

For another helpful demonstration of the Central Limit Theorem, see Daniel Kunin's website: https://students.brown.edu/seeing-theory/probability-distributions/index.html#section3