You are on page 1of 7

Categorical variables.

Visualization techniques
Ice cream shop

Note: You may solve these problems both on paper or in a software of your choice. The medium is not crucial.

Background There is an ice cream shop, that is operating in New York, LA and San Francisco.
Data You have sold 12,327 ice creams in New York; 17,129 in LA and 19,923 in San Francisco.
Task Order the data in a frequency distribution table.

Solution:

Frequency
New York 12,327
LA 17,129
San Francisco 19,923
Total 49,379
Categorical variables. Visualization techniques
Ice cream shop

Background You have a frequency distribution table with all the sales.
Task Create a bar chart, representing the data. Note that in Excel, the term for a bar charts are called both: 'column charts' and

Solution:

Frequency
New York 12,327
LA 17,129
San Francisco 19,923
Total 49,379

In order to create a chart in excel, you should select the data. In this case the cells B11, B12, B13, C11, C12 and C13. Then you click Inser
Both solutions are acceptable. However, the left one is the one that you would observe more often.

Sales
Sales

San Francisco 19,923


Frequency

LA 17,129

New York 12,327

12,327 17,129 19,923 Frequency

New York LA San Francisco


e called both: 'column charts' and 'bar charts'.

12 and C13. Then you click Insert and then choose the appropriate chart for your case.

es

cisco 19,923

LA 17,129

York 12,327

Frequency
Categorical variables. Visualization techniques
Ice cream shop

Background You have a frequency distribution table with all the sales.
Task 1 Create a new column in your table, representing the relative frequency of input. You can choose to express it in percentag
Task 2 Create a pie chart, representing the share of each city to the sales of your company.

Solution:

Frequency Relative frequency or.. relative frequency Ice crea


New York 12,327 25% 0.25
LA 17,129 35% 0.35
San Francisco 19,923 40% 0.40 San
Total 49,379 100% 1.00 Franci sco;
40.35%
You may choose to create your pie chart using the frequency, relative frequency in % or in decimals.
All three solutions will result in the same pie chart.
Generally, you should use the absolute frequency, but put the relative one as labels for the chart.
Excel gives the possibility to put the relative frequency, stated in % as data labels, even if you haven't calculated it.

In the left chart, we have used the automatic labeling.


In the right chart, we have put the labels as cell values from the table.
hoose to express it in percentages or as a decimal.

Ice cream sales share Ice cream sales share


New York;
24.96% New York

San San
Franci sco; Francisco
40.35%

LA; 34.69% LA
Categorical variables. Visualization techniques
Ice cream shop

Background You have a frequency distribution table with all the sales. You also have the relative frequency from the pie chart problem.
Task 1 Order the table by frequency.
Task 2 Create a bar (column) chart representing the ordered data.
Task 3 In a new column, calculate the cumulative frequency of the data.
Task 4 On a second axis in the same chart, represent the cumulative frequency of the data.

Solution:

Ordered Frequency Relative frequency Cumulative frequency


San Francisco 19,923 40% 40%
LA 17,129 35% 75%
New York 12,327 25% 100%
Total 49,379 100%

Adding a second axis is not so straightforward in Excel.


This may be done in various ways. Here is a link to Microsoft's article on the topic. Link
For the purposes of statistics, you need to understand the application of the cumulative frequency line.
Drawing it in Excel is not top priority for this course.
cy from the pie chart problem.

Sales
25,000 100%
90%
20,000 80%
70%
15,000 60%
Frequency

50%
10,000 40%
30%
5,000 20%
10%
19,923 17,129 12,327
- 0%
San Francisco LA New York

You might also like