CCGPs Unit 4 Teacher’s Notes

Two-Way Tables: Marginal and Joint frequencies

The variables we have worked with recently have been quantitative variables (numbers). Now, we will work with categorical variables. Two-way tables compare two categorical variables. Entries in the cells of a two-way table can be displayed as frequency counts or as relative frequencies

Two-Way Table:

  • Describes the relationship between two categorical variables.
  • Represents a table of counts.

Example:

Dance / Sports / TV / Total
Men / 2 / 10 / 8 / 20
Women / 16 / 6 / 8 / 30
Total / 18 / 16 / 16 / 50

Table 1

The two-way table shows the favorite leisure activities for 50 adults - 20 men and 30 women. Because entries in the table are frequency counts, the table is a frequency table.

Entries in the "Total" row and "Total" column are called marginal frequencies or the marginal distribution. Entries in the body of the table are called joint frequencies.The grand total is the sum of the row totals and/or the sum of the column totals.

  1. List some observations from the table.

If we looked only at the marginal frequencies in the Total row, we might conclude that the three activities had roughly equal appeal. Yet, the joint frequencies show a strong preference for dance among women; and little interest in dance among men.

Table 2: Years of education and income.

Suppose a random sample of 1,000 people was selected and the following data was obtained:

<$10,000 / $10,000-$30,000 / $30,001-$50,000 / >$50,000 / Total
Years None
Of Some College
College Bachelor
Post-grad / 100
85
55
10 / 85
110
95
10 / 50
60
175
15 / 15
20
50
65 / 250
275
375
100
Total / 250 / 300 / 300 / 150 / 1,000

Note: Each person surveyed represents a case. Each case fits into exactly one education class and one income category, so each case fits in one and only one cell of the body of the table.

  1. What are margins?

Margins are located on the edges of something. Example: the margin of your paper

  1. What are marginal frequencies?

Marginal frequencies are the totals of the frequencies in the rows and the totals of the frequencies of the columns. They are located in the “margins” of the table.

  1. List the marginal frequencies in table 2.

250, 275, 375, 100, 250, 300, 300, 150

  1. What are joint frequencies?

Joint frequencies are the frequencies located in the body of the table.

  1. List the joint frequencies in the table.

100, 85, 50, 15, 85, 110, …,10, 15, 65

  1. What percentage of people making over $50,000 had no college education?

15/150 = 1/10 = Only 10%

  1. What is the grand total for table 2?

1000 (the number in the intersection of the Total row and the Total column)

For / Against / No opinion / Total
21 - 40 / 25 / 20 / 5 / 50
41 - 60 / 20 / 35 / 20 / 75
Over 60 / 55 / 15 / 5 / 75
Total / 100 / 70 / 30 / 200

A public opinion survey explored the relationship between age and support for increasing the minimum wage. The results are summarized in the two-way table to the right.

9. In the 21 to 40 age group, what percentage supports increasing the minimum wage?

(A) 12.5% (B) 20% (C) 25% (D) 50% (E) 75%

Solution: The correct answer is (D). A total of 50 people in the 21 to 40 age group were surveyed. Of those, 25 were for increasing the minimum wage. Thus, half of the respondents in the 21 to 50 age group (50%) supported increasing the minimum wage.

CCGPs Unit 4 Student Notes

Two-Way Tables: Marginal and Joint frequencies

The variables we have worked with recently have been quantitative variables (numbers). Now, we will work with categorical variables. Two-way tables compare two categorical variables. Entries in the cells of a two-way table can be displayed as frequency counts or as relative frequencies

Two-Way Table:

  • Describes the relationship between two categorical variables.
  • Represents a table of counts.

Example:

Dance / Sports / TV / Total
Men / 2 / 10 / 8 / 20
Women / 16 / 6 / 8 / 30
Total / 18 / 16 / 16 / 50

Table 1

The two-way table shows the favorite leisure activities for 50 adults - 20 men and 30 women. Because entries in the table are frequency counts, the table is a frequency table.

