ui.korea.ac.kr

41
ui.korea.ac.kr Chapter 8. Clustering Analysis 2008-04-05 Dept. of Industrial Systems & Information Engineering

description

Chapter 8. Clustering Analysis. 2008-04-05. Dept. of Industrial Systems & Information Engineering. ui.korea.ac.kr.  변수 (Variable)  독립변수 (Independent Variable)  통제변수 (Control variable)  종속변수 (Dependent Variable). Chapter - 8 -. Clustering Analysis. 8.1 Statistical Method. - PowerPoint PPT Presentation

Transcript of ui.korea.ac.kr

ui.korea.ac.kr

Chapter 8. Clustering Analysis

2008-04-05

Dept. of Industrial Systems & Information Engineering

ui.korea.ac.kr

Clustering AnalysisChapter

- 8 -

변수 (Variable)

독립변수 (Independent Variable)

통제변수 (Control variable)

종속변수 (Dependent Variable)

8.1 Statistical Method 8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Considerations8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

ui.korea.ac.kr

Clustering AnalysisChapter

- 8 -

척도 (Scale) • 자로 재는 길이의 표준 • 평가하거나 측정할 때 의거할 기준

불연속적 , 이산적 (Discrete) 측정 수준 • 명목척도 (Nominal scale) • 서열척도 (Ordinal scale) 연속적 (Continuous) 측정 수준 • 등간척도 (Interval scale) • 비율척도 (Ratio scale) 구분 이유 ?

척도의 종류에 따른 분류 • 모수 (Metric, Measurable, Quantitative) • 비모수 (Non-metric, Categorical, Classified)

8.1 Statistical Method 8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Considerations8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Clustering Analysis

척도의 특징과 척도간의 관계 • 서열척도로부터 얻어진 자료로는 극히 제한된 분석방법을 적용할 수밖에 없으므로 되도록 등간척도 이상의 자료를 얻고자 노력함 • 척도에 따라 통계분석기법은 크게 모수통계와 비모수통계로 나누어짐 - 모수통계 : 등간척도나 비율척도로 측정된 경우에 적용할 수 있는 기법 - 비모수통계 : 기법은 변수가 명목척도나 서열척도로 측정된 경우에 적용할 수 있는 기법

척도비교방법

( 숫자부여방법 ) 평균의 측정 적용가능분석방법 예

명목척도 확인 , 분류 최빈치 빈도분석 , 비모수통계 , 교차분석

성별 분류 , 상품유형별 분류 , 시장세분구역분류

서열척도 순위비교 중앙값 서열상관관계 , 비모수통계

상표선호순위 , 상품품질순위도 , 사회계층 , 시장지위

등간척도 간격비교 산술평균 모수통계 태도 , 의견 , 온도 , 광고인지도 , 상표선호도 , 주가지수

비율척도 절대적 크기 비교 기하평균 , 조화평균 모수통계 매출액 , 구매확률 , 무게 , 소득 ,

나이 , 시장점유율

8.1 Statistical Method

독립변수 종속변수 분석법

명목척도 ( 범주형 ) 범주별 빈도수 X2 분석

명목척도 등간 , 비율척도 분산분석

등간 , 비율척도 명목척도 판별분석 , 로짓분석

등간 , 비율척도 등간 , 비율척도 회귀분석

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Considerations8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Clustering Analysis

통계기법 분류의 기준 • 변수의 수 • 척도 • 분석 목적

변수의 수 따른 분류 • 단일변량통계 • 다변량통계

척도에 따른 분류 • 모수통계 • 미모수통계

분석의 성격에 따른 분류 • 종속관계에 관한 분석기법 : 종속변수로 독립변수로 나누어 독립변수의 변화가 종속변수의 변화에 어떻게 영향을 미치는가를 분석 하는 기법 ( 분산분석 , 회귀분석 , 판별분석 등 ) • 상호의존관계에 관한 분석기법 : 변수전체를 이용해서 변수들의 상호관계를 파악하거나 변수들을 이용해서 대상집단들을 동질성을 가진 집단으로 분류하려는 목적

분석의 목적에 따른 분류 • 기술통계 • 추리통계

8.1 Statistical Method 8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Considerations8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Clustering Analysis

통계기법 종류

8.1 Statistical Method

통계분석

단일변량 통계분석

다변량 통계분석

종속관계에 대한 분석

상호의존관계에 대한분석

카이자승

분산분석

판별분석

로짓분석

회귀분석

요인분석

군집분석

비계량

비계량

계량

계량

