Report 3 - Univariate analysis

Descriptive Statistics task by Mykyta Zinchenko 2024-04-25

Task Description

Your task this week is to: prepare your own descriptive analysis for the “CreditCard” dataset (AER package). It is a cross-sectional dataframe on the credit history for a sample of applicants for a type of credit card.

Are the yearly incomes (in USD 10,000), credit card expenditures, age, ratio of monthly credit card expenditure to yearly income - significantly different for applicants for customers with different credit risk (“card” variable - factor)?

Prepare a professional data visualizations, descriptive statistics’ tables and interpret them.

Pre-processing and conditions

My conventions are that although we don’t know where the action is taking place, we have a credit office that is interested in credit history to sample applicants for a certain type of credit card.

Suppose it takes place in Gdansk, but we are interested in the dollar values of the bills.

We use the “CreditCard” dataset from the AER package.

table_summary <- CreditCard %>%
 select(card, income, reports, age, share) %>%
  tbl_summary(
    by = card, # grouping by 'card' variable
    statistic = list(all_continuous() ~ "{mean} ({sd})"), # we show mean and standard deviation
    digits = all_continuous() ~ 2, # set the number of decimal places
    missing = "no" # We are not interested in missing data information
  ) %>%
  add_p() %>% # We add p-values for statistical tests
  modify_header(label = "Variable") %>%
  modify_caption("Summary Statistics by Credit Card Acceptance")

Merged Table

table_summary
Summary Statistics by Credit Card Acceptance
Variable no, N = 2961 yes, N = 1,0231 p-value2
income 3.07 (1.62) 3.45 (1.71) <0.001
reports 1.59 (2.41) 0.13 (0.42) <0.001
age 33.20 (9.92) 33.22 (10.21) >0.9
share 0.00 (0.00) 0.09 (0.10) <0.001
1 Mean (SD)
2 Wilcoxon rank sum test

In the table above we can see that:

First - The average income of those who were denied is $30,700 with a standard deviation (SD) of $16,200 and those who were denied is $34,500 with a SD of $17,100. The p-value is <0.001, indicating a statistically significant difference in income between the two groups.

Further - The mean number of major derogatory messages in the group with rejection is 1.59 (SD = 2.41), compared to 0.13 (SD = 0.42) in the group with agreement. Again, the p-value is <0.001, indicating a significant difference in the number of messages between groups.

Also - The mean age is almost the same in the two groups: 33.20 years (SD = 9.92) in the refusal group and 33.22 years (SD = 10.21) in the consent group. The p-value is >0.9, indicating that there is no significant difference in age between the groups.

One last thing we can tell from the table - The mean ratio of monthly credit card expenditure to annual income (proportion) is 0.00 (SD = 0.00) for the refused group and 0.09 (SD = 0.10) for the accepted group. The p-value is <0.001 as in the first two cases, indicating that there is a significant difference in the spending ratio between the two groups.

Table of Monthly Credit Card Expenditure to Yearly Income

# Here we calculate the ratio of monthly credit card expenditure to yearly income
CreditCard$ratio <- CreditCard$expenditure / (CreditCard$income * 12)

# We are creating a boxplot using lattice
bwplot(ratio ~ card, data = CreditCard,
       main = "Ratio of Monthly Credit Card Expenditure to Yearly Income by Credit Risk",
       xlab = "Credit Risk",
       ylab = "Ratio",
       fill = "blue")

Final Result and Conclusion

As we can see the ratio of monthly credit card spending to annual income is an important indicator of a person’s financial management and credit risk. If you observe that one place has a ratio of about 60, another place has a ratio of about 40, and another place has a ratio of about 20-30, it indicates that applicants have different levels of spending relative to income.

Let’s label each of the points of interest:

Points which are near 60: these are outliers indicating people who spend a very large portion of their income on credit card spending each month. This could mean either that these people have high spending habits or that their income is relatively low compared to their spending. This high ratio can be a red flag for lenders, as it indicates an increased risk of default due to potential financial overextension.

Somewhat near 40: These ratios are also above average and may indicate people who have monthly credit card expenses that far exceed their income. While a ratio of 40 is not as extreme as 60, it can still be worrisome because it may indicate less opportunity for financial mistakes or unexpected expenses.

Most are around 20-30: This is likely the bulk of the data and represents a more moderate and normal expense-to-income ratio. Applicants in this range are likely to manage credit card spending more conservatively relative to their income. This suggests a balanced approach to credit utilization and lower credit risk for lenders.

When comparing approved and unapproved credit cards, significant differences in these ratios can be revealing. If approved applicants predominantly have ratios in the 20-30 range, it suggests that the credit card issuer favors applicants who demonstrate moderate and responsible credit usage. Conversely, if unapproved applicants tend to have higher ratios, it indicates that the issuer may perceive them as higher risk.

In summary, this ratio helps lenders assess the creditworthiness of applicants. Lower ratios suggest better financial health and management, while higher ratios may indicate potential financial stress or riskier credit behavior. It’s a crucial metric for credit card issuers to decide whom to extend credit to and under what terms. The presence of outliers, especially those with very high ratios, underscores the importance of a comprehensive review beyond simple numerical thresholds to understand the full context of an applicant’s financial situation.