Simpson's paradox
Simpson's paradox (or the Yule-Simpson effect) is a statistical paradox wherein the successes of groups seem reversed when the groups are combined. This result is often encountered in social and medical science statistics, and occurs when a weighting variable, which is irrelevant to the individual group assessment, must be used in the combined assessment. Judea Pearl has argued that the effect appears paradoxical only because of the statistical interpreter's tendency to causal interpretation of proportional changes.
Though mostly unknown to laymen, Simpson's Paradox is well known to statisticians, and is described in several introductory statistics books. Many statisticians believe that the mainstream public should be apprised of counterintuitive results such as Simpson's paradox, in particular to caution against the inference of causal relationships based on the association between two variables.
Edward H. Simpson described this phenomenon  in 1951,
along with Karl Pearson et al.,
and Udny Yule in 1903. 
The name Simpson's paradox was coined by Colin R. Blyth in 1972.
Since Simpson did not discover this statistical paradox, some authors, instead, have used the impersonal names reversal paradox and amalgamation paradox in referring to what is now called Simpson's Paradox and the Yule-Simpson effect.

# Examples

## Batting averages
A common example of the paradox involves batting averages in baseball: it is possible for one player to hit for a higher batting average than another player during a given year, and to do so again during the next year, but to have a lower batting average when the two years are combined. This phenomenon is well-known among sports sabermetricians such as Bill James, who has called attention to it.
A real-life example is provided by Ken Ross and involves the batting average of baseball players Derek Jeter and David Justice during the years 1995 and 1996:
In both 1995 and 1996, Justice had a higher batting average (in bold) than Jeter; however, when the two years are combined, Jeter shows a higher batting average than Justice. According to Ross, this phenomenon would be observed about once per year among the interesting baseball players. In this particular case, the paradox can still be observed if the year 1997 is also taken into account:

## Kidney stone treatment
This is a real-life example from a medical study comparing the success rates of two treatments for kidney stones.
The first table shows the overall success rates and numbers of treatments for both treatments:
This seems to show treatment B is more effective. If we include data about kidney stone size, however, the same set of treatments reveals a different answer:
The information about stone size has reversed our conclusion about the effectiveness of each treatment.  Now treatment A is seen to be more effective in both cases.  In this example the lurking variable (or confounding variable) of stone size was not previously known to be important until its effects were included.
Which treatment is considered better is determined by an inequality between two ratios (successes/total). The reversal of the inequality between the ratios, which creates Simpson's paradox, happens because two effects occur together:
- The sizes of the groups which are combined when the lurking variable is ignored are very different. Doctors tend to give the severe cases (large stones) the better treatment (A), and the milder cases (small stones) the inferior treatment (B). Therefore, the totals are dominated by groups 3 and 2, and not by the two much smaller groups 1 and 4.
- The lurking variable has a large effect on the ratios, i.e. the success rate is more strongly influenced by the severity of the case than by the choice of treatment. Therefore, the group of patients with large stones using treatment A (group 3) does worse than the group with small stones, even if the latter used the inferior treatment B (group 2).

## Berkeley sex bias case
One of the best known real life examples of Simpson's paradox occurred when the University of California, Berkeley was sued for bias against women applying to graduate school. The admission figures for fall 1973 showed that men applying were more likely than women to be admitted, and the difference was so large that it was unlikely to be due to chance.
However when examining the individual departments, it was found that no department was significantly biased against women; in fact, most departments had a small bias against men.
The explanation turned out to be that women tended to apply to departments with low rates of admission, while men tended to apply to departments with high rates of admission.  The conditions under which department-specific frequency data 
constitute a proper defense against charges of
discrimination are formulated in Pearl (2000).

## 2006 US school study
In July 2006, the United States Department of Education released a study documenting student performances in reading and math in different school settings. It reported that while the math and reading levels for students at grades 4 and 8 were uniformly higher in private/parochial schools than in public schools, repeating the comparisons on demographic subgroups showed much smaller differences which were nearly equally divided in direction.

## Low birth weight paradox
The low birth weight paradox is an apparently paradoxical observation relating to the birth weights and mortality of children born to tobacco smoking mothers. Traditionally, babies weighing less than a certain amount (which varies between countries) have been classified as having low birth weight. In a given population, low birth weight babies have a significantly higher mortality rate than others. However, it has been observed that low birth weight children born to smoking mothers have a lower infant mortality rate than the low birth weight children of non-smokers.

