原文链接:http://tecdat.cn/?p=6145

 

 

泊松模型

 proc fmm data = tmp1 tech = trureg;  model majordrg = age acadmos minordrg logspend / dist = truncpoisson;   probmodel age acadmos minordrg logspend; /*Fit Statistics -2 Log Likelihood             8201.0AIC  (smaller is better)      8221.0AICC (smaller is better)      8221.0BIC  (smaller is better)      8293.5 Parameter Estimates for 'Truncated Poisson' Model                                  StandardComponent  Effect     Estimate     Error  z Value  Pr > |z|         1  Intercept   -2.0706    0.3081    -6.72    <.0001        1  AGE         0.01796  0.005482     3.28    0.0011        1  ACADMOS    0.000852  0.000700     1.22    0.2240        1  MINORDRG     0.1739   0.03441     5.05    <.0001        1  LOGSPEND     0.1229   0.04219     2.91    0.0036 Parameter Estimates for Mixing Probabilities                           StandardEffect       Estimate       Error    z Value    Pr > |z| Intercept     -4.2309      0.1808     -23.40      <.0001AGE           0.01694    0.003323       5.10      <.0001ACADMOS      0.002240    0.000492       4.55      <.0001MINORDRG       0.7653     0.03842      19.92      <.0001LOGSPEND       0.2301     0.02683       8.58      <.0001*/ *** HURDLE POISSON MODEL WITH NLMIXED PROCEDURE ***;proc nlmixed data = tmp1 tech = trureg maxit = 500;  parms B1_intercept = -4 B1_age = 0 B1_acadmos = 0 B1_minordrg = 0 B1_logspend = 0        B2_intercept = -2 B2_age = 0 B2_acadmos = 0 B2_minordrg = 0 B2_logspend = 0;   eta1 = B1_intercept + B1_age * age + B1_acadmos * acadmos + B1_minordrg * minordrg + B1_logspend * logspend;  exp_eta1 = exp(eta1);  p0 = 1 / (1 + exp_eta1);  eta2 = B2_intercept + B2_age * age + B2_acadmos * acadmos + B2_minordrg * minordrg + B2_logspend * logspend;  exp_eta2 = exp(eta2);  if majordrg = 0 then _prob_ = p0;  else _prob_ = (1 - p0) * exp(-exp_eta2) * (exp_eta2 ** majordrg) / ((1 - exp(-exp_eta2)) * fact(majordrg));  ll = log(_prob_);  model majordrg ~ general(ll);run;/*Fit Statistics -2 Log Likelihood                 8201.0AIC (smaller is better)           8221.0AICC (smaller is better)          8221.0BIC (smaller is better)           8293.5 Parameter Estimates                            StandardParameter      Estimate      Error     DF   t Value   Pr > |t| B1_intercept    -4.2309     0.1808    1E4    -23.40     <.0001B1_age          0.01694   0.003323    1E4      5.10     <.0001B1_acadmos     0.002240   0.000492    1E4      4.55     <.0001B1_minordrg      0.7653    0.03842    1E4     19.92     <.0001B1_logspend      0.2301    0.02683    1E4      8.58     <.0001============B2_intercept    -2.0706     0.3081    1E4     -6.72     <.0001B2_age          0.01796   0.005482    1E4      3.28     0.0011B2_acadmos     0.000852   0.000700    1E4      1.22     0.2240B2_minordrg      0.1739    0.03441    1E4      5.05     <.0001B2_logspend      0.1229    0.04219    1E4      2.91     0.0036*/

零膨胀泊松模型

