फेडरल गारंटी वाले लोन कौन ले रहा है?
उधारकर्ता की आय इस डेटासेट में नहीं है। लेकिन स्थानीय क्षेत्र के लोगों की median आय से विभाजित वार्षिक आय मौजूद है। इसे Borrower Income Ratio कहा जाता है। आइए हर borrower income श्रेणी के लिए फेडरल गारंटी वाले लोन के अनुपात को देखें।
यह अभ्यास पाठ्यक्रम का हिस्सा है
R में Scalable Data Processing
अभ्यास निर्देश
bigtable()फंक्शन का उपयोग करकेborrower_income_ratioबनामfederal_guaranteeकी एक टेबल बनाएँ।ir_by_fgकी हर पंक्ति को, उसी पंक्ति के sum से भाग दें।
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Tabulate borrower_income_ratio and federal_guarantee
ir_by_fg <- ___(mort, ___)
# Label the columns and rows of the table
dimnames(ir_by_fg) <- list(income_cat, guarantee_cat)
# For each row in ir_by_fg, divide by the sum of the row
for (i in seq_len(nrow(___))) {
ir_by_fg[___, ] = ir_by_fg[___, ] / sum(ir_by_fg[___, ])
}
# Print
ir_by_fg