当前位置:网站首页>SAS discriminant analysis (Bayes criterion and proc discrim process)
SAS discriminant analysis (Bayes criterion and proc discrim process)
2022-06-11 01:26:00 【I have a clear idea】
The following table shows the relevant financial data of the two types of companies , One is a bankrupt company , The data in the table are the four-year financial indicators of these companies in the two years before bankruptcy . One is the four same financial indicators of the non bankrupt company and the bankrupt company in the same period . These four indicators are

The data of each company is shown in the following table ( In the last column of the table “0” Means bankrupt company ,“1” Means a non bankrupt company )
| number | x1 | x2 | x3 | x4 | group |
| 1 | -0.45 | -0.41 | 1.09 | 0.45 | 0 |
| 2 | -0.56 | -0.31 | 1.51 | 0.16 | 0 |
| 3 | 0.06 | 0.02 | 1.01 | 0.4 | 0 |
| 4 | -0.07 | -0.09 | 1.45 | 0.26 | 0 |
| 5 | -0.1 | -0.09 | 1.56 | 0.67 | 0 |
| 6 | -0.14 | -0.07 | 0.71 | 0.28 | 0 |
| 7 | 0.04 | 0.01 | 1.5 | 0.71 | 0 |
| 8 | -0.06 | -0.06 | 1.37 | 0.4 | 0 |
| 9 | 0.07 | -0.01 | 1.37 | 0.34 | 0 |
| 10 | -0.13 | -0.14 | 1.42 | 0.44 | 0 |
| 11 | -0.23 | -0.3 | 0.33 | 0.18 | 0 |
| 12 | 0.07 | 0.02 | 1.31 | 0.25 | 0 |
| 13 | 0.01 | 0 | 2.15 | 0.7 | 0 |
| 14 | -0.28 | -0.23 | 1.19 | 0.66 | 0 |
| 15 | 0.15 | 0.05 | 1.88 | 0.27 | 0 |
| 16 | 0.37 | 0.11 | 1.99 | 0.38 | 0 |
| 17 | -0.08 | -0.08 | 1.51 | 0.42 | 0 |
| 18 | 0.05 | 0.03 | 1.68 | 0.95 | 0 |
| 19 | 0.01 | 0 | 1.26 | 0.6 | 0 |
| 20 | 0.12 | 0.11 | 1.14 | 0.17 | 0 |
| 21 | -0.28 | -0.27 | 1.27 | 0.51 | 0 |
| 1 | 0.51 | 0.1 | 2.49 | 0.54 | 1 |
| 2 | 0.08 | 0.02 | 2.01 | 0.53 | 1 |
| 3 | 0.38 | 0.11 | 3.27 | 0.35 | 1 |
| 4 | 0.19 | 0.05 | 2.25 | 0.33 | 1 |
| 5 | 0.32 | 0.07 | 4.24 | 0.63 | 1 |
| 6 | 0.31 | 0.05 | 4.45 | 0.69 | 1 |
| 7 | 0.12 | 0.05 | 2.52 | 0.69 | 1 |
| 8 | -0.02 | 0.02 | 2.05 | 0.35 | 1 |
| 9 | 0.22 | 0.08 | 2.35 | 0.4 | 1 |
| 10 | 0.17 | 0.07 | 1.8 | 0.52 | 1 |
| 11 | 0.15 | 0.05 | 2.17 | 0.55 | 1 |
| 12 | -0.1 | -0.01 | 2.5 | 0.58 | 1 |
| 13 | 0.14 | -0.03 | 0.46 | 0.26 | 1 |
| 14 | 0.14 | 0.07 | 2.61 | 0.52 | 1 |
| 15 | 0.15 | 0.06 | 2.23 | 0.56 | 1 |
| 16 | 0.16 | 0.05 | 2.31 | 0.2 | 1 |
| 17 | 0.29 | 0.06 | 1.84 | 0.38 | 1 |
| 18 | 0.54 | 0.11 | 2.33 | 0.48 | 1 |
| 19 | -0.33 | -0.09 | 3.01 | 0.47 | 1 |
| 20 | 0.48 | 0.09 | 1.24 | 0.18 | 1 |
| 21 | 0.56 | 0.11 | 4.29 | 0.45 | 1 |
| 22 | 0.2 | 0.08 | 1.99 | 0.3 | 1 |
| 23 | 0.47 | 0.16 | 2.92 | 0.45 | 1 |
| 24 | 0.17 | 0.04 | 2.45 | 0.14 | 1 |
| 25 | 0.58 | 0.04 | 5.06 | 0.13 | 1 |

