赞
踩
- correlate [varlist] [if] [in] [weight] [, correlate_options]
- pwcorr [varlist] [if] [in] [weight] [, pwcorr_options]
# correlate可简写为corr
corr y x1 x2 x3
pwcorr y x1 x2 x3
regress depvar [indepvars] [if] [in] [weight] [, options]
# regression可简写为reg
reg y x1 x2 x3
# x4为需要引入的虚拟变量
xi: reg y x1 x2 x3 i.x4
# 当 VIF > 10 则认为变量存在多重共线性
# mean VIF 小于 3.3 模型较为合理
estat vif
[R] areg – Linear regression with a large dummy-variable set
areg depvar [indepvars] [if] [in] [weight], absorb(varname) [options]
areg命令是reg命令的一个优化。有些时候我们想在回归中控制很多虚拟变量,但又不想生成虚拟变量,也不想报告虚拟变量的回归结果,那么就可以使用areg命令。areg结果与reg命令等价。
不过absorb()里只能加入一个变量,如果还需更高维度的固定效应,则需加入i.var的方式引入固定变量
areg like stars text_len sentiment polarity i.year, absorb(business_id) vce(cluster business_id)
REGHDFE: Linear models with multi-way fixed effects and multi-way clustering
Least-square regressions (no fixed effects):
reghdfe depvar [indepvars] [if] [in] [weight] [, options]
Fixed effects regressions:
reghdfe depvar [indepvars] [if] [in] [weight] , absorb(absvars) [options]
Fixed effects regressions with group-level outcomes and individual FEs:
reghdfe depvar [indepvars] [if] [in] [weight] , absorb(absvars indvar) group(groupvar) individual(indvar) [options]
reghdfe 主要用于实现多维固定效应线性回归。在保证有效吸收多种固定效应后提高运行速度
因为是外源命令,在使用前请先下载命令包
ssc install reghdfe
命令更多介绍:REGHDFE: Linear Regressions With Multiple Fixed Effects
reghdfe like stars text_len sentiment polarity, absorb(year business_id) vce(cluster business_id)
参考来源:关于固定效应模型的四个Stata命令
poisson depvar [indepvars] [if] [in] [weight] [, options]
poisson y x1 x2 x3
- it’s well known that poisson estimator with robust/clustered SE (this is called pseudo ML poisson) can account for overdisperson and zero-inflated data, and
- negative binominal models can not account for business dummies (you can force the program to add them, but results will be wrong).
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。