Lab 3.2 - Improvements on 3.1 from Peers

Jon Sims

Setup + Factor Conversion

No output here, just getting datasetsICR and ggplot2 loaded, and converting to factor on Gender.

Checking Data

[1] "Age"              "Gender"           "Housing"          "Saving accounts" 
[5] "Checking account" "Credit amount"    "Duration"         "Purpose"         
[9] "Class Risk"      
'data.frame':   1000 obs. of  9 variables:
 $ Age             : num  67 22 49 45 53 35 53 35 61 28 ...
 $ Gender          : Factor w/ 2 levels "female","male": 2 1 2 2 2 2 2 2 2 2 ...
 $ Housing         : chr  "own" "own" "own" "free" ...
 $ Saving accounts : chr  NA "little" "little" "little" ...
 $ Checking account: chr  "little" "moderate" NA "little" ...
 $ Credit amount   : num  1169 5951 2096 7882 4870 ...
 $ Duration        : num  6 48 12 42 24 36 24 36 12 30 ...
 $ Purpose         : chr  "radio/TV" "radio/TV" "education" "furniture/equipment" ...
 $ Class Risk      : num  1 2 1 1 2 1 1 1 1 2 ...
   Age Gender Housing Saving accounts Checking account Credit amount Duration
1   67   male     own            <NA>           little          1169        6
2   22 female     own          little         moderate          5951       48
3   49   male     own          little             <NA>          2096       12
4   45   male    free          little           little          7882       42
5   53   male    free          little           little          4870       24
6   35   male    free            <NA>             <NA>          9055       36
7   53   male     own      quite rich             <NA>          2835       24
8   35   male    rent          little         moderate          6948       36
9   61   male     own            rich             <NA>          3059       12
10  28   male     own          little         moderate          5234       30
               Purpose Class Risk
1             radio/TV          1
2             radio/TV          2
3            education          1
4  furniture/equipment          1
5                  car          2
6            education          1
7  furniture/equipment          1
8                  car          1
9             radio/TV          1
10                 car          2
     Age Gender Housing Saving accounts Checking account Credit amount Duration
991   37   male     own            <NA>             <NA>          3565       12
992   34   male     own        moderate             <NA>          1569       15
993   23   male    rent            <NA>           little          1936       18
994   30   male     own          little           little          3959       36
995   50   male     own            <NA>             <NA>          2390       12
996   31 female     own          little             <NA>          1736       12
997   40   male     own          little           little          3857       30
998   38   male     own          little             <NA>           804       12
999   23   male    free          little           little          1845       45
1000  27   male     own        moderate         moderate          4576       45
                 Purpose Class Risk
991            education          1
992             radio/TV          1
993             radio/TV          1
994  furniture/equipment          1
995                  car          1
996  furniture/equipment          1
997                  car          1
998             radio/TV          1
999             radio/TV          2
1000                 car          1

Creating the Plot Variable

No output here either, just creating the base plot to easily add onto in later steps.

FIRST SUBMISSION FROM LAB 3.1: Final Chart with All Descriptors

This is my first chart from lab 3.1, before teammates improvements added.

CHART REVISIONS BASED OFF OF CLASSMATES RECOMMENDATIONS

Here is my new and improved chart, teammates additions included.

Teammates Improvements

  • My teammates’ recommendation was to apply a log10 scale to the credit amount axis to address the skew I was seeing and reduce clustering at lower values. This change makes the nonlinear relationship between credit amount and loan duration clearer for both genders. Overall I think the updated chart improves the interpretability and also the visual balance of my chart without altering the underlying data.