Displaying Data
Objectives:
Students should know the typical graphical displays for the different types of variables.
Students should understand how frequency tables are constructed and how to read absolute and cumulative frequencies from the tables.
Tables or graphs that show the number of occurrences of values in a specified category (nominal and ordinal data) or interval (numerical data).
Frequency tables and graphs can show either values (counts), percentages (of total number), or both.
For quantitative data, cumulative frequencies and percentages can also be shown.
Frequency Distributions
Specialty Frequency Percent
Internal Medicine 183 29.8%
Family Practice 137 22.3%
Pediatrics 98 16.0%
Emergency Medicine 44 7.2%
General Surgery 41 6.7%
Obstetrics/Gynecology 39 6.3%
Other 72 11.7%
Total 614 100.0%
Medical specialties chosen by a sample of graduating medical students (n=614) in 2002
A frequency table for a nominal variable
The most common graphical ways of displaying the data are with bar and pie charts
For Nominal variables, the categories can be listed in any order. Ordinal variables are usually listed in order from lowest to highest category (or vise versa).
Bar charts plot the categories on the x-axis, and the frequencies (or percents) for each category on the y-axis (bars can be horizontal or vertical).
Pie charts display the relative frequencies for the categories as sections of a circle.
Graphic Displays for Categorical Variables
Medical specialties chosen by graduating medical students (n=614) in
2002
Bar graph
0 25 50 75 100 125 150 175 200
Number of Students
Internal Med.
Family Practice
Pediatrics
Emergency Med.
Ob./Gyn.
Other
General Surgery
Medical specialties chosen by graduating medical students (n=614) in
2002
Pie chart
Internal Medicine
29.8%
Family Practice22.3%
Other11.7%
Pediatrics16.0%
Emergency
Medicine
Ob/Gyn6.3%
GeneralSurgery
6.7%
Graphical displays for quantitative/numerical data:
stem and leaf plots histograms frequency polygons box plots dot plots line graphs scatter plots (used for graphs of two
characteristics)
Graphic Displays for Quantitative Variables
Sex HR Sex HR Sex HR Sex HR Sex HR Sex HR Sex HR
F 55 M 66 F 70 M 73 F 77 M 79 F 82
M 57 F 67 F 70 M 73 F 77 M 79 M 82
M 59 F 67 M 70 M 73 F 77 M 79 F 83
F 61 F 68 M 70 M 73 M 77 F 80 M 83
M 61 F 68 F 71 F 74 M 77 F 80 M 83
M 62 F 68 F 71 F 74 F 78 M 80 F 84
M 62 M 68 M 71 F 74 F 78 F 81 F 84
F 63 F 69 M 71 M 74 F 78 F 81 M 85
F 64 M 69 F 72 F 75 F 78 F 81 F 86
M 64 M 69 M 72 F 75 M 78 M 81 F 86
M 64 M 69 F 73 M 75 M 78 F 82 M 89
M 66 F 70 M 73 M 76 M 79 F 82 M 89
Frequency tables for quantitative variablesExample: Resting heart rates (bpm) for 42 males and 42
females collected during a research study
In this format, it’s difficult to draw any conclusions about the heart rates in the sample.
One way to present a summary of the data is to construct intervals of heart rates, and count the number of observations that fall in each interval:
Heart Rate Interval
Absolute Frequency
55-59 3
60-64 8
65-69 12
70-74 21
75-79 19
80-84 16
85-89 5
This is essentially “collapsing” a continuous variable into an ordinal
variable
Sex HR Sex HR Sex HR Sex HR Sex HR Sex HR Sex HR
F 55 M 66 F 70 M 73 F 77 M 79 F 82
M 57 F 67 F 70 M 73 F 77 M 79 M 82
M 59 F 67 M 70 M 73 F 77 M 79 F 83
F 61 F 68 M 70 M 73 M 77 F 80 M 83
M 61 F 68 F 71 F 74 M 77 F 80 M 83
M 62 F 68 F 71 F 74 F 78 M 80 F 84
M 62 M 68 M 71 F 74 F 78 F 81 F 84
F 63 F 69 M 71 M 74 F 78 F 81 M 85
F 64 M 69 F 72 F 75 F 78 F 81 F 86
M 64 M 69 M 72 F 75 M 78 M 81 F 86
M 64 M 69 F 73 M 75 M 78 F 82 M 89
M 66 F 70 M 73 M 76 M 79 F 82 M 89
A complete frequency table might look like this:
Heart Rate Interval
Absolute Frequency
Cumulative Absolute
Frequency
Relative Frequency
Cumulative Relative
Frequency
55-59 3 3 0.036 0.036
60-64 8 11 0.095 0.131
65-69 12 23 0.143 0.274
70-74 21 44 0.250 0.524
75-79 19 63 0.226 0.750
80-84 16 79 0.190 0.940
85-89 5 84 0.060 1.000
Heart Rate Interval
Absolute Frequency
Cumulative Absolute
Frequency
Relative Frequency
Cumulative Relative
Frequency
55-59 3 3 0.036 0.036
60-64 8 11 0.095 0.131
65-69 12 23 0.143 0.274
70-74 21 44 0.250 0.524
75-79 19 63 0.226 0.750
80-84 16 79 0.190 0.940
85-89 5 84 0.060 1.000
We can easily see (for example) that:• a little more than half (52.4%) of the subjects have
HRs <74 bpm• 21/84 subjects (25%) have HRs between 70 and 74
bpm• <5% (3.6%) of the subjects have HRs <60 bpm
A frequency distribution of a quantitative variable displayed in graphic form is called a histogram:
0
5
10
15
20
25
Fre
quen
cy
55 70 80 8560 65 75 90
Heart Rate (BPM)
//
0
5
10
15
20
25
30
Rel
ativ
e F
requ
ency
(%
)
Heart Rate (BPM)
//52 6257 72 77 82 87 9267
Males (n=42)Females (n=42)
Another type of graph is a frequency polygon, useful for displaying 2 or more quantitative distributions on the same graph:
0 10 20 30 40 50
Age (Years)
Hea
rt R
ate
(BP
M)
50
70
60
80
90
100
Scatterplot of two quantitative variables, age and heart rate:
Misleading Graphs
40
50
60
70
80
90
100
1 2 3 4
Variable NumberP
erc
en
t C
han
ge F
rom
Con
trol
Drug Placebo
80
82
84
86
88
90
92
94
96
98
100
1 2 3 4
Variable Number
Perc
en
t C
han
ge F
rom
Con
trol
Drug Placebo
Warning: When interpreting graphs in the literature, make sure to look at the scales of the axes: different scaling can exaggerate or minimize comparisons