当前位置:网站首页>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
边栏推荐
- 北京密云区高新技术企业培育支持标准,补贴10万
- SSH远程登陆配置sshd_config文件详解
- Introduction to China patent award policy support, with a subsidy of 1million yuan
- Web3生态去中心化金融平台——Sealem Finance
- Beijing Pinggu District high tech enterprise cultivation support standard, with a subsidy of 100000 yuan
- async await
- Non presented paper (no show) policy
- 深圳市南山区专精特新企业申报流程,补贴10-50万
- What is the C-end and what is the b-end? Let me tell you
- ava.lang.NoClassDefFoundError: org/apache/velocity/context/Context解决办法
猜你喜欢

Sealem Finance打造Web3去中心化金融平台基础设施

CentOS actual deployment redis

IRS application release 16: H5 application design guide

Function of barcode fixed assets management system, barcode management of fixed assets

nodejs中使用mySql数据库
![[paper reading] fixmatch: simplifying semi supervised learning with consistency and confidence](/img/86/72726f933deef6944b62149759b7d5.png)
[paper reading] fixmatch: simplifying semi supervised learning with consistency and confidence

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

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

Cosine similarity calculation summary

对象存储 S3 在分布式文件系统中的应用
随机推荐
数字ic设计自学ing
限流与下载接口请求数控制
87. (leaflet house) leaflet military plotting - straight arrow modification
[paper reading] tganet: text guided attention for improved polyp segmentation
One way linked list to realize student information management
table_ exists_ Action=append and table_ exists_ action=truncate
[paper reading] fixmatch: simplifying semi supervised learning with consistency and confidence
Bad RequestThis combination of host and port requires TLS.
Simple select sort and heap sort
How to use user-defined annotation for parameter verification
Understanding of multithreading
Yunna Qingyuan fixed assets management and barcode inventory system
2022北京怀柔区新技术新产品(服务)认定要求
Merge sort and cardinality sort
Basic introduction of graph and depth first traversal and breadth first traversal
库存管理与策略模式
部分 力扣 LeetCode 中的SQL刷题整理
Centos7 actual deployment mysql8 (binary mode)
Bubble sort and quick sort
ava. Lang.noclassdeffounderror: org/apache/velocity/context/context solution