2024-10-16

Course Project

This is markdown is part of the assignment for the course Developing Data Products integrated in the Coursera Data Science Specialization.

Instructions:

  1. Write a shiny application with associated supporting documentation. The documentation should be thought of as whatever a user will need to get started using your application.
  2. Deploy the application on Rstudio’s shiny server
  3. Share the application link by pasting it into the provided text box
  4. Share your server.R and ui.R code on github

How to use the application

Using the data on credit ratings provided by ISLR package, I fit a linear model to predict an individual rating. Gender, ethnicity, income, account balance, and education are used as input variables.

The application is running on (https://psylva79.shinyapps.io/credit/). The user may introduce his/her data and find an estimate of the corresponding credit score.

Credit Dataset

The data used in the app comes from the Credit dataset. Below are some summary statistics:

##        ID            Income           Limit           Rating     
##  Min.   :  1.0   Min.   : 10.35   Min.   :  855   Min.   : 93.0  
##  1st Qu.:100.8   1st Qu.: 21.01   1st Qu.: 3088   1st Qu.:247.2  
##  Median :200.5   Median : 33.12   Median : 4622   Median :344.0  
##  Mean   :200.5   Mean   : 45.22   Mean   : 4736   Mean   :354.9  
##  3rd Qu.:300.2   3rd Qu.: 57.47   3rd Qu.: 5873   3rd Qu.:437.2  
##  Max.   :400.0   Max.   :186.63   Max.   :13913   Max.   :982.0  
##      Cards            Age          Education        Gender    Student  
##  Min.   :1.000   Min.   :23.00   Min.   : 5.00    Male :193   No :360  
##  1st Qu.:2.000   1st Qu.:41.75   1st Qu.:11.00   Female:207   Yes: 40  
##  Median :3.000   Median :56.00   Median :14.00                         
##  Mean   :2.958   Mean   :55.67   Mean   :13.45                         
##  3rd Qu.:4.000   3rd Qu.:70.00   3rd Qu.:16.00                         
##  Max.   :9.000   Max.   :98.00   Max.   :20.00                         
##  Married              Ethnicity      Balance       
##  No :155   African American: 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

Predictive model

## # A tibble: 10 × 5
##    term               estimate std.error statistic   p.value
##    <chr>                 <dbl>     <dbl>     <dbl>     <dbl>
##  1 (Intercept)        141.       7.65       18.4   6.07e- 55
##  2 Income               2.06     0.0411     50.2   3.00e-172
##  3 Age                  0.122    0.0742      1.65  9.96e-  2
##  4 Education            0.0882   0.401       0.220 8.26e-  1
##  5 GenderFemale         2.97     2.50        1.19  2.35e-  1
##  6 StudentYes         -97.9      4.37      -22.4   4.75e- 72
##  7 MarriedYes           3.69     2.60        1.42  1.57e-  1
##  8 EthnicityAsian      -5.74     3.55       -1.61  1.07e-  1
##  9 EthnicityCaucasian  -2.50     3.08       -0.812 4.17e-  1
## 10 Balance              0.234    0.00321    72.9   2.38e-229