Experimental code :
proc import out=temp1
datafile="C:\Users\86166\Desktop\IT\SAS experiment \ experiment 9\1.xls"
DBMS=EXCEL2000 replace;
run;
/*1、2、3*/
proc discrim data=temp1 wcov simple pool=no manova method=normal crosslisterr listerr;
class group;
var x1-x2;
priors equal;
run;
/*4*/
proc discrim data=temp1 pool=no manova method=normal crosslisterr listerr;
class group;
var x1-x2;
priors '0'=0.05 '1'=0.95;
run;
/*5*/
proc discrim data=temp1 pool=yes manova method=normal crosslisterr listerr;
class group;
var x1-x2;
priors equal;
run;
/*6*/
proc discrim data=temp1 wcov simple pool=no manova method=normal crosslisterr listerr;
class group;
var x1 x3;
priors equal;
run;
proc discrim data=temp1 pool=no manova method=normal crosslisterr listerr;
class group;
var x1 x3;
priors '0'=0.05 '1'=0.95;
run;
proc discrim data=temp1 wcov simple pool=no manova method=normal crosslisterr listerr;
class group;
var x1 x4;
priors equal;
run;
proc discrim data=temp1 pool=no manova method=normal crosslisterr listerr;
class group;
var x1 x4;
priors '0'=0.05 '1'=0.95;
run;
/*7*/
proc discrim data=temp1 wcov simple pool=no manova method=normal crosslisterr listerr;
class group;
var x1-x4;
priors equal;
run;
proc discrim data=temp1 pool=no manova method=normal crosslisterr listerr;
class group;
var x1-x4;
priors '0'=0.05 '1'=0.95;
run;experimental result :——》 Discriminant analysis code picture results and data sets
Analyze the results of the experiment :





Problems and solutions in the experiment :
problem : How to determine the more reliable results under different prior probabilities ?
solve : At present, the error probability is directly used to compare
Experimental experience ( Conclusion 、 evaluation 、 Thoughts and suggestions )
- simple Obtain simple statistics such as the mean ,wcov Get intra group covariance ,pool=yes/no/test Use the joint covariance matrix respectively , Intra group covariance matrix , Homogeneity test of intra group covariance matrix .manova obtain 4 Statistics ,Wilks'lambda To measure The ratio of the sum of squares within the group to the total sum of squares ,Wilks'lambda Large value , It means that the mean value of each group is basically the same , In discriminant analysis , Only when the group mean values are not equal , Discriminant analysis makes sense .
- crosslisterr listerr Maximum a posteriori probabilities are used respectively , Calculate the probability of misjudgment by cutting ,method=normal Specifies that the population is normally distributed ,priors equal Specifies that the prior probability is equal , The prior probabilities of different classes can also be specified according to the contents of the classification .
- When the population is normally distributed , If covariance matrix between populations is not equal , The intra group covariance matrix ,pool=no,method=normal,priors Can be equal to , It can also be specified by frequency or special value ; If covariance matrix between populations is equal , Then the joint covariance matrix ,pool=yes,method=normal,priors Can be equal to , It can also be specified by frequency or special value . Joint covariance matrix is preferred for small samples , A priori probability generally specifies equality . When the population does not belong to the normal distribution method=npar, The nonparametric method is used for discrimination .
- The mean vectors of the population and each class can be represented by simple obtain
wcov Get the intra group covariance , That is, the sample covariance
pcov Get the combined covariance , The corresponding use conditions of these two covariances are pool relation
pool by yes The combined covariance matrix , It means that the corresponding overall covariance matrix is different
by no The intra group covariance matrix , It means that the corresponding populations obey the normal population with equal covariance matrix
by test The likelihood ratio test for homogeneity of the intra group covariance matrix is modified , and slpool Used to specify the homogeneity inspection level , Default 0.1
method by normal The representation class obeys multivariate normal distribution , by npar That is, the nonparametric method is used to disobey the distribution
crosslisterr Output the back judgment result in the form of cross table , The knife cutting method is used
listerr The back decision error information generated by a posteriori probability , It is required to obtain the discrimination result according to the distance criterion
priors by equal Means that the prior probabilities are equal , by proportional Means that the prior probability is equal to the sample frequency , You can also specify a priori probability of the classification mark , But the sum is 1
Compare the quality of the criterion , Look at the result of misjudgment Total Options , Generally speaking, whoever is smaller is better
边栏推荐
- Projet Visualisation et analyse des données sur les épidémies basées sur le Web crawler
- 2022 recognition requirements for new technologies and new products (services) in Huairou District, Beijing
- 复利的保险理财产品怎么样?可以买吗?
- 中国专利奖申报流程介绍,补贴100万
- Non presented paper (no show) policy
- Current limiting and download interface request number control
- 关于mobx
- Centos7 actual deployment mysql8 (binary mode)
- 項目_基於網絡爬蟲的疫情數據可視化分析
- 2022年高考加油 那年我的高考如此兴奋
猜你喜欢
![[introduction to ROS] - 01 introduction to ROS](/img/6f/67ebb4336b6f7b3a1076b09d871b8e.png)
[introduction to ROS] - 01 introduction to ROS
![[paper reading] tganet: text guided attention for improved polyp segmentation](/img/e4/a80615e78b819a50886410cc69146d.png)
[paper reading] tganet: text guided attention for improved polyp segmentation

Why is the digital transformation of small and medium-sized enterprises so difficult?

Web3 ecological decentralized financial platform sealem Finance

云呐|庆远固定资产管理及条码盘点系统

IRS应用发布之十六:H5 应用设计指南

项目_基于网络爬虫的疫情数据可视化分析

Projet Visualisation et analyse des données sur les épidémies basées sur le Web crawler

Recruitment | Nanjing | triostudio Sanli Agency - Interior Designer / construction drawing deepening Designer / device / Product Designer / Intern, etc

Viewpager and dot of bottom wireless loop
随机推荐
CSRF attack
[introduction to ROS] - 03 single chip microcomputer, PC host and ROS communication mechanism
Introduction to the subsidy fund for leading technological innovation of Beijing enterprises, with a subsidy of 5million yuan
深圳市南山区专精特新企业申报流程,补贴10-50万
条码固定资产管理系统的作用,固定资产条码化管理
SQL question brushing and sorting in leetcode of partial deduction
OTA upgrade
Hash table (hash table \u hashtable)_ Array + linked list_ Code for employee management
多兴趣召回模型实践|得物技术
函数的节流和防抖
北京企业前沿引领技术创新补助资金介绍,补助500万
ava. Lang.noclassdeffounderror: org/apache/velocity/context/context solution
Shenzhen Nanshan District specialized special new enterprise application process, with a subsidy of RMB 100000-500000
Yunna provincial administrative unit fixed assets management system
云呐|PDA无线固定资产盘点管理系统
Simple select sort and heap sort
Beijing Tongzhou District high tech enterprise cultivation support standard, with a subsidy of 100000 yuan
Introduction to support standards for specialized, special and new manufacturing enterprises in Chaoyang District, Beijing, with a subsidy of 1million yuan
項目_基於網絡爬蟲的疫情數據可視化分析
Projet Visualisation et analyse des données sur les épidémies basées sur le Web crawler