비계량

계량

비계량

계량

변수의수 변수와의 관계 단일변량 통계분석 독립변수 종속변수

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Considerations8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

MDS

ui.korea.ac.kr

Clustering Analysis

8.2 Basic Concepts

분류할 집단에 특정한 대상물을 배정하여 동일 집단의 대상물 ( 응답자 ) 이 유사성을 갖게 함으로써 집

단간의 차이를 명확하게 하는데 이용

대상자나 대상물을 유의미한 2 차 집단으로 분류하기 위한 분석 기법

주어진 관찰치 주에서 유사한 것들을 몇몇의 집단으로 그룹화하여 , 각 집단의 성격을 파악함으로써

데이터 전체의 구조에 대한 이해를 돕고자 하는 분석방법

군집 간의 이질성을 극대화하면서 군집 내에서의 대상물들의 동질성을 극대화하는 데 목적

The basic intuition behind C.A

Within Cluster Variance Minimize Between Cluster Variance

x1

x2

* Main goal: maximize differences between clusters relative to variation within clusters

Within-cluster variation

Between-cluster variation

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Considerations8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

8.3 CA/FA/MDS/DA

CA Vs MDS CA Vs FA CA Vs DA

차이점

군집분석 2 차원 공간

MDS 다차원 공간

군집분석 Row Reduction:

응답자 수를 줄임 2 차원 공간

요인분석 Column Reduction:

요인의 수를 줄임 다차원 공간 (Vector Model)

공통점

Space-Distance Model

Data-Reduction

Independent Model

Data Reduction Independent Model Metric

Clustering Analysis

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Considerations8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

8.4 Clustering Analysis

Cluster Analysis • 관찰이나 실험 등을 통해 얻은 객체들을 분류 - P 개의 변수로 구성된 N 개의 객체들은 P 차원공간에 흩어진 N 개의 점 - 비상사성 (Similarity/Dissimilarity ) 이 존재 • 군집분석은 군집의 개수 , 내용 , 구조 등이 완전히 모르는 상태에서 특성파악

• 군집의 유형 - 상호 배반적 (Disjoint) 군집 – 여러 군집 중 하나에만 속함 - 계보적 (Hierarchical) 군집 – 한 군집이 다른 군집에 포함되나 군집 간의 중복은 허용하지 않음 - 중복 (Overlapping) 군집 – 두개 이상의 군집이 한 객체에 동시에 소속 - 퍼지 (Fuzzy) 군집 – 확률이나 자격으로 지표규정 ( 상호배반 , 계보적 , 중복 어느 형태가 가능함 )

Clustering Analysis

Possible bases for segmentation - Dimensions that are outputs of factor analysis. - Exploratory research. - Price sensitivities - Heavy-light users - Demographic variables - Psychographic variables

VariablesX1 X2 X3 X4

Ob

ject

sO

1 O

2 O

3 O

4 O

5

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Considerations8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

8.4 Clustering Analysis

목적 : 전체 데이터를 군집을 통해 잘 구분하는 것

군집분석 원칙 • 동일한 군집의 개체 – 유사한 성격 갖도록 • 서로 다른 군집에 속한 개체사이 – 다른 성격 갖도록 군집 형성

군집분석을 위한 가정 • 표본의 통계량으로부터 모집단의 모수를 추정하는 것이 아니며 , 주어진 자료의 구조를 파악하여 기술하므로 기술통계기법임 • 경우에 따라 다중공선성 (Multicollinearity) 이 결과에 크게 영향을 미칠 수 있음

Clustering Analysis

수입 , 상표 충성도를 기준으로 고객 세분화

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Considerations8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Cluster Method

• 고려되는 변수가 세 개 이하의 경우 산점도 등을 활용 (P =< 3): Visual Examination

• 일반적으로 많이 이용되는 군집 방법 ( 변수의 수가 늘어남 주관적 판단의 상이성 문제 )

- 계보적 군집방법 (HCA): 밀접 한 객체를 단계적으로 군집형성 - 최적분리 군집방법 (K-MCA)

• 유사성 (Similarity) 과 거리 (Distance) 의 척도 - 유사성의 척도 : 두 객체의 유사성은 일반적으로 두 객체에 대한 변수들 사이의 상관계수를 많이 사용함 - 거리의 척도 : 두 객체의 비유사성 (Dissimilarity) 의 척도

Determine Similarity Measures

• Correlational Measures

• Distance Measures (Euclidian, City-Block)

• Impact of Unstandardized Data

8.4 Clustering Analysis

