Professional Documents
Culture Documents
Chapter 2 - Displaying and Describing Categorical Data
Chapter 2 - Displaying and Describing Categorical Data
Announcements
Clarification on labs: There is a lab every
week.
Please fill out the student survey.
If you have not already, read the syllabus!
Online homework due Wednesday, September
3rd, by 8am! So, may want to finish it by
Tuesday. You can complete this assignment
now. It is only about chapter 1, and we have
finished chapter 1! You can start the
assignment, save, and go back to it later. You
cannot take it more than once.
Chapter Outline
Review 5 Ws of Data
Review Categorical Variables
Distribution of One Categorical Variable
Relationship between Two Categorical
Variables
What
What variables, columns in data file
Where
Where did the data come from?
When
When were the data collected?
Why
Why did we collect data?
How
How did we get the data?
Categorical Variables
Variables with labels as values.
Gender
Eye Color
Year in School
Other)
Where Iowa State University
When Spring 2004 through Spring 2007
Why As a part of a survey to collect
interesting demographic data on Stat 101
students to use during the course.
How Data collected through Internet survey.
Summarizing a Single
Categorical Variable
Number, proportion or percentage of Whos in
each category.
Summarize with
Frequency Table (Relative Frequency Table)
Bar Chart
Pie Chart
Frequency
729
Relative
Frequency
0.35251
brown
642
0.31044
green
308
0.14894
hazel
347
0.16779
other
42
0.02031
Total
2068
1.00000
Bar Chart
Displays either number or percentage for
each category.
Compare heights of bars.
Do not need to have all categories in display.
Example of a Bar
Chart
Eye Colors of Stat 101 Students
Blue
Brown
Green
Hazel
Other
Pie Chart
Displays percentage of whole for each
category.
Compare sizes of pie slices.
Must have all categories in display.
categorical variables?
Two variables
Variable of interest = Response variable
Other variable = Explanatory variable
The explanatory variable is being used to
variables.
variables.
Friday Announcements
First online homework due Wednesday at 8am, no
exceptions.
After you submit, you will be able to go to your grades
Online Homework 2:
displays bar graphs with no spaces, which is incorrect.
We have only learned pie charts, bar charts,
frequency/relative frequency tables, and mosaic plots.
If an online homework question mentions a different
display (scatterplot, histogram), it cannot be a
correct answer!
Friday Announcements
Personal glossaries are now available for
JMP
Still working on communicating with our IT person.
If you would prefer to use a campus computer and
variable
Contingency Table
Eye Color
Gender Blue Brown Green Hazel
Other
Total
Female 370
352
198
187
18
1125
Male
359
290
110
160
24
943
Total
729
642
308
347
42
2068
Marginal Distributions
Looks at percentages for each variable
Contingency Table
Eye Color
Gender Blue Brown Green Hazel
Other
Total
Female 370
352
198
187
18
1125
Male
359
290
110
160
24
943
Total
729
642
308
347
42
2068
Example:
Marginal Distribution of Eye Color
Blue = 729/2068
Brown = 642/2068
Green = 308/2068
Hazel = 347/2068
Other = 42/2068
Conditional Distributions
Looks at percentages for one variable
Contingency Table
Eye Color
Gender Blue Brown Green Hazel
Other
Total
Female 370
352
198
187
18
1125
Male
359
290
110
160
24
943
Total
729
642
308
347
42
2068
Example:
Eye Color conditioned on Gender = Females
Blue = 370/1125
Brown = 352/1125
Green = 198/1125
Hazel = 187/1125
Other = 18/1125
Blue
Female
370
Male
Total
Brown Green
352
198
290
110
160
642
308
347
18
1125
(1.60)
(100)
24
943
(2.55)
(100)
42
2068
(2.03)
(100)
729/2068 = .35
Eye Color
Gender Blue Brown Green Hazel
Other
Total
Female 370
352
198
187
18
1125
Male
359
290
110
160
24
943
Total
729
642
308
347
42
2068
642/2068 = .31
Eye Color
Gender Blue Brown Green Hazel
Other
Total
Female 370
352
198
187
18
1125
Male
359
290
110
160
24
943
Total
729
642
308
347
42
2068
Other
Total
Female 370
352
198
187
18
1125
Male
359
290
110
160
24
943
Total
729
642
308
347
42
2068
352/2068 = .17
Eye Color
Other
Total
Female 370
352
198
187
18
1125
Male
359
290
110
160
24
943
Total
729
642
308
347
42
2068
Mosaic Plot
Graphical summary of conditional
other
ey ec olor
hazel
0.75
green
0.50
brow n
0.25
blue
0.00
female
male
sex
other
ey ec olor
hazel
0.75
green
0.50
brow n
0.25
blue
0.00
female
male
sex
other
ey ec olor
hazel
0.75
green
0.50
brow n
0.25
blue
0.00
female
male
sex