返回列表 发帖

SPSS教程:Discriminant分类分析

10.3.1 主要功能

调用此过程可完成判别分析。判别分析目前在医学中得以广泛应用,不仅在于它所建立的判别式可用于临床辅助诊断,而且判别分析可分析出各种因素对特定结果的作用力大小,故亦可用于病因学或疾病预后的推测。

10.3.2 实例操作

[例10.3]为研究舒张期血压和血浆胆固醇对冠心病的作用,某医师测定了50-59岁冠心病人15例和正常人16例的舒张压和胆固醇指标,结果如下,试作判别分析,建立判别函数以便在临床中用于筛选冠心病人。

编号

冠心病人组

编号

正常人组

舒张压kPa

x1

胆固醇mmol/L

x2

舒张压kPa

x1

胆固醇mmol/L

x2

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

9.86

13.33

14.66

9.33

12.80

10.66

10.66

13.33

13.33

13.33

12.00

14.66

13.33

12.80

13.33

5.18

3.73

3.89

7.10

5.49

4.09

4.45

3.63

5.96

5.70

6.19

4.01

4.01

3.63

5.96

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

10.66

12.53

13.33

9.33

10.66

10.66

9.33

10.66

10.66

10.66

10.40

9.33

10.66

10.66

11.20

9.33

2.07

4.45

3.06

3.94

4.45

4.92

3.68

2.77

3.21

5.02

3.94

4.92

2.69

2.43

3.42

3.63

 

10.3.2.1 数据准备

激活数据管理窗口,舒张压、胆固醇的变量名分别以x1、x2表示,将冠心病人资料和正常人资料合并,一同输入。而后,再定义一变量名为result,用于区分冠心病人资料和正常人资料,即冠心病人资料的result值均为1,正常人资料的result值均为2。

10.3.2.2 统计分析

激活Statistics菜单选Classify中的Discriminant...项,弹出Discriminant Analysis对话框(图10.5)。从对话框左侧的变量列表中选result,点击Ø钮使之进入Grouping Variable框,并点击Define Range...钮,在弹出的Discriminant Analysisefine Range对话框中,定义判别原始数据的类别区间,本例为两类,故在Minimum处输入1、在Maximum处输入2,点击Continue钮返回Discriminant Analysis对话框。再从对话框左侧的变量列表中选x1、x2,点击Ø钮使之进入Independents框,作为判别分析的基础数据变量。

图10.5 判别分析对话框

系统提供两类判别方式供选择,一是Enter Independent together,即判别的原始变量全部进入判别方程;另一是Use stepwise method,即采用逐步的方法选择变量进入方程。对于后者,系统有5种逐步选择方式:

Wilks' lambda:按统计量Wilks λ最小值选择变量;

Unexplained variance:按所有组方差之和的最小值选择变量;

Mahalanobis' distance:按相邻两组的最大Mahalanobis距离选择变量;

Smallest F ratio:按组间最小F值比的最大值选择变量;

Rao's V:按统计量Rao V最大值选择变量。

本例由于变量数仅为2个,倾向让两个变量均进入方程,故选用Enter Independent together判别方式。 点击Statistics...钮,弹出Discriminant Analysis: Statistics对话框,在Descriptive栏中选Means项,要求对各组的各变量作均数与标准差的描述;在Function Coefficients栏中选Unstandardized项,要求显示判别方程的非标准化系数。之后,点击Continue钮返回Discriminant Analysis对话框。 点击Classify...钮,弹出Discriminant Analysis: Classification对话框,在Plot栏选Combined groups项,要求作合并的判别结果分布图;在Display栏选Results for each case项,要求对原始资料根据建立的判别方程作逐一回代重判别,同时选Summary table项,要求对这种回代判别结果进行总结评价。之后,点击Continue钮返回Discriminant Analysis对话框。

点击Save...钮,弹出Discriminant Analysis: Save New Variables对话框,选Predicted group membership项要求将回代判别的结果存入原始数据库中。点击Continue钮返回Discriminant Analysis对话框,之后再点击OK钮即完成分析。

10.3.2.3 结果解释

在结果输出窗口中将看到如下统计数据:

首先,系统提示将判别回代的结果以变量名DIS_1存于原始数据库中。

接着系统显示数据按变量RESULT分组,共31个样本作为判别基础数据进入分析,其中第一组15例,第二组16例。同时,分组给出各变量的均数(means)与标准差(standard deviations)。

Following variables will be created upon successful completion of the procedure:

Name Label

-------- ----------------------------------------

DIS_1 --- Predicted group for analysis 1

On groups defined by RESULT

31 (Unweighted) cases were processed.

0 of these were excluded from the analysis.

31 (Unweighted) cases will be used in the analysis.

Number of cases by group

Number of cases

RESULT Unweighted Weighted Label

1 15 15.0

2 16 16.0

Total 31 31.0

Group means

RESULT X1 X2

1 12.49400 4.86800

2 10.62875 3.66250

Total 11.53129 4.24581

Group standard deviations

RESULT X1 X2

1 1.64064 1.12948

2 1.09681 .92467

Total 1.65996 1.18231

On groups defined by RESULT

Analysis number 1

Direct method: all variables passing the tolerance test are entered.

Minimum tolerance level.................. .00100

Canonical Discriminant Functions

Maximum number of functions.............. 1

Minimum cumulative percent of variance... 100.00

Maximum significance of Wilks' Lambda.... 1.0000

Prior probability for each group is .50000

下面为典型判别方程的方差分析结果,其特征值(Eigenvalue)即组间平方和与组内平方和之比为1.2392,典型相关系数(Canonical Corr)为0.7439,Wilks λ值为0.446597,经χ2检验,χ2为22.571,P<0.0001。 用户可通过判别方程的标准化系数,确定各变量对结果的作用大小。如本例舒张压(X1)的标准化系数(0.88431)大于胆固醇(X2)的标准化系数(0.82306),因而舒张压对冠心病的影响作用大于胆固醇。考察变量作用大小的另一途径是使用变量与函数间的相关系数,本例显示X1的变量与函数间的相关系数为0.62454,X2为0.54396,同样表明舒张压对冠心病的影响作用大于胆固醇。 根据系统显示的非标准化判别方程系数,得到判别方程为:

D = 0.6379195X1 + 0.8001452X2 - 10.7532968

依此方程,病人组的中心得分点为1.11198,正常人组的中心得分点为-1.04248。本例为二类判别,二类判别以0为分界点,若将某人的舒张压和胆固醇值代入判别方程,求出的判别分>0的为冠心病人,判别分<0的为正常人。

Canonical Discriminant Functions

Pct of Cum Canonical After Wilks'

Fcn Eigenvalue Variance Pct Corr Fcn Lambda Chi-square df Sig

: 0 .446597 22.571 2 .0000

1* 1.2392 100.00 100.00 .7439 :

* Marks the 1 canonical discriminant functions remaining in the analysis.

Standardized canonical discriminant function coefficients

Func 1

X1 .88431

X2 .82306

Structure matrix:

Pooled within-groups correlations between discriminating variables

and canonical discriminant functions

(Variables ordered by size of correlation within function)

Func 1

X1 .62454

X2 .54396

Unstandardized canonical discriminant function coefficients

Func 1

X1 .6379195

X2 .8001452

(Constant) -10.7532968

Canonical discriminant functions evaluated at group means (group centroids)

Group Func 1

1 1.11198 2 -1.04248

下面为原始数据逐一回代的判别结果显示。其中病人组有3人被错判(编号为1、6、7,打**者),正常人组有3人被错判(编号为17、18、25,打**者)。接着用分布图的形式显示判别结果,图中1代表病人,2代表正常人,每四个1或2代表一个人;图中可见,有三个病人跨过0界进入负值区,被错判为正常人,也有三个正常人跨过0界进入正值区,被错判为病人。最后系统对回代判别的情况作评价,即病人组判别正确率为80.0%,正常人组为81.3%,总判别正确率为80.65%。

Case Mis Actual Highest Probability 2nd Highest Discrim

Number Val Sel Group Group P(D/G) P(G/D) Group P(G/D) Scores

1 1 ** 2 .4692 .6817 1 .3183 -.3187

2 1 1 .7060 .8188 2 .1812 .7347

3 1 1 .5490 .9737 2 .0263 1.7112

4 1 1 .8162 .8606 2 .1394 .8795

5 1 1 .4884 .9784 2 .0216 1.8049

6 1 ** 2 .7174 .8236 1 .1764 -.6805

7 1 ** 2 .5157 .7151 1 .2849 -.3924

8 1 1 .6475 .7918 2 .2082 .6547

9 1 1 .1594 .9953 2 .0047 2.5190

10 1 1 .2305 .9926 2 .0074 2.3110

11 1 1 .4577 .9806 2 .0194 1.8546

12 1 1 .4869 .9785 2 .0215 1.8072

13 1 1 .8782 .8798 2 .1202 .9588

14 1 1 .4264 .6473 2 .3527 .3166

15 1 1 .1594 .9953 2 .0047 2.5190

16 2 2 .2097 .9935 1 .0065 -2.2968

17 2 ** 1 .7554 .8389 2 .1611 .8005

18 2 ** 1 .3611 .5874 2 .4126 .1986

19 2 2 .5442 .9741 1 .0259 -1.6489

20 2 2 .5157 .7151 1 .2849 -.3924

21 2 2 .3048 .5275 1 .4725 -.0164

22 2 2 .4154 .9833 1 .0167 -1.8570

23 2 2 .4876 .9785 1 .0215 -1.7367

24 2 2 .7323 .9551 1 .0449 -1.3846

25 2 ** 1 .2945 .5156 2 .4844 .0637

26 2 2 .9393 .8963 1 .1037 -.9664

27 2 2 .8590 .8741 1 .1259 -.8648

28 2 2 .4483 .9812 1 .0188 -1.8007

29 2 2 .3339 .9879 1 .0121 -2.0087

30 2 2 .8647 .8759 1 .1241 -.8721

31 2 2 .3928 .9847 1 .0153 -1.8970

Symbols used in plots

Symbol Group Label

------ ----- --------------------

1 1

2 2

All-groups Stacked Histogram

Classification results -

No. of Predicted Group Membership

Actual Group Cases 1 2

-------------------- ------ -------- --------

Group 1 15 12 3

80.0% 20.0%

Group 2 16 3 13

18.8% 81.3%

Percent of "grouped" cases correctly classified: 80.65%

Classification processing summary

31 (Unweighted) cases were processed.

0 cases were excluded for missing or out-of-range group codes.

0 cases had at least one missing discriminating variable.

31 (Unweighted) cases were used for printed output.

31 cases were written into the working file.

系统将判别回代的结果以dis_1为变量名存入原始数据库中,如下图所示。用户可通过翻动原始数据库详细查阅。

图10.6 原始数据及判别结果

返回列表