This data set is from the U.S. Small Business Administration (SBA) and provides historical data from 1987 through 2014. This large data set contains 27 variables and 899,164 observations. Each observation represents a loan that was guaranteed to some degree by the SBA. Included is a variable [MIS_Status] which indicates if the loan was paid in full or defaulted/charged off.
Variables: LoanNr_ChkDgt - Text Name - Text City - Text State - Text Zip - Text Bank - Text BankState - Text NAICS - Text ApprovalDate - Date/Time ApprovalFY - Text Term - Number NoEmp - Number NewExist - Text CreateJob - Number RetainedJob - Number FranchiseCode - Text UrbanRural - Text RevLineCr - Text LowDoc - Text ChgOffDate - Date/Time DisbursementDate - Date/Time DisbrusementGross - Currency BalanceGross - Currency MIS_Status - Text ChgOffPrinGr - Currency GrAppv - Currency SBA_Appv - Currency
True Population: all loans guaranteed by the U.S. Small Business Administration (SBA) from 1987 through 2014 regardless of if they are in the data set.
Source Population: The BankLoan data set itself containing 899,164 observations.
Target Population: The loans within all states and the regions they were turned into.
Study Population: The 899,150 values within the cleaned BankLoan data set.
Sampling Frame: The sampling frame is the data set “BankLoan,” which contains historical data from the SBA with 27 variables and 899,164 observations.
Sampling Unit: Each individual loan represented in the data set.
Selection of the sampling method: Various sampling methods are employed, including random sampling, systematic sampling, stratified sampling, and cluster sampling.
Determination of Sample Size: Sample size was determined to be 4000 based off the size of the target population.
Specify the sampling plan: The sampling plan includes deleting records with missing values, transforming currency variables into numeric, categorizing states into regions, and defining clusters using ZIP codes.
The data set BankLoan was read in through github by appending the nine data sets into one inside of r, giving one data set with 899,164 observations.
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
##
## Attaching package: 'kableExtra'
## The following object is masked from 'package:dplyr':
##
## group_rows
Data cleaning was done here with all records who’s MIS_Status value was missing being deleted along with all missing State values. Additionally, all currency values were changed into numerical values.
Using the categorical variable “State”, its 51 unique values were changed into 5 categories. The different States were combined into the regions, “SouthWest”, “West”, “NorthEast”, “MidWest”, and “SouthEast”, each signifying the geographical region they represent.
A frequecy table is created with the five regions having a total population of total population of 899,150.
## State n
## 1 Midwest 202581
## 2 Northeast 202423
## 3 SouthWest 90202
## 4 Southeast 140841
## 5 West 263103
Zip code is used here to define the clusters.
A random sample of 4000 is taken from the study population of the cleaned BankLoan data set.
| Size | Var.count |
|---|---|
| Size | 4000 |
| Var.count | 28 |
Next a systematic sample is created using jump size, the extra 14 observations recorded below are likely due to a rounding error, making the actual size slightly more than 4000.
| Size | Var.count |
|---|---|
| 4014 | 28 |
Below starts the beginning of stratified sampling, with the table showing the strata size for each of 5 different regions.
| Midwest | Northeast | Southeast | SouthWest | West |
|---|---|---|---|---|
| 901 | 901 | 627 | 401 | 1170 |
Here there is a for loop that loops through the 5 regions and stratifies them.
Finally, a cluster sample of Zip code is taken with the size and variable count shown below.
| Size | Var.count |
|---|---|
| Size | 397 |
| Var.count | 28 |