23
Categorical Data! • Frequency Table – Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative frequency table. • Distribution – Shows the possible values of the variable and the relative frequency of each value

Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

Embed Size (px)

Citation preview

Page 1: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

Categorical Data!• Frequency Table

– Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative frequency table.

• Distribution– Shows the possible values of the variable and

the relative frequency of each value

Page 2: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

Types of Graphs

• Picture – Remember…

– Ex: Stem & Leaf

Page 3: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

• Bar Chart – counts for comparison

Page 5: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

Segmented Bar Chart

Page 6: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

Contingency Table• Displays counts and sometimes percentages of

individuals falling into named categories on two or more variables. Shows how individuals are distributed along each variable contingent on the value of another variable.– Marginal distribution: distribution of either variable by

itself (last row or column)– Conditional Distribution: distribution of 1 variable for

those individuals satisfying a condition on another variable. Considers a smaller group isolated from the whole.

Page 7: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

Independence???• Independence…think impact!

– Variables are independent (one variable does not influence the value of the other variable) if the conditional distribution of 1 variable is the same for each category of the other.

Page 8: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

Slide 3 - 8

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.– Example: we can examine the class of ticket and whether

a person survived the Titanic:

Page 9: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

Slide 3 - 9

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.– The marginal distribution of Survival is:

Page 10: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

Slide 3 - 10

Contingency Tables (cont.)

• Each cell of the table gives the count for a combination of values of the two values.– For example, the second cell in the crew column tells us

that 673 crew members died when the Titanic sunk.

Page 11: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

Slide 3 - 11

Conditional Distributions

• A conditional distribution shows the distribution of one variable for just the individuals who satisfy some condition on another variable.– The following is the conditional distribution of

ticket Class, conditional on having survived:

Page 12: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

Slide 3 - 12

Conditional Distributions (cont.)

– The following is the conditional distribution of ticket Class, conditional on having perished:

Page 16: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

• What percent of children have no parent that smokes?

• Students and both parents that smoke compose what percent of the total?

• Of 1 parent smokers, what is the percentage of children who smoke?

5375

1356

5375

400

2239

416

Page 17: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

Is student smoking preference independent of parent choice?

Neither Parent Smokes

One Parent Smokes

Both Parents Smoke

Student Does Not Smoke

1168

86.1%

1823

81.4%

1380 77.5%

Student Smokes

188

13.9%

416 18.6%

400 22.5%

4371

1004

1356 2239 1780 5375

Page 18: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

YearResponse of families 1991 2001

Both work full time 142 131

1 full time, 1 part time 274 244

1 full time, 1 work from home 152 173

1 full time, 1 homemaker 396 416

No Opinion 51 51

Is there evidence of a change in working patterns in families???

Page 19: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

Conditional distribution by hospital size

Slide 2 - 19

Page 20: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative

How I get to school

Slide 2 - 20

Page 22: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative
Page 23: Categorical Data! Frequency Table –Records the totals (counts or percentage of observations) for each category. If percentages are shown, it is a relative