*** ZERO-INFLATED POISSON MODEL WITH FMM PROCEDURE ***;proc fmm data = tmp1 tech = trureg;  model majordrg = age acadmos minordrg logspend / dist = poisson;   probmodel age acadmos minordrg logspend;run;/*Fit Statistics -2 Log Likelihood             8147.9AIC  (smaller is better)      8167.9AICC (smaller is better)      8167.9BIC  (smaller is better)      8240.5 Parameter Estimates for 'Poisson' Model                                  StandardComponent  Effect     Estimate     Error  z Value  Pr > |z|         1  Intercept   -2.2780    0.3002    -7.59    <.0001        1  AGE         0.01956  0.006019     3.25    0.0012        1  ACADMOS    0.000249  0.000668     0.37    0.7093        1  MINORDRG     0.1176   0.02711     4.34    <.0001        1  LOGSPEND     0.1644   0.03531     4.66    <.0001 Parameter Estimates for Mixing Probabilities                           StandardEffect       Estimate       Error    z Value    Pr > |z| Intercept     -1.9111      0.4170      -4.58      <.0001AGE          -0.00082    0.008406      -0.10      0.9218ACADMOS      0.002934    0.001085       2.70      0.0068MINORDRG       1.4424      0.1361      10.59      <.0001LOGSPEND      0.09562     0.05080       1.88      0.0598*/ *** ZERO-INFLATED POISSON MODEL WITH NLMIXED PROCEDURE ***;proc nlmixed data = tmp1 tech = trureg maxit = 500;  parms B1_intercept = -2 B1_age = 0 B1_acadmos = 0 B1_minordrg = 0 B1_logspend = 0        B2_intercept = -2 B2_age = 0 B2_acadmos = 0 B2_minordrg = 0 B2_logspend = 0;   eta1 = B1_intercept + B1_age * age + B1_acadmos * acadmos + B1_minordrg * minordrg + B1_logspend * logspend;  exp_eta1 = exp(eta1);  p0 = 1 / (1 + exp_eta1);  eta2 = B2_intercept + B2_age * age + B2_acadmos * acadmos + B2_minordrg * minordrg + B2_logspend * logspend;  exp_eta2 = exp(eta2);  if majordrg = 0 then _prob_ = p0 + (1 - p0) * exp(-exp_eta2);  else _prob_ = (1 - p0) * exp(-exp_eta2) * (exp_eta2 ** majordrg) / fact(majordrg);  ll = log(_prob_);  model majordrg ~ general(ll);run;/*Fit Statistics -2 Log Likelihood                 8147.9AIC (smaller is better)           8167.9AICC (smaller is better)          8167.9BIC (smaller is better)           8240.5 Parameter Estimates                            StandardParameter      Estimate      Error     DF   t Value   Pr > |t| B1_intercept    -1.9111     0.4170    1E4     -4.58     <.0001B1_age         -0.00082   0.008406    1E4     -0.10     0.9219B1_acadmos     0.002934   0.001085    1E4      2.70     0.0068B1_minordrg      1.4424     0.1361    1E4     10.59     <.0001B1_logspend     0.09562    0.05080    1E4      1.88     0.0598============B2_intercept    -2.2780     0.3002    1E4     -7.59     <.0001B2_age          0.01956   0.006019    1E4      3.25     0.0012B2_acadmos     0.000249   0.000668    1E4      0.37     0.7093B2_minordrg      0.1176    0.02711    1E4      4.34     <.0001B2_logspend      0.1644    0.03531    1E4      4.66     <.0001*/

两类有限混合Poisson模型