Entries in the "Total" row and "Total" column are called marginal frequencies or the marginal distribution. Entries in the body of the table are called joint frequencies.The grand total is the sum of the row totals and/or the sum of the column totals.

  1. List some observations from table1.

Table 2: Years of education and income.

Suppose a random sample of 1,000 people was selected and the following data was obtained:

<$10,000 / $10,000-$30,000 / $30,001-$50,000 / >$50,000 / Total
Years None
Of Some College
College Bachelor
Post-grad / 100
85
55
10 / 85
110
95
10 / 50
60
175
15 / 15
20
50
65 / 250
275
375
100
Total / 250 / 300 / 300 / 150 / 1,000

Note: Each person surveyed represents a case. Each case fits into exactly one education class and one income category, so each case fits in one and only one cell of the body of the table.

  1. What, in general, are margins?
  1. What are marginal frequencies?
  1. List the marginal frequencies in table 2.
  1. What are joint frequencies?
  1. List the joint frequencies in table 2.
  1. What percentage of people making over $50,000 had no college education?
  1. What is the grand total for table 2?

For / Against / No opinion / Total
21 - 40 / 25 / 20 / 5 / 50
41 - 60 / 20 / 35 / 20 / 75
Over 60 / 55 / 15 / 5 / 75
Total / 100 / 70 / 30 / 200

TABLE 3: A public opinion survey explored the relationship between age and support for increasing the minimum wage. The results are summarized in the two-way table to the right.

9. In the 21 to 40 age group, what percentage supports increasing the minimum wage?

(A) 12.5% (B) 20% (C) 25% (D) 50% (E) 75%

Unit 4 Lesson 3 Relative Frequency Practice

In the previous lesson, you learned how to complete a two-way table.

MP3 PLAYER / NO MP3 PLAYER / Total
CELL PHONE / 60 / 38 / 98
NO CELL PHONE / 34 / 25 / 59
Total / 94 / 63 / 157

Since relative frequency is the ratio of the value of subtotal to the value of the total. In other words it is a fraction, , that is divided to find the relative frequency as a decimal. Remember that a decimal can be written as a percent.

For each number in the table, find the relative frequency.

For example, students who have a cell phone and MP3 player is . This is a relative frequency of 0.38.

Find the relative frequency for each as a decimal and as a percent

a. cell phone and no MP3 player:______

b. cell phone total and grand total:______

c. no cell phone and MP3 player:______

d. no cell phone and no MP3 player; ______

e. no cell phone total and grand total:______

f. MP3 player total and grand total:______

g. No MP3 player total and grand total:______

Now complete the table with the relative frequencies.

MP3 PLAYER / NO MP3 PLAYER / Total
CELL PHONE / 0.38
NO CELL PHONE
Total

There are also marginal frequencies from the bottom and right margins. These frequencies lack one of the categories. For our example, the frequencies at the bottom are percents of students who either have or do not have an MP3 player.

The frequencies on the right represent students the percent of students who have or do not have a cell phone.

These still use the , however the totals come from the margins, not the grand total.

Example: What percent of students have an MP3 player and a cell phone out of all the students who have an MP3 player? =

MP3 PLAYER / NO MP3 PLAYER / Total
CELL PHONE / 60 / 38 / 98
NO CELL PHONE / 34 / 25 / 59
Total / 94 / 63 / 157

Find the marginal frequency for each as a decimal and as a percent

a. A student who has a cell phone and an MP3 player out of students who have cell phones: ______

b. A student who has a cell phone and no MP3 player out of students who have a cell phone: ______

d. A student who has no cell phone and do have an MP3 player out of students who don’t have an cell phone; ______

e. A student who has no cell phone and don’t have MP3 player out of students who don’t have cell phones: ______

f. A student who has an MP3 player and a cell phone out of students who have MP3 players:______

g. A student who has an MP3 player and no cell phone out of students that have MP3 players:______

