Discovering Statistics: An Interactive Primer
Building Intuition for Basic Concepts
2025-01-02
Contents
- Single sample: probability basics - normal distribution and binomial (coins)
- 2 samples: normal and chi square
- Adjusting for confounders - (stratifying) & linear regression. Logistic regression
Coin Flip Simulation
This simulation demonstrates the binomial distribution through repeated coin flips.
Binomial distribution
The binomial distribution is given by the formula:
\[ P(X = k) = \binom{n}{k} p^k (1-p)^{n-k} \]
Where:
- \(P(X = k)\) is the probability of getting exactly \(k\) successes in \(n\) trials.
- \(\binom{n}{k}\) is the binomial coefficient, which represents the number of ways to choose \(k\) successes from \(n\) trials.
- \(p\) is the probability of success on a single trial.
- \((1-p)\) is the probability of failure on a single trial.