- 负二项回归 nbreg
nbreg – Negative binomial regression
nbreg depvar [indepvars] [if] [in] [weight] [, nbreg_options]
Example
nbreg like stars text_len sentiment polarity, vce(cluster business_id)
- 不报告常数项
nbreg y x1 x2 x3, noconstant
2.零膨胀负二项回归 zinb
在一些场景下,0 取值的频率很高,无法使用普通泊松分布解释,于是出现了所谓零膨胀问题。比如,商品评论的点赞数量大部分为零,可能因为评论本身无意义,也可能因为大多数人看完评论后不会去选择点赞。
zinb – Zero-inflated negative binomial regression
zinb depvar [indepvars] [if] [in] [weight], inflate(varlist[, offset(varname)]|_cons) [options]
- inflate(var):var用于解释产生过多0值的原因
- forcevuong: 用于比较 zinb和nb的模型效果
- forcevuong不能与 vce() cluster standard error 同用, 可先比较两个模型后再聚合标准误
zinb like sentiment polarity , inflate(stars text_len) forcevuong
此处比较zinb和nb模型效果 Pr>z=0, 则表明zinb模型效果更好
- 零膨胀泊松回归 zip
zip – Zero-inflated Poisson regression
zip depvar [indepvars] [if] [in] [weight], inflate(varlist[, offset(varname)]|_cons) [options]
Example
zip like sentiment polarity , inflate(stars text_len) forcevuong
参考来源:ZIP-too many Zero:零膨胀泊松回归模型
Original: https://blog.csdn.net/weixin_46599926/article/details/123304766
Author: 羊羊猪
Title: Stata的负二项回归与零膨胀回归命令
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/626785/
转载文章受原作者版权保护。转载请注明原作者出处!