PS 812 - Introduction to Statistical Methods in Political Science
September 22, 2026
\[ \newcommand{\Var}{\text{Var}} \]
Let \(A_{ik}\) be the event that the respondent \(i\) has an income of exactly \(k\) dollars.
How would we represent the probability that a randomly selected respondent has an income between $50,000 and $100,000?
\[ \begin{aligned} P\left(\bigcup_{k = 50{,}000}^{100{,}000} A_{ik}\right) &= \sum_{k = 50{,}000}^{100{,}000} P(A_{ik}) \\ &= P(A_{i,50000}) + P(A_{i,50001}) + \cdots + P(A_{i,99999}) + P(A_{i,100000}) \end{aligned} \]
We can construct random variables as functions of other random variables!
Let \(R\) be a random variable denoting the USD-GBP (pounds per dollar) exchange rate on a given day.
Let \(Y_i = R \times X_i\)
The probability that the respondent has an income between £50,000 and £100,000 is just \[P (50{,}000 \le Y_i \le 100{,}000) \]
\(Y_i\) is itself another random variable!
Random variables can be defined by their distribution function
The cumulative distribution function (CDF) gives the probability that a particular random variable \(X\) takes on a value less than or equal to \(x\)
\[ F_X(x) = P(X \le x) \]
The probability that \(X\) lies between two values is just the difference between two evaluations of the CDF.
\[P(a < X \le b) = F_X(b) - F_X(a) \]
Why? Consider that \(X \le b\) is the union of two disjoint events: \(X \le a\) and \(a < X \le b\)
The probability of the union of two disjoint events is the sum of their probabilities.
\[ \begin{aligned} F_X(b) - F_X(a) &= P(X \le b) - P(X \le a) \\ &= P([X \le a] \cup [a < X \le b]) - P(X \le a) \\ &= P([X \le a]) + P([a < X \le b]) - P(X \le a) \\ &= P(a < X \le b) \end{aligned} \]
A discrete random variable has a probability mass function (PMF)
The PMF gives the probability that a particular random variable \(X\) takes on a value equal to \(x\)
\[p_X(x) = P(X = x) \]
PMFs are non-negative: \(p_X(x) > 0\) for \(x\) in the support and \(0\) otherwise
PMFs sum to \(1\) over the support of \(X\)
\[ \sum_{x \in \mathcal{X}} p_X(x) = 1 \]
One can get the CDF by summing the PMF over all values less than or equal to \(x\).
\[ F_X(x) = \sum_{t \in \mathcal{X} : t \le x} p_X(t) \]
\[ P(X = x) = \begin{cases} p & \text{if } x = 1 \\ 1 - p & \text{if } x = 0 \\ 0 & \text{otherwise} \end{cases} \]
\[ X \sim \text{Bernoulli}(p) \]
\[ \mathbf{1}(A) \sim \text{Bernoulli}(p) \quad p = P(A) \]
Let \(C_i\) be the number of items that respondent \(i\) would say they did if assigned to control
Let \(T_i\) be the number of items that respondent \(i\) would say they did if assigned to treatment
The simplest way to define these distributions is to assign a unique parameter to each possible value
\[ P(C_i = c) = \begin{cases} p_0 & \text{if } c = 0 \\ p_1 & \text{if } c = 1 \\ p_2 & \text{if } c = 2 \\ p_3 & \text{if } c = 3 \\ 0 & \text{otherwise} \end{cases} \qquad p_c \ge 0, \quad \sum_{c=0}^{3} p_c = 1 \]
We want to try to learn about the probability of responding to the sensitive item.
Now we’ll make some assumptions about how \(Z_i\) relates to the other two variables
\[ \underbrace{T_i}_{\text{treated count}} = \underbrace{C_i}_{\text{control count}} + \underbrace{Z_i}_{\text{sensitive item}} \]
We’ve defined the data generating process for the list experiment!
2012 Mexico Panel Study, Wave 2 (Greene 2016)
One very important property of a random variable is its expectation \(\mathbb{E}[X]\)
For a discrete random variable, the expectation is a weighted average of that variable’s possible outcomes with the weights given by the probability of each outcome
\[ \mathbb{E}[X] = \sum_{x \in \mathcal{X}} x \cdot P(X = x) \]
Suppose I want to know \(\mathbb{E}[g(X)]\) where \(g()\) is some function.
An interesting property of the expected value is what is sometimes called the Law of the Unconscious Statistician (LOTUS)
Suppose I want to calculate the expectation of some function of \(X\), denoted \(g(X)\).
If I just looked at the definition of expectation, I’d think:
It turns out that works!
\[\mathbb{E}[g(X)] = \sum_{x \in \mathcal{X}} g(x) \cdot P(X = x) \]
Another essential property of expectations is linearity
Let \(X\) and \(Y\) be two random variables
\[\mathbb{E}[X + Y] = \mathbb{E}[X] + \mathbb{E}[Y] \]
Let \(a\) and \(b\) be constants: we can pull the constants out of the expectation
\[\mathbb{E}[aX + bY] = a\mathbb{E}[X] + b\mathbb{E}[Y] \]
You’ll see this most often with sums over random variables indexed along some dimension
\[\mathbb{E}\bigg[\sum_{i=1}^n a X_i\bigg] = \sum_{i=1}^n\mathbb{E}[a X_i] = \sum_{i=1}^n a\mathbb{E}[X_i] = a\sum_{i=1}^n \mathbb{E}[X_i]\]
Let \(X \sim \text{Bernoulli}(p)\)
There are two possible values, let’s calculate the expectation!
\[ \begin{aligned} \mathbb{E}[X] &= \sum_{x \in \{0, 1\}} x \cdot P(X = x) \\ &= 0 \cdot P(X = 0) + 1 \cdot P(X = 1) \\ &= 0 \cdot (1 - p) + 1 \cdot p \\ &= p \end{aligned} \]
The expected value of a Bernoulli/indicator random variable is just the probability that it takes on a value of \(1\)
Now let \(X \sim \text{Binomial}(N, p)\)
We could write this out and use properties of sums of factorials
\[ \mathbb{E}[X] = \sum_{x=0}^{N} x \cdot \binom{N}{x} p^x (1 - p)^{N - x} \]
Or we could use linearity of expectations - much easier!
Recall that the Binomial is the sum of \(N\) independent and identically distributed Bernoulli random variables with success probability \(p\)
\[X = \sum_{i=1}^N X_i \quad\quad\quad X_i \sim \text{Bernoulli}(p) \]
Applying linearity of expectations
\[\mathbb{E}[X] = \mathbb{E}\bigg[\sum_{i=1}^N X_i\bigg] = \sum_{i=1}^N \mathbb{E}[X_i]\]
Plugging in our expectation of the Bernoulli and summing
\[ \mathbb{E}[X] = Np \]
Let’s return to our list experiment example. Remember, we have
\[ \underbrace{T_i}_{\text{treated count}} = \underbrace{C_i}_{\text{control count}} + \underbrace{Z_i}_{\text{sensitive item}} \]
We want to know \(P(Z_i = 1) = \theta\) - the share of respondents who participated in vote buying
Taking expectations of both sides and using linearity
\[ \mathbb{E}[T_i] = \mathbb{E}[C_i] + \theta \]
Solving for \(\theta\)
\[\theta = \mathbb{E}[T_i] - \mathbb{E}[C_i] \]
In our sample, we assume that we observe realizations of these two random variables
We’ll plug-in an estimate of each expectation using its sample analogue: the average
\[ \begin{aligned} \hat{\theta} &= \widehat{\mathbb{E}}[T_i] - \widehat{\mathbb{E}}[C_i] \\ &= \frac{1}{N_T} \sum_{i=1}^{N_T} T_i - \frac{1}{N_C} \sum_{i=1}^{N_C} C_i \end{aligned} \]
Later, we’ll show that under assumptions about how we got our sample (i.i.d. random smapling)…
Note that we don’t actually need the assumption that \(C_i \sim \text{Binomial}(3, p)\) to estimate \(\theta\)
| Group | Mean count | N |
|---|---|---|
| Control | 1.555 | 559 |
| Treated | 1.749 | 561 |
| List experiment | Direct question |
|---|---|
| 0.194 | 0.055 |
Beyond the expectation, there are other summaries that capture other relevant features.
The variance of a random variable \(\Var(X)\) is the expected squared deviation from \(\mathbb{E}[X]\)
\[\Var(X) = \mathbb{E}\bigg[(X - \mathbb{E}[X])^2\bigg] \]
Expanding the square and applying linearity of expectation
\[\Var(X) = \mathbb{E}[X^2] - \mathbb{E}[2X\mathbb{E}[X]] + \mathbb{E}[\mathbb{E}[X]^2]\]
Pulling out the constant \(2\mathbb{E}[X]\) and \(\mathbb{E}[X]^2\)
\[ \begin{aligned} \Var(X) &= \mathbb{E}[X^2] - 2\mathbb{E}[X]\mathbb{E}[X] + \mathbb{E}[X]^2 \\ &= \mathbb{E}[X^2] - \mathbb{E}[X]^2 \end{aligned} \]
The variance is non-negative
For a random variable \(X\) and a constant \(a\)
\[ \Var(aX) = a^2\Var(X) \]
But be careful, the variance of the sum of two random variables \(X\) and \(Y\) is not the sum of the variances except in a special case we’ll talk about next week (independence)
\[ \Var(X + Y) \neq \Var(X) + \Var(Y) \]
Also, the variance of the difference is not the difference in the variances…even for independent random variables, it’s still the sum of the variances (\(-1\) gets squared!)
Let’s derive the variance of the Bernoulli. Let \(X \sim \text{Bernoulli}(p)\)
\[ \begin{aligned} \Var(X) &= \mathbb{E}[X^2] - \mathbb{E}[X]^2 \\ &= \mathbb{E}[X] - \mathbb{E}[X]^2 \\ &= p - p^2 \\ &= p(1 - p) \end{aligned} \]
The second line uses the fact that \(X\) only takes on the values \(0\) and \(1\). \(0^2 = 0\) and \(1^2 = 1\).
Intuition: The uncertainty around a coin-flip is maximized when it’s fair!
A continuous random variable is a random variable whose CDF is continuous everywhere and differentiable everywhere except possibly at a finite number of points (Blitzstein and Hwang 2019)
The challenge with talking about a distribution defined on the uncountably infinite reals is that the probability of realizing any particular value \(x\) is always zero
Instead of a PMF, continuous random variables have a probability density function (PDF) - defined as the derivative of the CDF
\[ f_X(x) = \frac{d}{dx} F_X(x) \]
It’s not a probability, but it integrates to a probability.
\[ F_X(x) = \int_{-\infty}^{x} f_X(t) dt \]
This is similar to how we summed the PMF to get the CDF
PDFs integrate to \(1\) (just like how PMFs sum to \(1\))
\[ \int_{-\infty}^{\infty} f_X(x)dx = 1 \]
And we can integrate the PDF over any interval to get the probability of \(X\) falling in that interval.
\[P(a < X \le b) = \int_{a}^{b} f_X(x)dx \]
Intuitively, this follows from our earlier definition using CDFs
\[ \begin{aligned} P(a < X \le b) &= F_X(b) - F_X(a) \\ &= \int_{-\infty}^{b} f_X(x)dx - \int_{-\infty}^{a} f_X(x)dx \\ &= \int_{a}^{b} f_X(x)dx \end{aligned} \]
We defined the expected value for a discrete random variable as a sum
For continuous \(X\)
\[\mathbb{E}[X] = \int_{\mathcal{X}} x f(x) dx \]
More generally, the distinction between discrete and continuous vanishes when we define integrals with respect to the distribution (Lebesgue integration)
\[\mathbb{E}[X] = \int_{\mathcal{X}} x \, dF_X(x) \]
But we won’t spend time on that in this class…your Riemann integral intuition (sum of the areas of tinier and tinier rectangles) is enough!
The normal (or Gaussian) distribution is the most common continuous distribution you’ll encounter
The PDF is
\[ f_X(x) = \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left\{-\frac{(x - \mu)^2}{2\sigma^2}\right\} \]
Two parameters, \(\mu\) and \(\sigma^2\)
\(\mathcal{N}(0, 1)\) is referred to as the standard normal
PDF and CDF typically written as: \(\phi(z)\) and \(\Phi(z)\)
\[ \phi(z) = \frac{1}{\sqrt{2\pi}} e^{-z^2/2} \]
Any normal can be standardized. If \(X \sim \mathcal{N}(\mu, \sigma^2)\), then
\[ Z = \frac{X - \mu}{\sigma} \sim \mathcal{N}(0, 1) \]
\(\Phi\) has no closed form
pnorm())PS 812 - University of Wisconsin-Madison