h. A student who doesn’t have an MP3 and do have a cell phone out of students who don’t have an MP3 player: ______

i. A student who doesn’t have an MP3 and don’t have a cell phone out of students who don’t have an MP3 player: ______

Complete the table below with the marginal frequencies from above.

MP3 PLAYER / NO MP3 PLAYER / Total
CELL PHONE
NO CELL PHONE
Total

CCGPs Unit 4 Lesson 2 Day 3Teacher’s Notes

Conditional Distributions

  • If you want the proportion of cases associated with any cell in the table we divide the count for that cell by the grand total (the total number of cases in the entire table). If we do this for each cell, we will have the conditional distribution of our two categorical variables.

Relative Frequency

  • To compute relative frequency, one obtains a frequency count for the total population and a frequency count for a subgroup of the population. The relative frequency for the subgroup is:

Relative frequency = Subgroup count / Total count

  • The above equation expresses relative frequency as a proportion. It is also often expressed as a percentage. Thus, a relative frequency of 0.50 is equivalent to a percentage of 50%.

Dance / Sports / TV / Total
Men / 2 / 10 / 8 / 20
Women / 16 / 6 / 8 / 30
Total / 18 / 16 / 16 / 50

Table 1: Frequency table

The two-way table shows the favorite leisure activities for 50 adults - 20 men and 30 women. Because entries in the table are frequency counts, the table is a frequency table.

Dance / Sports / TV / Total
Men / 0.04 / 0.20 / 0.16 / 0.40
Women / 0.32 / 0.12 / 0.16 / 0.60
Total / 0.36 / 0.32 / 0.32 / 1.00

The table to the left shows preferences for leisure activities in the form of relative frequencies. The relative frequencies in the body of the table are called conditional frequencies or the conditional distribution.

  1. How do you turn a two-way frequency table into a two-way relative frequency table?

To turn a two-way frequency table into a two-way relative frequency table (also called a conditional table), divide every number in the table by the total number of elements in the population/sample space.

  1. Complete the following two way frequency table. Then, construct a relative frequency table:

Favorite Extra-Curricular Activities for a class of 30 Students

Athletics / Music/Arts / SGA / Other / Total
Male / 10 / 5 / 1 / 2 / 18
Female / 5 / 6 / 0 / 1 / 12
Total / 15 / 11 / 1 / 3 / 30

Relative Frequency Table of Favorite Extra-Curricular Activities for a class of 30

Athletics / Music/Arts / SGA / Other / Total
Male / 10/30≈33.3% / 5/30≈16.7% / 1/30≈3.3% / 2/30≈6.6% / 18 /30=60%
Female / 5/30≈16.7% / 6/30=20% / 0/30=0% / 1/30≈3.3% / 12/30=40%
Total / 15/30=50% / 11/30≈36.7% / 1/30≈3.3% / 3/30=10% / 30/30=100%
  1. How are relative marginal frequencies calculated?

Relative marginal frequencies are calculated by taking the row or column totals and dividing it by the table total.

  1. What is the relative marginal frequency of students who favor athletics?

15/30 or 50%

  1. What is the relative marginal frequency of students who favor SGA?

1/30 or ≈ 3.3%

  1. What is the relative marginal frequency of males?

18/30 or 3/5 or 60%

  1. What is the distribution of favorite extra-curricular activities? (In this case they want you to list each extra-curricular activity with its relative marginal frequency). Athletics: 15/30 or ½ or 50%; Music/Arts: 11/30 ≈ 36.7%;

SGA: 1/30 or ≈ 3.3%; Other: 3/30 or 1/10 or 10%.

  1. How do you calculate relative conditional frequencies?

These are calculated by dividing a cell by its respective row or column total.

  1. What is the relative conditional frequency of SGA for males?

1/18 or ≈ 5.6% because there is 1 male out of the 18 males prefers SGA.

  1. What is the relative conditional frequency of males for SGA?

