Conditional distributions
The marginal mean of the Physics marks tells you how "the class as a whole" is doing. But you might be interested in something more specific: how is the group that got a $6$ in Maths doing in Physics? That question, restricted to a subgroup, is a conditional distribution.
What a conditional distribution is
Given the following two-way table relating the variables $X$ and $Y$: | $X \setminus Y$ | $1$ | $2$ | $3$ | | :---: | :---: | :---: | :---: | | $10$ | $2$ | $5$ | $1$ |…
Given the following two-way table relating the variables $X$ and $Y$:
| $X \setminus Y$ | $1$ | $2$ | $3$ |
|---|---|---|---|
| $10$ | $2$ | $5$ | $1$ |
| $20$ | $0$ | $4$ | $3$ |
| $30$ | $4$ | $1$ | $0$ |
Write down the frequency table of the distribution of the variable $Y$ conditional on $X = 10$ and calculate the size of this subpopulation.
In a study on two variables $X$ and $Y$, the distribution of $Y$ conditional on a specific value $x_i$ has been isolated, obtaining the following absolute frequencies: |…
In a study on two variables $X$ and $Y$, the distribution of $Y$ conditional on a specific value $x_i$ has been isolated, obtaining the following absolute frequencies:
| $Y | X = x_i$ | Absolute frequency ($f_{j|i}$) |
|---|---|
| $100$ | $4$ |
| $200$ | $12$ |
| $300$ | $4$ |
Calculate the conditional relative frequencies $h_{j|i}$ for each value of $Y$ and check that they add up to $1$.
Conditional mean and variance
Within that subgroup, the mean and variance are calculated exactly as usual, but using only the frequencies of that row (or column).
The number of spelling mistakes ($Y$) in a dictation exercise is analysed according to the year group ($X$). The two conditional distributions for $X=3$ and $X=4$ are…
The number of spelling mistakes ($Y$) in a dictation exercise is analysed according to the year group ($X$). The two conditional distributions for $X=3$ and $X=4$ are extracted:
Distribution $Y | X=3$:
Values $y_j$: $0, 1, 2, 3$
Frequencies: $2, 5, 2, 1$
Distribution $Y | X=4$:
Values $y_j$: $0, 1, 2, 3$
Frequencies: $5, 3, 2, 0$
Calculate the mean number of mistakes in each year group ($\bar{y}_{|x=3}$ and $\bar{y}_{|x=4}$) and indicate in which year group, on average, fewer mistakes are made.
In a nutrition study, the carbohydrate content in grams ($X$) and protein content in grams ($Y$) of several energy bars are related. The results are grouped in the…
In a nutrition study, the carbohydrate content in grams ($X$) and protein content in grams ($Y$) of several energy bars are related. The results are grouped in the following table:
| $X \setminus Y$ | $5$ | $10$ | $15$ |
|---|---|---|---|
| $20$ | $8$ | $12$ | $0$ |
| $30$ | $2$ | $15$ | $5$ |
| $40$ | $0$ | $4$ | $14$ |
Calculate the mean and standard deviation of the protein content for those bars that have exactly $30\text{ g}$ of carbohydrates (distribution $Y|X=30$).
Statistical independence
A survey is carried out in a school asking about gender ($X$: $1=\text{Chico}$, $2=\text{Chica}$) and preferred social network ($Y$: $1=\text{TikTok}$,…
A survey is carried out in a school asking about gender ($X$: $1=\text{Chico}$, $2=\text{Chica}$) and preferred social network ($Y$: $1=\text{TikTok}$, $2=\text{Instagram}$, $3=\text{BeReal}$).
| $X \setminus Y$ | $1$ | $2$ | $3$ |
|---|---|---|---|
| $1$ | $30$ | $20$ | $10$ |
| $2$ | $45$ | $30$ | $15$ |
Calculate the conditional relative frequency distributions $Y|X=1$ and $Y|X=2$. In light of the results, are gender and preferred social network independent in this sample?
Demonstrate numerically a fundamental property of statistical independence. Given the following table where $X$ and $Y$ are independent (their joint relative frequencies…
Demonstrate numerically a fundamental property of statistical independence. Given the following table where $X$ and $Y$ are independent (their joint relative frequencies are the product of the marginal ones):
| $X \setminus Y$ | $2$ | $4$ | Total |
|---|---|---|---|
| $1$ | $10$ | $30$ | $40$ |
| $2$ | $15$ | $45$ | $60$ |
| Total | $25$ | $75$ | $100$ |
Calculate the marginal mean $\bar{y}$ and the conditional means $\bar{y}_{|x=1}$ and $\bar{y}_{|x=2}$. Check that, since they are independent, the equality $\bar{y} = \bar{y}_{|x=1} = \bar{y}_{|x=2}$ holds.
Be careful: what is true for groups may not be true overall
This is the first serious hint of something you will see in more detail in the next section: a statistical relationship between two variables does not guarantee that one is the cause of the other, nor that comparing whole groups tells the full story.
In a hospital, a new treatment is being tested. Variable $X$ indicates the treatment ($0=\text{Estándar}$, $1=\text{Nuevo}$) and variable $Y$ indicates the outcome…
In a hospital, a new treatment is being tested. Variable $X$ indicates the treatment ($0=\text{Estándar}$, $1=\text{Nuevo}$) and variable $Y$ indicates the outcome ($0=\text{No curado}$, $1=\text{Curado}$). The patients are divided into two risk groups, forming two conditional distributions:
Low Risk Group:
Standard Treatment: $10$ cured out of $50$ patients.
New Treatment: $2$ cured out of $10$ patients.
High Risk Group:
Standard Treatment: $6$ cured out of $10$ patients.
New Treatment: $25$ cured out of $50$ patients.
Calculate the recovery rate (which is equivalent to the mean $\bar{y}$) for each treatment within each risk group. Then, combine all patients and calculate the overall recovery rate for each treatment. Which treatment seems better in the separate groups and which seems better overall? (This phenomenon is known as Simpson's Paradox).
Back to the start: To find out how the group that got a $6$ in Maths is doing in Physics, you take only the row $X=6$ of the table and calculate its conditional mean $\bar{y}_{|X=6}$ by dividing by the number of students in that row.