LoslegenKostenlos loslegen

Race and Ethnic Representation in the Mortgage Data

In this exercise, you'll get the race and ethnic proportions of borrowers in the mortgage data set, adjusted by the total number of borrowers. This will turn the race and ethnicity table you created before into a proportion. Later on, you'll use these values to adjust for the race and ethnic proportions of the US population.

Diese Übung ist Teil des Kurses

Scalable Data Processing in R

Kurs anzeigen

Anleitung zur Übung

The reference object mort is available in your workspace.

  • Create a table from the borrower_race column in the mortgage data (mort) using bigtable().
  • Where the race is known (first 7 values) find the proportion by dividing by the sum of the counts.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Create a table of borrower_race column
race_table <- ___(mort, ___)

# Rename the elements
names(race_table) <- race_cat[as.numeric(names(race_table))]

# Find the proportion
race_table[___] / ___(race_table[1:7])
Code bearbeiten und ausführen