社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Git

Stata学习:如何构建支付意愿空间混合logit模型?

Stata与R学习 • 1 年前 • 232 次点击  

文献来源

支付意愿空间混合logit模型:Mixed logit model in WTP space

  1. Talevi, M., et al. (2022). Speaking from experience: Preferences for cooking with biogas in rural India
    1. Appendix A. Supplementary data【数据+Stata】

示例代码

请读者自行运行1-282行,此处从略。

核心代码如下:

set seed 537363959
mixlogitwtp outcome if validated==1,  rand(goodexperiencebiogas_ifbg badexperiencebiogas_ifbg noexperiencebiogas_ifbg alternisrocket maint_higher smoke_lower fuelefficiency) price(negprice) id(id) group(case) 
estimates store MXL_exp
estimates restore MXL_exp
mixlbeta goodexperiencebiogas_ifbg badexperiencebiogas_ifbg noexperiencebiogas_ifbg alternisrocket maint_higher smoke_lower fuelefficiency, nrep(1000) saving(wtpexp_distribution) replace

得到结果

Iteration 0:  Log likelihood = -1551.5136  (not concave)
Iteration 1:  Log likelihood = -1544.5129  (not concave)
Iteration 2:  Log likelihood = -1481.3067  (not concave)
Iteration 3:  Log likelihood = -1461.4711  (not concave)
Iteration 4:  Log likelihood = -1440.4676  (not concave)
Iteration 5:  Log likelihood = -1355.3401  (not concave)
Iteration 6:  Log likelihood = -1328.5785  
Iteration 7:  Log likelihood =    -1316.8  (not concave)
Iteration 8:  Log likelihood = -1315.2515  (not concave)
Iteration 9:  Log likelihood = -1314.0268  
Iteration 10: Log likelihood =  -1313.016  
Iteration 11: Log likelihood = -1312.8286  (not concave)
Iteration 12: Log likelihood = -1311.9755  
Iteration 13: Log likelihood = -1311.7381  
Iteration 14: Log likelihood = -1311.7282  
Iteration 15: Log likelihood = -1311.7282  

Mixed logit model in WTP space                         Number of obs =   5,484
                                                       Wald chi2(8)  = 4090.87
Log likelihood = -1311.7282                            Prob > chi2   =  0.0000

-------------------------------------------------------------------------------------------
                  outcome | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
--------------------------+----------------------------------------------------------------
Mean                      |
goodexperiencebiogas_ifbg |   7348.172   596.1974    12.33   0.000     6179.646    8516.697
 badexperiencebiogas_ifbg |   5743.991    525.265    10.94   0.000      4714.49    6773.491
  noexperiencebiogas_ifbg |   2836.663   800.9085     3.54   0.000     1266.911    4406.415
           alternisrocket |  -2768.394   918.7587    -3.01   0.003    -4569.128   -967.6605
             maint_higher |   608.8961   404.4207     1.51   0.132    -183.7539    1401.546
              smoke_lower |   4784.997   456.2536    10.49   0.000     3890.757    5679.238
           fuelefficiency |   3074.038   320.1424     9.60   0.000      2446.57    3701.505
                 negprice |  -7.587495    .144576   -52.48   0.000    -7.870858   -7.304131
--------------------------+----------------------------------------------------------------
SD                        |
goodexperiencebiogas_ifbg |   5654.514   831.5416     6.80   0.000     4024.723    7284.306
 badexperiencebiogas_ifbg |   4184.776   558.7539     7.49   0.000     3089.639    5279.914
  noexperiencebiogas_ifbg |  -6880.632   763.6405    -9.01   0.000    -8377.339   -5383.924
           alternisrocket |  -6146.829   654.2155    -9.40   0.000    -7429.068    -4864.59
             maint_higher |  -3213.146   591.0612    -5.44   0.000    -4371.604   -2054.687
              smoke_lower |   1388.787   384.9297     3.61   0.000     634.3389    2143.236
           fuelefficiency |  -520.4972   379.1623    -1.37   0.170    -1263.642    222.6472
                 negprice |   .7824771   .1572334     4.98   0.000     .4743053    1.090649
-------------------------------------------------------------------------------------------
The sign of the estimated standard deviations is irrelevant: interpret them as
being positive

. estimates store MXL_exp

. estimates restore MXL_exp
(results MXL_exp are active now)

. mixlbeta goodexperiencebiogas_ifbg badexperiencebiogas_ifbg noexperiencebiogas_ifbg alternisrocket ma
> int_higher smoke_lower fuelefficiency, nrep(1000) saving(wtpexp_distribution) replace
(file wtpexp_distribution.dta not found)
file wtpexp_distribution.dta saved

期刊排版

(完)

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/162586
 
232 次点击