1/1 or 100% because all students that prefer SGA are males.

  1. What percent of males prefer athletics?

10/18 ≈ 55.6%

  1. What percent of students who prefer music/arts are females?

6/11≈54.5%

  1. What is the relative conditional frequency of other for males?

2/18 or 1/9 ≈ 11.1%

Suppose a survey of the entire freshman class at a local high school was performed and the results are listed below. Since we have different sample sizes, we need a way to compare the data without just the counts. We can calculate the relative joint frequencies to do this.

Favorite Extra-Curricular Activities for all 200 Students

Athletics / Music/Arts / SGA / Other / Total
Male / 28 / 31 / 12 / 19 / 90
Female / 34 / 40 / 14 / 22 / 110
Total / 62 / 71 / 26 / 41 / 200
  1. Calculate the Relative Joint Frequencies of all 200 students.

Athletics / Music/Arts / SGA / Other / Total
Male / 28/200=14% / 31/200=15.5% / 12/200=6% / 19/200=9.5% / 90/200=45%
Female / 34/200=17% / 40/200=20% / 14/200=7% / 22/200=11% / 110/200=55%
Total / 62/200=31% / 71/200=35.5% / 26/200=13% / 41/200=20.5% / 200/200=100%

Note that the bold values are relative marginal frequencies and that the values in the table are the relative joint frequencies.

  1. What percent of the students are male and prefer athletics?

14% of the students are male and prefer athletics.

  1. What are the similarities and differences of the class data and the entire Freshman class?

Some possible answers are:There is a similar percentage of students who prefer music/arts: us – 35.5%; them – 36.7%; the class prefers athletics about 19% more than the school: us – 50%; them – 31%; the class has a larger percentage of females than males as opposed to the school: us – 45% male and 55% female; them- 60% male and 40% female. In the class it appears that males who prefer athletics (33.3%) is more than males who prefer the other choices combined (16.7%+3.3%+6.6% = 26.6%). Females in the class appear to highly prefer athletics and music/arts.

Table 2: Years of education and income.

Suppose a random sample of 1,000 people was selected and the following data was obtained:

<$10,000 / $10,000-$30,000 / $30,001-$50,000 / >$50,000 / Total
Years None
Of Some College
College Bachelor
Post-grad / 100
85
55
10 / 85
110
95
10 / 50
60
175
15 / 15
20
50
65 / 250
275
375
100
Total / 250 / 300 / 300 / 150 / 1,000
  1. Find the conditional distribution for table 2.

<10,000 / 10,000-30,000 / 30,001-50,000 / >50,000 / Total
Years None
Of some College
Education Bachelor
Post-grad / 10%
8.5%
5.5%
1% / 8.5%
11%
9.5%
1% / 5%
6%
17.5%
1.5% / 1.5%
2%
5%
6.5% / 25%
27.5%
37.5%
10%
Total / 25% / 30% / 30% / 15% / 100%

Conditional Distributions of Categorical variables:

In conditional distributions, we find the distribution of one categorical variable given a common level of another categorical variable. To do so, you divide each relative frequency in the conditional category (row or column) by the associated marginal distribution (the total percentage in that row or column)

  1. For the example above, find the conditional distribution of education among people earning more than $50,000.

None: 1.5/15 = 0.10

Some College:2/15 =0.13

Bachelor:5/15 = 0.33

Post-grad:6.5 /15 = 0.43

  1. For the example above, find the conditional distribution of people’s earnings given they have a Bachelor’s Degree.

< $10,000: 5.5/37.5 = 0.147

$10,000 – $30,000:9.5/37.5 =0.253

$30,001- $50,000:17.5/37.5 = 0.467

> $50,000:5 /37.5 = 0.133

  1. How do you find conditional distributions of one categorical variable?

You divide each relative frequency in the conditional category (row or column) by the associated marginal distribution (the total percentage in that row or column)
CCGPs Unit 4 Lesson 3 Day 2 Student’s Notes

