1、制定目标
2、收集数据
3、数据处理和分析
library(scorecard)
data("germancredit")#该数据集在scorecard包中;
dim(germancredit)#查看数据集的维度
## [1] 1000 21
#计算关于数据集的统计量,如均值,方差,中位数等
summary(germancredit)
## status.of.existing.checking.account
## ... < 0 DM :274
## 0 <= ... < 200 DM :269
## ... >= 200 DM / salary assignments for at least 1 year: 63
## no checking account :394
##
##
## duration.in.month
## Min. : 4.0
## 1st Qu.:12.0
## Median :18.0
## Mean :20.9
## 3rd Qu.:24.0
## Max. :72.0
## credit.history
## no credits taken/ all credits paid back duly : 40
## all credits at this bank paid back duly : 49
## existing credits paid back duly till now :530
## delay in paying off in the past : 88
## critical account/ other credits existing (not at this bank):293
##
## purpose credit.amount savings.account.and.bonds
## Length:1000 Min. : 250 ... < 100 DM :603
## Class :character 1st Qu.: 1366 100 <= ... < 500 DM :103
## Mode :character Median : 2320 500 <= ... < 1000 DM : 63
## Mean : 3271 ... >= 1000 DM : 48
## 3rd Qu.: 3972 unknown/ no savings account:183
## Max. :18424
## present.employment.since
## unemp