Skip to content
BI & Data ScienceCharts, maps and dashboards

Formulas for this chapter

Relative frequency

relative frequency = count in category / n Excel: =COUNTIF(range, category) / COUNTA(range)

Turning a raw categorical column into a distribution that can be charted. The relative frequencies must sum to 1.

count in category
Number of observations with that value
n
Total number of observations, not the number of categories

Row and column percentage in a cross-tab

row % = cell / row total column % = cell / column total

Reading a cross-tabulation. Decide first which conditional question you are asking; the two percentages answer different questions and rarely agree.

cell
Count in one row-column combination
row total, column total
Margin totals of the cross-tab

Equal-interval class width for a choropleth

class width = (max - min) / number of classes

Choosing shading bands for a map. Compare against quantile bands before publishing: the same data looks calm or alarming depending on the choice.

max, min
Largest and smallest values in the variable
number of classes
How many shading bands the legend will have
Step 2 of 23
The real wordsTheory

Table or chart?

The textbook's rule is about precision against pattern.

Use a tablewhen the reader needs to look up an exact value, when several units of measure sit side by side, or when both totals and detail matter.
Use a chartwhen the message is a pattern, a comparison or a trend rather than a particular number.

So a monthly AQI average by month goes in a table if someone has to quote the figure, and in a line chart if the point is that winter is worse than summer.