【第2集】Stat基本功能 数据可视化与回归分析
数据可视化(Data Visualization)
Stata 内建多种图表功能,可视化数据分析结果:
- 直方图(Histogram)
histogram age, bin(10) normal
- 散点图(Scatter Plot)
scatter income age
- 箱型图(Box Plot)
graph box income, over(gender)
回归分析(Regression Analysis)
Stata 内建各类统计模型,如线性回归、逻辑回归等:
- 线性回归(Linear Regression)
regress income age education experience
- 逻辑回归(Logistic Regression)
logit purchase age income
- 多重回归(Multiple Regression)
regress wage education experience tenure
- 回归诊断
estat vif // 检查共线性
predict residuals, residual //生成残差
scatter residuals age // 检查残差图
回应