当前位置:网站首页>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
边栏推荐
- Hooks' design philosophy
- Solution to prompt "network initialization failed operation failed" in PD virtual machine installation system
- 简述自定义注解
- Direct insert sort and shell sort
- Clean up the broken artifacts data (.lastUpdated files) and reload the project.问题解决办法
- 数字ic设计自学ing
- [paper reading] fixmatch: simplifying semi supervised learning with consistency and confidence
- 百万级访问量—高并发问题的解决历程
- Simple select sort and heap sort
- How to use user-defined annotation for parameter verification
猜你喜欢

如何使用自定义注解进行参数校验

Inventory management and strategy mode
WSL automatically updates the IP hosts file

Centos7 actual deployment mysql8 (binary mode)

记录打包GoogleChrome浏览器插件

The file "setup" does not exist. What should I do?

ZABBIX offline installation

Docking of express bird system

How to use user-defined annotation for parameter verification

Why can't Google search page infinite?
随机推荐
Embedded learning materials and project summary
2022 recognition requirements for new technologies and new products (services) in Huairou District, Beijing
Beijing Fangshan District high tech enterprise cultivation support standard, with a subsidy of 100000 yuan
Introduction to prefix, infix and suffix expressions (code implementation of inverse Polish calculator)
WSL automatically updates the IP hosts file
2022年高考加油 那年我的高考如此兴奋
SAS判别分析(Bayes准则和proc discrim过程)
什么是C端 什么是B端 这里告诉你
限流与下载接口请求数控制
Beijing Yanqing District high tech enterprise cultivation support standard, with a subsidy of 100000 yuan
Introduction to the policy support of Beijing China Patent Award, with a subsidy of 1million yuan
Middleware_ Redis_ 06_ Redis transactions
[paper reading] fixmatch: simplifying semi supervised learning with consistency and confidence
CSRF攻击
深圳市南山区专精特新企业申报条件,补贴10-50万
云呐|PDA无线固定资产盘点管理系统
多兴趣召回模型实践|得物技术
Teach you the front and back separation architecture (V) system authentication implementation
记录打包GoogleChrome浏览器插件
Projet Visualisation et analyse des données sur les épidémies basées sur le Web crawler