Clustering Analysis

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Considerations8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

8.5 Analysis Process

군집분석의 절차

1. 변수의 선정 : 어떠한 특성에 대한 측정치의 차이를 비교할 것인가 ?

- 회귀변수나 중요변수 선정 ( 그렇지 않으면 오류 발생 )

- 변수제거의 기준과 통계적 유의성 검정 곤란2. 거리척도 선정 : 어떻게 유사성의 차이를 측정할 것인가 ?( 유사성 측정방법 )

객체의 비유사성 (Similarity / Dissimilarity) 의 척도 거리 - Euclidean Distance

- Square Euclidean Distance

- Mahalanobis Distance:

- Minkowski Distance:

[ 일반적으로 두 개체에 대한 변수들 사이의 상관계수를 많이 사용 ]

Clustering Analysis

예 ) CASS 맥주의 신선도 5, 부드러움 정도를 6 으로 , HITE 맥주의 신선도를 5, 부드러움 7 로 평가 거리는 =1

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Considerations8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

8.5 Analysis Process

군집분석의 절차

3. 군집분석 진행 방법 결정 : Two Types of Algorithms

• Hierarchical Algorithms

Agglomerative (build-up) methods

- Results from earlier stage are always nested within the results at later stages

Divisive methods

- Start with one big cluster and break it apart

Dendrograms or Tree Graphs

- Read left to right…or vice-versa

• Nonhierarchical Algorithms

= K- 평균 군집방법 (K-means clustering method)

4. 분석 결과의 타당성 검토

5. 결과 해석 군집들간의 특성차이를 가장 유의하게 보여주는 군집의 수를 택하고 각 군집별로 적절한 네이밍 부여 및 결과해석

Clustering Analysis

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Considerations8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

8.6 Cluster Decision Framework

Clustering Analysis

Research Problem

Research Design

Similarity Measure

Pattern or Proximity?

Correlation Distance

Assumptions

Associations

Non MetricMetric

Algorithm?

Hierarchical Non Hierarchical Combination

How many Clusters formed?

Cluster Respecification?

Yes

No

Validate and Profile

Interpret Clusters

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Considerations8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

8.7 Consideration

군집의 개수와 분석방법 선택 • 군집수 결정 - 계보적 군집방법 이용 - 계보적 군집방법은 자료의 계보적 구조가 주요관심 - Tree 구조를 이용하여 병합되는 과정에서 거리의 상대적인 변화로 군집 수 판단 - 그러나 만족할만한 타당성 미흡

• 분석방법 선택 - 해석상의 어려움 봉착 - 고려사항 : 1. 수학상 , 계산상의 문제점 . 2. 기본적 가정과 그들의 의미 . 3. 변수의 특성 - 2 개의 변수 : 산포도 일차적 군집탐색 ( 주관성이 높지만 수리적인 문제해결 )

- 계보적 군집방법 : 자료전체가 어떤 계보를 지니고 있는 때 사용 ( 예 , 생물표본 : 종 - 속 - 과 )

- 최적분리방법 : 비교적 큰 자료를 처리 , 그러나 특이값에 영향을 받음 ( 사전에 세밀한 검토 )

Clustering Analysis

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

8.8 Validity

군집분석의 타당성 검토 ( 매우 중요함 ) • 타당성과 신뢰성 없는 군집분석은 수용 불가능 - 신뢰성과 타당성 점검 어려움

• 군집분석에 사용될 변수들의 관측척도가 서로 다를 경우 분석 전에 표준화 객체들의 비 선형형태의 분포 ( 집단 사이의 분리가 없음 ) - 현실적으로 군집분석 어려움

• 해결방안 1. 이상치에 민감한 결과 - 군집분석 수행 전에 이상치 존재여부 파악 필요 2. 군집의 안전성 검토 - 주어진 자료를 임으로 2 부분으로 분리각 부분을 독립적으로 군집 시켜봄 - 군집분석 알고리즘에 의한 얻어진 군집 안전성 검토몇 개의 변수제거 후 군집에 미치는 영향 고찰 3. 동일한 자료를 여러 가지 군집방법을 적용하여 유사성 검토

Clustering Analysis

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

8.9 Hierarchical Clustering Method

Hierarchical Clustering Method; HCA

병합적 방법 (Agglomerative Hierarchical Method; AHM): Polythetic Method

가까운 대상 끼리 순차적으로 객체들을 묶어나가는 방법 ( 과정에서 자연스럽게 모든 변수를 고려하는 방법 )

