liveBook · Manning

Random variable

As explained in Causal Inference for Data Science

A random variable is a variable whose value is determined by the outcome of a random experiment.

A random variable assigns values to outcomes whose uncertainty comes from a random experiment, sampling process, or unobserved factors. Its expectation is the average value under the relevant probability distribution. section 10.1.2 section 1.5.1

Keep randomness tied to the object being considered. A particular patient's potential outcome may be fixed, even though the corresponding population variable is random because it represents a randomly selected patient. Thus, P(Y1 = 1) describes the proportion of patients cured under treatment, not uncertainty about one already-fixed potential outcome. section 10.1.2

Several distinctions make random variables useful in statistics and causal inference:

  • Separate a sample statistic from the underlying data-generating quantity: a sample average estimates an expectation. section 1.5.1
  • Distinguish observable variables, such as treatment received or recovery, from unobserved potential outcomes. section 10.1.2
  • Allow conditional outcomes to remain random: in Y := f(X, U), knowing X does not determine Y when unknown factors U also affect it. section 3.2.2

Heads and tails

For a sample containing two heads and three tails, the empirical distribution assigns probability 2/5 to H and 3/5 to T. Coding heads as 1 and tails as 0 makes the sample average 2/5, an estimate of the random variable's expectation under the data-generating process. section 1.5.1

Table 1.1 Empirical distribution from a sample of H, H, T, T, T
Outcome
Probability
H
2/5
T
3/5

Use the empirical-distribution table to compare observed outcome frequencies with probabilities assigned to a binary random variable. section 1.5.1

How Causal Inference for Data Science covers it

How deep it goes
Defines expectations, variance, empirical distributions, and conditional randomness, but defers deeper statistical inference and confidence-interval methods.
Examples
Uses coin tosses, treatment and recovery indicators, potential outcomes, and functional causal-graph relationships.
What you can do after
Evaluate/understand probabilities, expectations, and conditional uncertainty without confusing samples, populations, or fixed potential outcomes.
How it connects
Connects random variables to expectation, variance, empirical distributions, data-generating distributions, potential outcomes, and causal graphs.

Also explained in

Compare how 5 books explain random variable →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Causal Inference for Data Science. The section links point to the parts of the book it draws on.