We can “pile” the data by counting the number of data values in each category of interest. We can organize these counts into a frequency table , which records the totals and the category names.

Full text

(1)

What I will know and be able to do

What you should know and be able to do:

• Identify a categorical variable and choose an appropriate display for it.

• Compare conditional and marginal percentages to examine the association between categorical variables.

(2)

(3)

(4)

(5)

(6)

(7)

(8)

Bar Charts

 A bar chart displays the distribution of a categorical variable, showing the counts for each category next to each other for easy comparison.

 A bar chart stays true to the area principle.

 The bars are usually spaced apart to make the graph more readable.

(9)

(10)

(11)

Pie Charts

• When you are interested in parts of the whole, a pie chart might be your display of choice.

• Pie charts show the whole group of cases as a circle.

• They slice the circle into pieces whose size is proportional to the fraction

of the whole in each category.

• May need a key!

(12)

(13)

Example: Creating Graphs

Graph eye color for our class – three ways! Comment on your graph.

Remember, bars do not touch!! Do you need a key?

(14)

Contingency Tables

• A contingency table allows us to look at two categorical variables together.

• It shows how individuals are distributed along each variable, contingent on the value of the other variable.

(15)

Contingency Tables (cont.)

• The margins of the table, both on the right and on the bottom, give totals and the frequency distributions for each of the

variables.

• Each frequency distribution is called a marginal distribution of its respective variable.

(16)

Contingency Tables (cont.)

• Each cell of the table gives the count for a combination of values of the two values.

(17)

(18)

(19)

(20)

(21)

(22)

Segmented Bar Charts

• A segmented bar chart displays the same information as a pie chart, but in the form of bars instead of circles.

• Each bar is treated as the “whole” and is divided proportionally into segments corresponding to the percentage in each group.

• Here is the segmented bar chart for ticket Class by Survival status:

Titanic Survivors and Casualties

(23)

Segmented Bar Charts

(24)
(25)

(26)

Example –

A survey of autos parked in student and staff lots at a large university classified the brands by country of origin as seen in the table.

a. What percent of all the cars surveyed were foreign?

b. What percent of the American cars were owned by students? c. What percent of the students owned American cars?

d. What is the marginal distribution of origin?

e. What are the conditional distributions of origin by for each driver classification? f. Do you think that origin of the car is independent of the type of driver? Explain.

Student Staff American 107 105 European 33 12

Asian 55 47

(27)

Example

a. What percent of all the cars surveyed were foreign? 147/359 = 40.95%

b. What percent of the American cars were owned by students? 107/212 = 50.47% c. What percent of the students owned

American cars? 107/195 = 54.87%

d. What is the marginal distribution of origin?

Origin Totals Percentages American 212 59.05% European 45 12.53% Asian 102 28.41%

(28)

Example

Origin Staff Percentage American 105 64.02% European 12 7.32%

Asian 47 28.66%

Totals 164 100.00% Origin Student Percentage American 107 54.87% European 33 16.92%

Asian 55 28.21%

Totals 195 100.00%

Slide 3- 28

d. What are the conditional distributions of origin by driver classification?

(29)

What Can Go Wrong?

• Don’t violate the area principle.

(30)

What Can Go Wrong? (cont.)

• Don’t overstate your case—don’t claim something you can’t.

• Don’t use unfair or silly averages—this could lead to

Simpson’s Paradox, so be careful when you average one variable across different levels of a second

(31)

What Can Go Wrong? (cont.)

• Don’t confuse similar-sounding percentages—pay particular attention to the wording of the context. For example:

• What percentage of seniors are males?

• What percentage of males are seniors?

• Don’t forget to look at the variables separately too—examine the

(32)

What Can Go Wrong? (cont.)

• Keep it honest—make sure your display shows what it says it shows.

(33)

(34)

What have we learned?

• We can summarize categorical data by counting the number of cases in each category (expressing these as counts or percents).

• We can display the distribution in a bar chart or pie chart.

• And, we can examine two-way tables called contingency tables,

(35)

(36)

(37)

AP Tips, cont.

• Segmented bar graphs are powerful. But only when the categories add to a meaningful total. Take a look at the 2010 AP exam, problem #6. Why can this graph not be segmented?

Updating...