분할적 (Divisive): Monothetic Method

전체 대상을 하나의 군집으로 출발하여 객체를 분할해 나가는 방법

거리계산 방법 최단 연결법 (Single Linkage Method)

최장 연결법 (Complete Linkage Method)

평균 연결법 (Average Linkage Method)

중심 연결법 (Centroid Linkage Method)

중위수 연결법 (Median Linkage Method)

Ward 의 방법

Clustering Analysis

Ob

ject

s

N

AHM

Divisive

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Methods of Clustering

Clustering Analysis

Minimum Distance (single linkage)

Maximum Distance (Complete linkage)

Average Distance (Average linkage) - the most common

8.9 Hierarchical Clustering Method8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Other Agglometric Methods of Clustering

Clustering Analysis

Ward’s method

c.gc.g

Centroid method

8.9 Hierarchical Clustering Method8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

1. 가장 가까운 두 군집 병합 : d13=1.0 최소값 나머지 객체들과의 거리 계산

2. d24=3.0 최소값나머지 객체들과의 거리 계산

3. 군집 (2, 4) 와 5 를 묶어 군집 (2, 4, 5) 를 이룸 최종적으로 한 군집을 이룸

Example: Single Linkage Method

Clustering Analysis

8.9 Hierarchical Clustering Method8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Example: Single Linkage Method

Dendrogram

Clustering Analysis

8.9 Hierarchical Clustering Method8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Centroid Linkage Method (N=5, Variable=2)

Variable

Su

bje

ct

Variable

Su

bje

ct

1. D= 유클리드 거리의 제곱

2. d12=1.0 최소이므로 개체 1 과 2 를 묶어 군집 (1,2) 를 만듬 군집 (1, 2) 의 중심 (Centroid) 는 각 변수에 대한 이들의 평균값

3. 반복수행

Clustering Analysis

8.9 Hierarchical Clustering Method8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Dendrogram

Centroid Linkage Method (N=5, Variable=2)

Clustering Analysis

8.9 Hierarchical Clustering Method8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Single Linkage Method: 수리적 계산이 빠름 ( 컴퓨터 처리시간 빠름 ), 고리현상으로 부적절한 현상 SAS Code: Proc Cluster Method=Single

Complete Linkage Method: 고립된 군집을 찾는데 유리 , 군집의 응집성에 중점 SAS Code: Proc Cluster Method=Complete

Average Linkage Method

SAS Code: Proc Cluster Method=Average Centroid Linkage Method: 특이 값에 영향을 받지 않음 SAS Code: Proc Cluster Method=Centroid

Median Linkage Method

SAS Code: Proc Cluster Method=Median

Word Method

SAS Code: Proc Cluster Method=Word

Clustering Analysis

8.9 Hierarchical Clustering Method8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

K- 군집분석 = 순차적 군집화 방법 (Sequential Threshold Method)

비계보적 군집분석에서 많이 사용됨 객체를 그룹화하여 K 개 군집으로 만드는 방법 K 는 분석 전에 설정하거나 분석과정에서 결정

다시 할당되는 객체가 없을 때 까지 반복 수행

K 개의 군집으로 나눔

개별군집 평균 / 중심 계산

각 객체와 군집 중심 거리계산

군집할당

Clustering Analysis

8.10 K-Means Clustering Method8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

8.11 SAS & SPSS Program

Hierarchical Clustering Method – SAS

고려백화점은 쇼핑고객에 대한 성향에 근거하여 고객들을 군집하려 하고 있다 . 과거의 연구결과를 근거로 하여 6 개의 변수를 측정하기로 하였다 (Subject 10).

(X1) 쇼핑은 흥미 없음 (X2) 쇼핑은 당신의 소득에 영향을 끼침 (X3) 쇼핑하면서 외식을 즐김 (X4) 쇼핑시 최고 제품을 구입하기위한 노력 (X5) 쇼핑에 괸심이 없음 (X6) 쇼핑시 가격비교를 통해 많은 돈 절약

7 Likert Scale

적극 동의 안함 (1)-------------- 보통 (4)---------------- 적극 동의 (7)

Clustering Analysis

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Hierarchical Clustering Method

Clustering Analysis

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Hierarchical Clustering Method – SAS Code

