| School Category | n |
|---|---|
| Independent School | 54 |
| StrongStart BC | 19 |
| Public School | 121 |
STAT 200 - Lecture 2
One of the most critical steps when studying a new problem and dataset.
EDA helps us to:
You might need to refresh this page to show the data.
| School Category | n |
|---|---|
| Independent School | 54 |
| StrongStart BC | 19 |
| Public School | 121 |



Avoid using pie charts;
When you have many slices and/or the slices are roughly the same size, it becomes impossible to read.
In general, bar charts are much easier to read than pie charts. So stick with them.
Appropriate for summarizing the counts of two categorical variables;
Facilitates the analysis of the relationship between two categorical variables;
| Drug | Heart Attack | No Heart Attack | Total |
|---|---|---|---|
| Aspirin | 104 | 10,933 | 11,037 |
| Placebo | 189 | 10,845 | 11,034 |
| Total | 293 | 21,778 | 22,071 |
The study was reported on the front page of the New York Times on January 27, 1988. (See the article here.)
What proportion of individuals did not have a heart attack?
What proportion of individuals received a placebo?
What proportion of individuals who had a heart attack were on aspirin?
What proportion of individuals who were on aspirin had a heart attack?
What proportion of individuals who were on placebo and had a heart attack?
| Drug | Heart Attack | No Heart Attack | Total |
|---|---|---|---|
| Aspirin | 104 | 10,933 | 11,037 |
| Placebo | 189 | 10,845 | 11,034 |
| Total | 293 | 21,778 | 22,071 |
| Heart Attack | No Heart Attack |
|---|---|
| 293 (1.33%) | 21,778 (98.67%) |
Answer: 98.67%
| Drug | Heart Attack | No Heart Attack | Total |
|---|---|---|---|
| Aspirin | 104 | 10,933 | 11,037 |
| Placebo | 189 | 10,845 | 11,034 |
| Total | 293 | 21,778 | 22,071 |
| Aspirin | Placebo |
|---|---|
| 11,037 (50%) | 11,034 (50%) |
Answer: 50%
| Drug | Heart Attack | No Heart Attack | Total |
|---|---|---|---|
| Aspirin | 104 | 10,933 | 11,037 |
| Placebo | 189 | 10,845 | 11,034 |
| Total | 293 | 21,778 | 22,071 |
| Aspirin | Placebo |
|---|---|
| 104 (35.49%) | 189 (64.51%) |
Answer: 35.49%
Note that we fix the condition of occurrence of heart attack and look at the distribution of drug type.
| Drug | Heart Attack | No Heart Attack | Total |
|---|---|---|---|
| Aspirin | 104 | 10,933 | 11,037 |
| Placebo | 189 | 10,845 | 11,034 |
| Total | 293 | 21,778 | 22,071 |
aspirin
| heart attack | no heart attack |
|---|---|
| 104 (0.94%) | 10,933 (99.06%) |
Answer: 0.94%
Note that we fix the condition of drug type and look at the distribution of occurrence of heart attack.
| Drug | Heart Attack | No Heart Attack | Total |
|---|---|---|---|
| Aspirin | 104 | 10,933 | 11,037 |
| Placebo | 189 | 10,845 | 11,034 |
| Total | 293 | 21,778 | 22,071 |
Answer: \(\frac{189}{22071} = 0.86\%\)
heart attacks in the placebo and aspirin groups;| Drug Type | Heart Attack | No Heart Attack | Total |
|---|---|---|---|
| Aspirin | 104 | 10,933 | 11,037 |
| Placebo | 189 | 10,845 | 11,034 |
| Total | 293 | 21,778 | 22,071 |
aspirin who had a heart attack:placebo who had a heart attack:aspirin who had a heart attack: \(\frac{104}{11037}=\) 0.94%placebo who had a heart attack: \(\frac{189}{11034}=\) 1.71%Does race affect the chance of receiving a death penalty sentence in Florida?
Radelet (1981) examined data on homicide indictments in 20 Florida counties between 1976 and 1977.
| Race | Death Penalty | |
|---|---|---|
| Yes | No | |
| White | 19 | 141 |
| Black | 17 | 149 |
| Total | 36 | 290 |
Death Penalty sentences grouped per victims’ races (Radelet 1981):
| Race | Death Penalty | |
|---|---|---|
| Yes | No | |
| White | 19 | 132 |
| Black | 11 | 52 |
| Total | 30 | 184 |
| Race | Death Penalty | |
|---|---|---|
| Yes | No | |
| White | 0 | 9 |
| Black | 6 | 97 |
| Total | 6 | 106 |
Although we found that black offenders have a higher chance of being sentenced to death, this does not necessarily mean that it is because of their race.
The race could be the root cause, or a contributing factor, or has nothing to do with it at all;
The cause could be a different underlying factor that affects black offenders more;
Schools in Vancouver: available from OpenData Vancouver.
Aspirin Study: published in The New York Times.
© 2023 Rodolfo Lourenzutti & Eugenia Yu – Material Licensed under CC By-SA 4.0