Conditional Distributions

  • If you want the proportion of cases associated with any cell in the table we divide the count for that cell by the grand total (the total number of cases in the entire table). If we do this for each cell, we will have the conditional distribution of our two categorical variables.

Relative Frequency

  • To compute relative frequency, one obtains a frequency count for the total population and a frequency count for a subgroup of the population. The relative frequency for the subgroup is:

Relative frequency = Subgroup count / Total count

  • The above equation expresses relative frequency as a proportion. It is also often expressed as a percentage. Thus, a relative frequency of 0.50 is equivalent to a percentage of 50%.

Dance / Sports / TV / Total
Men / 2 / 10 / 8 / 20
Women / 16 / 6 / 8 / 30
Total / 18 / 16 / 16 / 50

Table 1: Frequency table

The two-way table shows the favorite leisure activities for 50 adults - 20 men and 30 women. Because entries in the table are frequency counts, the table is a frequency table.

Dance / Sports / TV / Total
Men / 0.04 / 0.20 / 0.16 / 0.40
Women / 0.32 / 0.12 / 0.16 / 0.60
Total / 0.36 / 0.32 / 0.32 / 1.00

The table to the left shows preferences for leisure activities in the form of relative frequencies. The relative frequencies in the body of the table are called conditional frequencies or the conditional distribution.

  1. How do you turn a two-way frequency table into a two-way relative frequency table?
  1. Complete the following two way frequency table. Then, construct a relative frequency table:

Favorite Extra-Curricular Activities for a class of 30 Students

Athletics / Music/Arts / SGA / Other / Total
Male / 10 / 5 / 1 / 2 / 18
Female / 5 / 6 / 0 / 1 / 12
Total / 15 / 11 / 1 / 3 / 30

Relative Frequency Table of Favorite Extra-Curricular Activities for a class of 30

Athletics / Music/Arts / SGA / Other / Total
Male
Female
Total
  1. How are relative marginal frequencies calculated?
  1. What is the relative marginal frequency of students who favor athletics?
  1. What is the relative marginal frequency of students who favor SGA?
  1. What is the relative marginal frequency of males?
  1. What is the distribution of favorite extra-curricular activities? (In this case they want you to list each extra-curricular activity with its relative marginal frequency).
  1. How do you calculate relative conditional frequencies?
  1. What is the relative conditional frequency of SGA for males?
  1. What is the relative conditional frequency of males for SGA?
  1. What percent of males prefer athletics?
  1. What percent of students who prefer music/arts are females?
  1. What is the relative conditional frequency of other for males?

Suppose a survey of the entire freshman class at a local high school was performed and the results are listed below. Since we have different sample sizes, we need a way to compare the data without just the counts. We can calculate the relative joint frequencies to do this.

Favorite Extra-Curricular Activities for all 200 Students

Athletics / Music/Arts / SGA / Other / Total
Male / 28 / 31 / 12 / 19 / 90
Female / 34 / 40 / 14 / 22 / 110
Total / 62 / 71 / 26 / 41 / 200
  1. Calculate the Relative Joint Frequencies of all 200 students.

Athletics / Music/Arts / SGA / Other / Total
Male
Female
Total
  1. What percent of the students are male and prefer athletics?
  1. What are the similarities and differences of the class data and the entire Freshman class?

Table 2: Years of education and income.

<$10,000 / $10,000-$30,000 / $30,001-$50,000 / >$50,000 / Total
Years None
Of Some College
College Bachelor
Post-grad / 100
85
55
10 / 85
110
95
10 / 50
60
175
15 / 15
20
50
65 / 250
275
375
1000
Total / 250 / 300 / 300 / 150 / 1,000
  1. Find the conditional distribution for table 2.

<10,000 / 10,000-30,000 / 30,001-50,000 / >50,000 / Total
Years None
Of Some College
Education Bachelor
Post-grad
Total

Conditional Distributions of Categorical variables: