30. | 1 | |-------| 31. | 1 | 32. | 1 | 33. | 1 | 34. | 1 | 35. | 2 | |-------| 36. | 1 | 37. | 1 | 38. | 1 | 39. | 1 | 40. | 1 | |-------| 41. | 2 | 42. | 1 | 43. | 1 | 44. | 1 | 45. | 1 | |-------| 46. | 1 | 47. | 1 | 48. | 1 | 49. | 1 | 50. | 1 | |-------| 51. | 1 | 52. | 1 | 53. | 2 | 54. | 1 | 55. | 2 | |-------| 56. | 1 | 57. | 1 | 58. | 1 | 59. | 2 | 60. | 1 | |-------| 61. | 1 | 62. | 1 | 63. | 1 | 64. | 3 | 65. | 1 | |-------|
66. | 1 | 67. | 1 | 68. | 1 | 69. | 1 | 70. | 1 | |-------| 71. | 1 | 72. | 1 | 73. | 1 | 74. | 2 | +-------+ .
聚类分析到此为止,接下来继续讲判定分析 线性+非线性+其他
先看线性判定分析discrimlda(线性的)
. discrimlda price mpg weight length,group(foreign)
Linear discriminant analysis
Resubstitution classification summary
+---------+ | Key | |---------| | Number | | Percent | +---------+
| Classified True foreign | Domestic Foreign | Total -------------+--------------------+---------
Domestic | 43 9 | 52
| 82.69 domestic判别正确率 17.31 | | | Foreign | 0 22 | 22
| 0.00 100.00 foreign判别正确率 | -------------+--------------------+---------
Total | 43 31 | 74 | 58.11 41.89 | 100.00 | | Priors | 0.5000 0.5000 |
.根据分析结果进行下一步检验estat . estatclasstable
100.00 100.00
Resubstitution classification table
+---------+ | Key | |---------| | Number | | Percent | +---------+
| Classified True foreign | Domestic Foreign | Total -------------+--------------------+---------
Domestic | 43 9 | 52 | 82.69 17.31 | 100.00 | | Foreign | 0 22 | 22 | 0.00 100.00 | 100.00 -------------+--------------------+---------
Total | 43 31 | 74 | 58.11 41.89 | 100.00 | | Priors | 0.5000 0.5000 |
. eatatcorr
unrecognized command: eatat r(199);
. estatcorr
Pooled within-group correlation matrix
| price mpg weight length -------------+---------------------------------------- price | 1.00000 mpg | -0.53117 1.00000 weight | 0.70551 -0.77521 1.00000 length | 0.56014 -0.75664 0.91898 1.00000
. estat covariance
Pooled within-group covariance matrix
| price mpg weight length -------------+--------------------------------------------
price | 8799417 mpg | -8438.941 28.6848 weight | 1318950 -2616.617 397186.1 length | 30603.94 -74.63974 10667.35 339.2432
. estaterrorrate错判率
Error rate estimated by error count
| foreign
| Domestic Foreign | Total
-------------+----------------------+----------
Error rate | .1730769 0 | .0865385 -------------+----------------------+----------
Priors | .5 .5 | .
. estatgrsum四个变量的分组描述性统计差异情况
Estimation sample discrimlda Summarized by foreign
| foreign
Mean | Domestic Foreign | Total -------------+----------------------+---------- price | 6072.423 6384.682 | 6165.257 mpg | 19.82692 24.77273 | 21.2973 weight | 3317.115 2315.909 | 3019.459 length | 196.1346 168.5455 | 187.9324 -------------+----------------------+----------
N | 52 22 | 74
每个变量进行方差分析. . estatanova
Univariate ANOVA summaries
| Adj.
Variable | Model MS Resid MS Total MS R-sq R-sq Pr> F
-------------+-------------------------------------------------------------
price | 1507382.7 6.336e+08 6.249e+08 .0024 -.0115 .1713 0.6802 mpg | 378.15352 2065.3059 2042.1943 .1548 .143 13.18 0.0005
F weight | 15496779 28597399 28417939 .3514 .3424 39.02 0.0000 length | 11767.15 24425.512 24252.11 .3251 .3158 34.69 0.0000 ---------------------------------------------------------------------------
Number of obs = 74 Model df = 1 Residual df = 72 生成的判别函数?——典型判别函数法canontest . estatcanontest
Canonical linear discriminant analysis
| | Like- | Canon. Eigen- Variance | lihood
Fcn | Corr.value Prop. Cumul. | Ratio F df1 df2 Prob>F ----+---------------------------------+------------------------------------
1 | 0.7494 1.28083 1.0000 1.0000 | 0.4384 22.094 4 0.0000 e
---------------------------------------------------------------------------
Ho: this and smaller canon. corr. are zero; e = exact F 调用多元函数形式 . estat loadings
Standardized canonical discriminant function coefficients
| function1 -------------+----------- price | -1.084153 mpg | .3115969 weight | 2.04874 length | -.4264069
显示分类函数 statclassfunction
Classification functions
| foreign | Domestic Foreign
-------------+---------------------- price | .0013868 .0022795 mpg | 4.577349 4.435253 weight | -.0341788 -.0421185 length | 2.534884 2.591428
_cons | -241.4898 -231.8288 -------------+----------------------
Priors | .5 .5
69
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库stata课堂命令讲解(3)在线全文阅读。
相关推荐: