# This assignment is suppose to be an R studio sheet which is then knited into an R markdown file and word doc. The instructions are attached in greater detail. It is for a linear Regression & Analysis...

This assignment is suppose to be an R studio sheet which is then knited into an R markdown file and word doc. The instructions are attached in greater detail. It is for a linear Regression & Analysis course that uses R studio

Answered 4 days AfterApr 02, 2024

## Answer To: This assignment is suppose to be an R studio sheet which is then knited into an R markdown file and...

Mukesh answered on Apr 07 2024
Credit Card Company. A Business Analytics Lab Report.
Credit Card Company. A Business Analytics Lab Report.
ABC
2024-04-06
Suppose you work for a credit card company and were assigned an analytics project for which you decided to apply regression analysis methods. Your supervisor asked you to investigate d
ifferences in credit card balance between males and females, differences in average balance between different ethnicities Caucasians, Asians and African Americans (AA) and address differences in credit card balances between married and non-married. In addition, you were also asked to investigate the effect of Income, Age, and Education on credit card balances.The following observations for a number of potential customers were recorded and stored in a data file named “CreditCards”: balance (average credit card debt for a number of individuals), as well as quantitative predictors: age, education (years of education), marital Status (married or not), income (thousands of dollars), limit (credit limit). (Data file, “CreditCards.csv” is posted on Brightspace).
library(tidyverse)
library(dplyr)
library(ggplot2)
library(GGally)
# Step 1: Load data and perform exploratory data analysis
# Assuming 'credit' is your data frame, you can use mutate_at to convert multiple columns to factors
credit <- credit %>%
mutate_at(vars(Gender, Married, Ethnicity), as.factor)
# Structure of data
str(credit)
## tibble [400 × 8] (S3: tbl_df/tbl/data.frame)
## \$ Income : num [1:400] 14.9 106 104.6 148.9 55.9 ...
## \$ Limit : num [1:400] 3606 6645 7075 9504 4897 ...
## \$ Age : num [1:400] 34 82 71 36 68 77 37 87 66 41 ...
## \$ Education: num [1:400] 11 15 11 11 16 10 12 9 13 19 ...
## \$ Gender : Factor w/ 2 levels "Female","Male": 2 1 2 1 2 2 1 2 1 1 ...
## \$ Married : Factor w/ 2 levels "No","Yes": 2 2 1 1 2 1 1 1 1 2 ...
## \$ Ethnicity: Factor w/ 3 levels "AA","Asian","Caucasian": 3 2 2 2 3 3 1 2 3 1 ...
## \$ Balance : num [1:400] 333 903 580 964 331 ...
1. Do an exploratory analysis of your data (know your data, variable types, generate visuals).
# Summary of data set
summary(credit)
## Income Limit Age Education Gender
## Min. : 10.35 Min. : 855 Min. :23.00 Min. : 5.00 Female:207
## 1st Qu.: 21.01 1st Qu.: 3088 1st Qu.:41.75 1st Qu.:11.00 Male :193
## Median : 33.12 Median : 4622 Median :56.00 Median :14.00
## Mean : 45.22 Mean : 4736 Mean :55.67 Mean :13.45
## 3rd Qu.: 57.47 3rd Qu.: 5873 3rd Qu.:70.00 3rd Qu.:16.00
## Max. :186.63 Max. :13913 Max. :98.00 Max. :20.00
## Married Ethnicity Balance
## No :155 AA : 99 Min. : 0.00
## Yes:245 Asian :102 1st Qu.: 68.75
## Caucasian:199 Median : 459.50
## Mean : 520.01
## 3rd Qu.: 863.00
## Max. :1999.00
Create bar chart for Gender
ggplot(credit, aes(x = Gender)) +
geom_bar(fill =...
SOLUTION.PDF