# Description of the paradox
To illustrate the paradox, suppose two people, Lisa and Bart, each edit Wikipedia articles for two weeks. In the first week, Lisa improves 60 percent of the articles she edits while Bart improves 90 percent of the articles he edits. In the second week, Lisa improves just 10 percent of the articles she edits, while Bart improves 30 percent.
Both times, Bart improved a much higher percentage of articles than Lisa  yet when the two tests are combined, Lisa has improved a much higher percentage than Bart!
This result comes about because of the varying number of articles worked on by each person - information not presented in the initial presentation. In the first week, Lisa edits 100 articles, improving 60 of them, while Bart edits just 10 articles, improving all but one. In the second week, Lisa edits only 10 articles, improving one, while Bart edits 100 articles, improving 30. When two week's worth of work is combined, both edited the same number of articles, yet Lisa improved 55% of them (61 in total) while Bart improved only 35% of them (39 in total).
To recap, introducing some notation that will be useful later:
- In the first week
- S_A(1) = 60\%  Lisa improved 60% of the many articles she edited.
- S_B(1) = 90\%  Bart had a 90% success rate during that time.
- In the second week
- S_A(2) = 10\%  Lisa managed 10% in her busy life.
- S_B(2) = 30\%  Bart achieved a 30% success rate.
On both occasions Bart's edits were more successful than Lisa's. But if we combine the two sets, we see that Lisa and Bart both edited 110 articles, and:
- S_A = \begin{matrix}\frac{61}{110}\end{matrix}  Lisa improved 61 articles.
- S_B = \begin{matrix}\frac{39}{110}\end{matrix}  Bart improved only 39.
- S_A > S_B  Success is now associated with Lisa.
Bart is better for each set but worse overall!
The paradox stems from our healthy intuition that Bart could not 
possibly be a better editor
-n each set but worse overall. Pearl (2000) in fact
proved the impossibility of such happening, where
"better editor" is taken in the counterfactual sense:
"Were Bart to edit all items in a set he would do 
better than Lisa would, on those same items."
Clearly, frequency data cannot support 
this sense of "better editor," because it does
not tell us how Bart would perform on items
edited by Lisa, and vice versa. In the back
-f our mind we assume that the articles were
assigned at random to Bart and Lisa, an assumption which (for large sample) would support the counterfactual
interpretation of "better editor." However, under
random assignment conditions, the data given in
this example is impossible, which accounts for
-ur surprise when confronting the rate reversal.
The arithmetical basis of the paradox is uncontroversial. If S_B(1) > S_A(1) and S_B(2) > S_A(2) we feel that S_B must be greater than S_A. However if different weights are used to form the overall score for each person then this feeling may be disappointed. Here the first test is weighted \begin{matrix}\frac{100}{110}\end{matrix} for Lisa and \begin{matrix}\frac{10}{110}\end{matrix} for Bart while the weights are reversed on the second test.
- S_A = \begin{matrix}\frac{100}{110}\end{matrix}S_A(1) + \begin{matrix}\frac{10}{110}\end{matrix}S_A(2)
- S_B = \begin{matrix}\frac{10}{110}\end{matrix}S_B(1) + \begin{matrix}\frac{100}{110}\end{matrix}S_B(2)
By more extreme reweighting A's overall score can be pushed up towards 60% and B's down towards 30%.
Lisa is a better editor on average, as her overall success rate is higher. But it is possible to have told the story in a way which would make it appear obvious that Bart is more diligent.
Simpson's paradox shows us an extreme example of the importance of including data about possible confounding variables when attempting to calculate causal relations. Precise criteria for selecting a set of "confounding variables,"
(i.e., variables that yield correct causal relationships if included in the analysis),
is given in (Pearl, 2000) using causal graphs.
While Simpson's paradox often refers to the analysis of count tables, as shown in this example, it also occurs with continuous data: for example, if one fits separated regression lines through two sets of data, the two regression lines may show a positive trend, while a regression line fitted through all data together will show a negative trend, as shown on the picture above.

## Vector interpretation
Simpson's paradox can also be illustrated using the 2-dimensional vector space. A success rate of p/q can be represented by a vector \overrightarrow{A}=(q,p), with a slope of p/q. If two rates p_1/q_1 and p_2/q_2 are combined, as in the examples given above, the result can be represented by the sum of the vectors (q_1, p_1) and (q_2, p_2), which, according to the parallelogram rule is the vector (q_1+q_2, p_1+p_2), with slope \frac{p_1+p_2}{q_1+q_2}.
Simpson's paradox says that even if a vector \overrightarrow{b_1} (in blue in the figure) has a smaller slope than another vector \overrightarrow{r_1} (in red), and \overrightarrow{b_2} has a smaller slope than \overrightarrow{r_2}, the sum of the two vectors \overrightarrow{b_1} + \overrightarrow{b_2} (indicated by "+" in the figure) can still have a larger slope than the sum of the two vectors \overrightarrow{r_1} + \overrightarrow{r_2}, as shown in the example.