oldoc63 / learningDS

Learning DS with Codecademy and Books
0 stars 0 forks source link

Contingency Tables: Proportions #410

Open oldoc63 opened 1 year ago

oldoc63 commented 1 year ago

Sometimes it's helpful to convert frequencies to proportions. We can accomplish this by dividing all the frequencies in a contingency table by the total number of observations (the sum of the frequencies):

oldoc63 commented 1 year ago

The resulting contingency table makes it slightly easier to compare the proportion of people in each category. For example, we see that the two largest proportions in the table (.399 and .271) are in the yes/yes and no/no cells of the table. We can also see that almost 40% of the surveyed population (by far the largest proportion) both see themselves as leaders and think they have a talent for influencing people.

oldoc63 commented 1 year ago

Convert the table special_authority_freq to a table of proportions and save the result as special_authority_prop, the print it out.