Docsity

Cluster Analysis: Identifying Customer Segments based on Credit Data, Assignments of Business Management and Analysis

Toggle sidebar
bg1
Assignment 3 Cluster Analysis
Dominic Valentino
MGS 8040
March 17th 2008
I have detailed each step of my analysis below. In order to skip the detail click here to read the
results.
1. Remove special cases with following code:
Data save.new;
Set save.train;
If cbtype=1 then output;
Run;
Quit;
2. The following variables were initially used in the correlation analysis:
PUBREC, TRADES, TERM, RVTRD, MNGPAY, NTTRIN, VRESMOS, AGEOTRD,
DWNPMT
A new dataset containing only these variables was created for running the correlation using the
following code:
data save.new2 (keep = PUBREC TRADES TERM RVTRD
MNGPAY NTTRIN VRESMOS AGEOTRD DWNPMT);
set save.new;
run;
The following code was run to obtain the correlations.
DWNPMT was too highly correlated with TERM and NTTRIN so it was replaced with TIME29,
with a satisfactory result.
The final set of variables was standardized using PROC STANDARD (with mean = 0 and the
standard deviation = 1). Missing values were replaced with the mean for that variable. Here is the
code:
data save.new4;
set save.new3;
run;
proc standard data = save.new4 out = save.new4 mean = 0 std = 1 replace;
pf3
pf4
pf5

Partial preview of the text

Download Cluster Analysis: Identifying Customer Segments based on Credit Data and more Assignments Business Management and Analysis in PDF only on Docsity!

Assignment 3 Cluster Analysis

Dominic Valentino

MGS 8040

March 17th^2008

I have detailed each step of my analysis below. In order to skip the detail click here to read the

results.

1. Remove special cases with following code:

Data save.new; Set save.train; If cbtype= 1 then output; Run ; Quit ;

2. The following variables were initially used in the correlation analysis:

PUBREC, TRADES, TERM, RVTRD, MNGPAY, NTTRIN, VRESMOS, AGEOTRD,

DWNPMT

A new dataset containing only these variables was created for running the correlation using the

following code:

data save.new2 (keep = PUBREC TRADES TERM RVTRD MNGPAY NTTRIN VRESMOS AGEOTRD DWNPMT); set save.new; run ;

The following code was run to obtain the correlations.

DWNPMT was too highly correlated with TERM and NTTRIN so it was replaced with TIME29,

with a satisfactory result.

The final set of variables was standardized using PROC STANDARD (with mean = 0 and the

standard deviation = 1). Missing values were replaced with the mean for that variable. Here is the

code:

data save.new4; set save.new3; run ; proc standard data = save.new4 out = save.new4 mean = 0 std = 1 replace;

var PUBREC TRADES MNGPAY NTTRIN VRESMOS TERM TIME29;

run; quit;

A new dataset (new5) was created with observations that did not have more than 4 of the 7

variables with values more than 3 standard deviations from the mean. Here is the code used to

complete this:

data save.new5; set save.new4; varCount = 0 ; varSTD = 3 ; If TRADES < varSTD or TRADES > - 1 *varSTD Then varCount = varCount + 1 ; If PUBREC < varSTD or PUBREC > - 1 *varSTD Then varCount = varCount + 1 ; If MNGPAY < varSTD or MNGPAY > - 1 *varSTD Then varCount = varCount + 1 ; If NTTRIN < varSTD or NTTRIN > - 1 *varSTD Then varCount = varCount + 1 ; If VRESMOS < varSTD or VRESMOS > - 1 *varSTD Then varCount = varCount + 1 ; If TERM < varSTD or TERM > - 1 *varSTD Then varCount = varCount + 1 ; If TIME29 < varSTD or TIME29 > - 1 *varSTD Then varCount = varCount + 1 ; If RVOLDT < varSTD or RVOLDT > - 1 *varSTD Then varCount = varCount + 1 ; If varCount > 4 Then OUTPUT; run; quit;

3. Clusters were created for the 7 variables with 2 through 14 clusters using the following code:

ODS HTML BODY = 'C:\Documents and Settings\DV\My Documents\School\SAS Stuff project\output\Clusters.html' STYLE = D3D; data save.new6; SET save.new5; proc fastclus data=save.new6 out=save.New nomiss impute maxclusters= 2 maxiter= 40 replace=full converge= 0.02 ; var AGEOTD TRADES DWNPMT AGEAVG VAGE VJOBMOS VRESMOS RVOLDT; TITLE2 "******** 2 CLUSTERS ********"; run ; proc fastclus data=save.new6 out=save.New nomiss impute maxclusters= 3 maxiter= 40 replace=full converge= 0.02 ; var AGEOTD TRADES DWNPMT AGEAVG VAGE VJOBMOS VRESMOS RVOLDT;

TITLE2 "******** 11 CLUSTERS ********";

run ; proc fastclus data=save.new6 out=save.New nomiss impute maxclusters= 12 maxiter= 40 replace=full converge= 0.02 ; var AGEOTD TRADES DWNPMT AGEAVG VAGE VJOBMOS VRESMOS RVOLDT; TITLE2 "******** 12 CLUSTERS ********"; run ; proc fastclus data=save.new6 out=save.New nomiss impute maxclusters= 13 maxiter= 40 replace=full converge= 0.02 ; var AGEOTD TRADES DWNPMT AGEAVG VAGE VJOBMOS VRESMOS RVOLDT; TITLE2 "******** 13 CLUSTERS ********"; run ; proc fastclus data=save.new6 out=save.New nomiss impute maxclusters= 14 maxiter= 40 replace=full converge= 0.02 ; var AGEOTD TRADES DWNPMT AGEAVG VAGE VJOBMOS VRESMOS RVOLDT; TITLE2 "******** 14 CLUSTERS ********"; run ; ods html close;

Click HERE for the complete SAS output.

Cluster Results and Analysis:

The chart and table below tells us that the increase in the amount of variance being explained by

using more clusters increases strongly and then tapers off near 7-8 clusters. As a result, we will

use 7 clusters for our final result.

Cluster Psuedo-F CCC R^2 (Right scale)

2 3,937 235 0. 3 2,755 175 0. 4 2,481 171 0. 5 2,346 175 0. 6 2,192 170 0. 7 2,139 175 0. 8 1,995 163 0. 9 1,717 121 0. 10 1,785 151 0. 11 1,540 118 0. 12 1,476 119 0. 13 1,585 155 0. 14 1,455 140 0.

Pseudo-F, CCC, and R^2 by Cluster number 100 1, 10, 2 3 4 5 6 7 8 9 10 11 12 13 14

1 Psuedo-F CCC R^2 (Right scale)

Summary of Seven Clusters’ Averages

Cluster PUBREC TRADES MNGPAY NTTRIN VRESMOS TERM TIME (^1) -0.003 -0.066 -0.016 2.386 -0.187 0.416 -0. 2 0.099 1.553 0.004 -0.244 -0.239 0.241 -0. 3 -0.551 -0.781 78.353 -0.417 2.311 0.626 1. 4 -0.201 -0.090 -0.020 -0.196 2.686 0.087 -0. (^5) 3.424 0.370 0.003 -0.153 -0.119 -0.056 -0. (^6) -0.100 -0.587 -0.009 -0.112 -0.147 0.119 2. 7 -0.252 -0.389 -0.018 -0.298 -0.289 -0.187 -0. 7-Cluster Means

Based on the means above, the table below describes the clusters and possible offer terms