*** TWO-CLASS FINITE MIXTURE POISSON MODEL WITH FMM PROCEDURE ***;proc fmm data = tmp1 tech = trureg;  model majordrg = age acadmos minordrg logspend / dist = poisson k = 2; run;/*Fit Statistics -2 Log Likelihood             8136.8AIC  (smaller is better)      8166.8AICC (smaller is better)      8166.9BIC  (smaller is better)      8275.7 Parameter Estimates for 'Poisson' Model                                  StandardComponent  Effect     Estimate     Error  z Value  Pr > |z|         1  Intercept   -2.4449    0.3497    -6.99    <.0001        1  AGE         0.02214  0.006628     3.34    0.0008        1  ACADMOS    0.000529  0.000770     0.69    0.4920        1  MINORDRG    0.05054   0.04015     1.26    0.2081        1  LOGSPEND     0.2140   0.04127     5.18    <.0001        2  Intercept   -8.0935    1.5915    -5.09    <.0001        2  AGE         0.01150   0.01294     0.89    0.3742        2  ACADMOS    0.004567  0.002055     2.22    0.0263        2  MINORDRG     0.2638    0.6770     0.39    0.6968        2  LOGSPEND     0.6826    0.2203     3.10    0.0019 Parameter Estimates for Mixing Probabilities                           StandardEffect       Estimate       Error    z Value    Pr > |z| Intercept     -1.4275      0.5278      -2.70      0.0068AGE          -0.00277     0.01011      -0.27      0.7844ACADMOS      0.001614    0.001440       1.12      0.2623MINORDRG       1.5865      0.1791       8.86      <.0001LOGSPEND     -0.06949     0.07436      -0.93      0.3501*/ *** TWO-CLASS FINITE MIXTURE POISSON MODEL WITH NLMIXED PROCEDURE ***;proc nlmixed data = tmp1 tech = trureg maxit = 500;         B2_intercept = -8 B2_age = 0 B2_acadmos = 0 B2_minordrg = 0 B2_logspend = 0    eta1 = B1_intercept + B1_age * age + B1_acadmos * acadmos + B1_minordrg * minordrg + B1_logspend * logspend;  exp_eta1 = exp(eta1);  prob1 = exp(-exp_eta1) * exp_eta1 ** majordrg / fact(majordrg);  eta2 = B2_intercept + B2_age * age + B2_acadmos * acadmos + B2_minordrg * minordrg + B2_logspend * logspend;  exp_eta2 = exp(eta2);  prob2 = exp(-exp_eta2) * exp_eta2 ** majordrg / fact(majordrg);  eta3 = B3_intercept + B3_age * age + B3_acadmos * acadmos + B3_minordrg * minordrg + B3_logspend * logspend;  exp_eta3 = exp(eta3);  p = exp_eta3 / (1 + exp_eta3);  _prob_ = p * prob1 + (1 - p) * prob2;  ll = log(_prob_);  model majordrg ~ general(ll);run;/*Fit Statistics -2 Log Likelihood                 8136.8AIC (smaller is better)           8166.8AICC (smaller is better)          8166.9BIC (smaller is better)           8275.7 Parameter Estimates                            StandardParameter      Estimate      Error     DF   t Value   Pr > |t| B1_intercept    -2.4449     0.3497    1E4     -6.99     <.0001B1_age          0.02214   0.006628    1E4      3.34     0.0008B1_acadmos     0.000529   0.000770    1E4      0.69     0.4920B1_minordrg     0.05054    0.04015    1E4      1.26     0.2081B1_logspend      0.2140    0.04127    1E4      5.18     <.0001============B2_intercept    -8.0935     1.5916    1E4     -5.09     <.0001B2_age          0.01150    0.01294    1E4      0.89     0.3742B2_acadmos     0.004567   0.002055    1E4      2.22     0.0263B2_minordrg      0.2638     0.6770    1E4      0.39     0.6968B2_logspend      0.6826     0.2203    1E4      3.10     0.0020============B3_intercept    -1.4275     0.5278    1E4     -2.70     0.0068B3_age         -0.00277    0.01011    1E4     -0.27     0.7844B3_acadmos     0.001614   0.001440    1E4      1.12     0.2623B3_minordrg      1.5865     0.1791    1E4      8.86     <.0001B3_logspend    -0.06949    0.07436    1E4     -0.93     0.3501*/

 

 

©著作权归作者所有:来自51CTO博客作者拓端小助手的原创作品,如需转载,请注明出处,否则将追究法律责任

更多相关文章

  1. 基于数据挖掘SVM模型的pre-incident事故预防预测分析报告
  2. R方和线性回归拟合优度
  3. 前端技术分享:盒模型的概念和文本溢出解决办法
  4. 「跬步千里」详解 Java 内存模型与原子性、可见性、有序性
  5. 模模搭古城搭建学习笔记4:完结篇
  6. 脱离业务模型的基础架构没有灵魂,金融行业IT双模建设我们该如何应
  7. 原创 | 详解SVM模型——核函数是怎么回事
  8. css盒模型以及如何计算盒子的宽度
  9. 刘光聪|剖析TensorFlow架构与设计:编程模型

随机推荐

  1. Titanium Studio
  2. Feel Android Studio(1)Install and Upda
  3. Android TextView 换行
  4. android界面无标题栏和全屏效果的实现方
  5. 【Android 应用开发】Ubuntu 下 Android
  6. Android Studio 初体验
  7. Android WIFI 框架分析
  8. Android技术周报190310期 —— onSaveIns
  9. This Android SDK requires Android Deve
  10. 如何发布你的Android应用程序