DATA QUEST;INPUT X1-X6;CARDS;0.06 40 7 3 2 30.02 30 1 4 5 40.07 20 6 4 1 30.04 60 4 5 3 60.01 30 2 2 6 40.06 40 6 3 3 40.05 30 6 3 3 40.07 30 7 4 1 40.02 40 3 3 6 30.03 50 3 6 4 6;RUN;PROC STANDARD MENA=0 STD=1 OUT=TWO;PROC CLUSTER OUT=TWO METHOD=CENTROID TREE=TWO;VAR X1-X6;RUN;

변수의 평균 0, 분산 1 로 표준화

METHOD=SINGLE ( 최단연결법 )METHOD=COMPLETE( 최장연결법 )METOD=AVERAGE( 평균연결법 )

Clustering Analysis

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

DATA QUEST;INPUT X1-X6;CARDS;6 4 7 3 2 32 3 1 4 5 47 2 6 4 1 34 6 4 5 3 61 3 2 2 6 46 4 6 3 3 45 3 6 3 3 47 3 7 4 1 42 4 3 3 6 33 5 3 6 4 6;RUN;PROC CLUSTER STD METHOD=CENTROID TREE=TWO;VAR X1-X6;RUN;PROC TREE DATA= TWO HORIZONTAL;RUN;

ui.korea.ac.kr

Centroid Hierarchical Cluster Analysis The data have been standardized to mean 0 and variance 1 Root-Mean-Square Total-Sample Standard Deviation = 1 Root-Mean-Square Distance Between Observations = 3.464102

Number Frequency Normalized of of New Centroid Clusters --Clusters Joined-- Cluster Distance Tie

9 OB6 OB7 2 0.281052 8 OB1 CL9 3 0.361764 7 OB3 OB8 2 0.385276 6 OB4 OB10 2 0.428126 5 OB5 OB9 2 0.476894 4 OB2 CL5 3 0.490703 3 CL8 CL7 5 0.497510 2 CL3 CL4 8 1.016941 1 CL2 CL6 10 1.029886

Hierarchical Clustering Method – SAS 결과 표준화결과는 동일함

Clustering Analysis

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Hierarchical Clustering Method – SAS Code

1 6 7 3 8 5 9 2 4 10

1

2

3

4

5

6

7

8

9

10

Clustering Analysis

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Hierarchical Clustering Method – SAS Code

결과 및 해석 – Dendrogram 으로 군집화 설명 6 과 7 이 처음으로 묶이고 다음에 3 과 8 이 묶이며 , 5 와 9 가 묶이며 마지막 단계에서 4 와 10 이 묶임을 알 수 있다 . 3 집단으로 나눈다면 , (6,7,1,3,8), (5, 9, 2), (4, 10) 2 집단으로 나눈다면 , (6,7,1,3,8,5,9,2), (4, 10)

군집 1: 쇼핑 애호가 쇼핑의 흥미 (6.20), 쇼핑하면서 외식을 즐김 (6.40), 쇼핑에 관심 없음 (2.00) 군집 2: 냉담한 소비자 쇼핑에 흥미 , 쇼핑하면서 외식을 즐김 낮음 , 쇼핑에 관심 높음 군집 3: 경제적인 소비자군 쇼핑은 가계에 악영향 , 쇼핑시 최고 상품을 구입하기 위해 노력 , 가격비교에 의하여 많은 돈을 절약

Clustering Analysis

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Hierarchical Clustering Method – SAS Code

결과 및 해석 – 표준화와의 차이 9 OB6 OB7 2 0.281052 8 OB1 CL9 3 0.361764 7 OB3 OB8 2 0.385276 6 OB4 OB10 2 0.428126 5 OB5 OB9 2 0.476894 4 OB2 CL5 3 0.490703 3 CL8 CL7 5 0.497510 2 CL3 CL4 8 1.016941 1 CL2 CL6 10 1.029886

9 OB1 OB6 2 0.101674 8 OB2 OB5 2 0.143790 7 OB7 OB8 2 0.143794 6 CL9 OB9 3 0.292047 5 CL8 CL7 4 0.359483 4 CL6 CL5 7 0.593705 3 OB4 OB10 2 0.595757 2 CL4 OB3 8 0.860206 1 CL2 CL3 10 1.336713

표준화 결과

비표준화 결과

Clustering Analysis

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Hierarchical Clustering Method – SPSS

Clustering Analysis

8.11 SAS & SPSS Program

Hierarchical (versus K-means)

Cluster

- Cases

Display

- Stats / plots

Stats

- agglomeration schedule (distance between clusters)

- proximity matrix

Cluster Membership (none, single, range, from -- to --- clusters

Plot (Dendograms or icicle plots)

Method (****)

- Cluster method

- Measure (interval, counts, binary)

- Transform Values or Measures

Save

8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Hierarchical Clustering Method – SPSS

데이터 입력 분석방법 결정AnalyzeClassify

Clustering Analysis

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Hierarchical Clustering Method – SPSS

변수 지정 & 옵션선택

Statistics…

Plots…

Method

Save

Clustering Analysis

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Statistics…

Plots…

Method

Save

Hierarchical Clustering Method – SPSS

Clustering Analysis

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Hierarchical Clustering Method – SPSS

0

20

40

60

80

100

120

140

0 20 40 60 80 100 120

Fusion Coefficents

Num

ber

of

Clu

ster

s

7 Clusters

Clustering Analysis

[ Dendrogram ]

[ 최적의 군집수 결정 ]

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Non-Hierarchical Clustering Method

Clustering Analysis

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

K-Means Clustering– SAS Code

DATA QUEST;INPUT X1-X6;CARDS;6 4 7 3 2 32 3 1 4 5 47 2 6 4 1 34 6 4 5 3 61 3 2 2 6 46 4 6 3 3 45 3 6 3 3 47 3 7 4 1 42 4 3 3 6 33 5 3 6 4 6;RUN;PROC STANDARD MEAN=0 STD=1 OUT=TWO;PROC FASTCLUS DATA=TWO LIST MAXCLUSTERS=3 MAXITER=10;VAR X1-X6;RUN;

DATA QUEST;INPUT X1-X6;CARDS;0.06 40 7 3 2 30.02 30 1 4 5 40.07 20 6 4 1 30.04 60 4 5 3 60.01 30 2 2 6 40.06 40 6 3 3 40.05 30 6 3 3 40.07 30 7 4 1 40.02 40 3 3 6 30.03 50 3 6 4 6;RUN;PROC STANDARD MEAN=0 STD=1 OUT=TWO;PROC FASTCLUS DATA=TWO LIST MAXCLUSTERS=3 MAXITER=10;VAR X1-X6;RUN;

각 객체에 할당된 군집번호와객체와 마지막 군집 Seed 사이의 거리

Seed 를 계산하기 위한최대 반복 수

최대 군집 지정

척도가 다름

Clustering Analysis

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

K-Means Clustering– Results

FASTCLUS Procedure: Replace=FULL Radius=0 Maxclusters=3 Maxiter=10 Initial Seeds

Cluster X1 X2 X3 X4 X5 X6 ------------------------------------------------------------------------------------------------ 1 -0.13553 1.98361 -0.23009 1.12117 -0.21764 1.72648 2 -1.49079 -0.60371 -1.15045 -1.46615 1.41468 -0.09087 3 1.21974 -1.46615 0.69027 0.25873 -1.30586 -0.99954

Minimum Distance Between Initial Seeds = 4.694619

Relative Change in Cluster Seeds Iteration Criterion 1 2 3 ------------------------------------------------------------- 1 0.6465 0.1580 0.2174 0.3084 2 0.4157 0 0 0

Convergence criterion is satisfied.

Clustering Analysis

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -

ui.korea.ac.kr

Cluster Listing

Obs Cluster Distance from Seed ------------------------------------------ 1 3 0.98828 2 2 1.13323 3 3 1.44798 4 1 0.74154 5 2 1.02068 6 3 1.03211 7 3 0.95115 8 3 0.96568 9 2 0.98229 10 1 0.74154 Criterion Based on Final Seeds = 0.41566

Cluster Listing

Obs Cluster Distance from Seed ---------------------------------------- 1 1 5.6886 2 1 6.7350 3 3 6.7495 4 2 5.0744 5 1 6.5544 6 1 4.7917 7 3 3.6818 8 3 3.4960 9 1 4.4227 10 2 5.0744 Criterion Based on Final Seeds = 2.1834

표준화 결과 비표준화 결과 군집 1 (4, 10)군집 2 (2, 5, 9)군집 3(1, 3, 6, 7, 8)

군집 1 (1, 2, 5, 6, 9)군집 2 (4, 10)군집 3 (3, 7, 8)

K-Means Clustering– 표준화와 비표준화 차이

Clustering Analysis

8.11 SAS & SPSS Program8.1 Statistical Method8.2 Basic Concept 8.3 CA/FA/MDS/DA8.4 Clustering Analysis8.5 Analysis Process8.6 Cluster Decision Framework8.7 Consideration8.8 Validity8.9 Hierarchical Clustering Method8.10 K-Means Clustering Method8.11 SAS & SPSS Program

Chapter- 8 -