教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 实用模板 >

STATA实用学习笔记(3)

来源:网络收集 时间:2026-08-10
导读: ? 选择起始点和间隔宽度:hist lnaf if lnaf>=0 lnaf xlabel(0(0.5)5) ? 是否与正态分布一致:hist lnaf if lnaf>=0 & lnaf 2、散点图(scatter) ? scatter lnaf lnta 第一个变量是纵轴,第二个变量是横轴。 ? two

? 选择起始点和间隔宽度:hist lnaf if lnaf>=0 & lnaf<=5, width (0.25)

? 选择描述横轴和纵轴的单位和数据标识:hist lnaf if lnaf>=0 & lnaf<=5, width (0.25)

xlabel(0(0.5)5)

? 是否与正态分布一致:hist lnaf if lnaf>=0 & lnaf<=5, width(0.25) normal

2、散点图(scatter)

? scatter lnaf lnta

第一个变量是纵轴,第二个变量是横轴。

? twoway (scatter lnaf lnta, msize(tiny)) (lfit lnaf lnta) 在散点图上加入最适合的一条直线。 三十、缩尾处理winsor

. winsor rev, gen(wrev) p(0.01)0.01代表去掉的百分数。 Winsor rev, gen(wrev) h(5),5代表去掉的个数

8

第二章 线性回归 内容简介:

? ? ? ? ? ? ? ? ? ? ?

2.1 The basic idea underlying linear regression 2.2 Single variable OLS

2.3 Correctly interpreting the coefficients 2.4 Examining the residuals 2.5 Multiple regression 2.6 Heteroskedasticity 2.7 Correlated errors 2.8 Multicollinearity

2.9 Outlying observations 2.10 Median regression 2.11 “Looping”

2.1 The basic idea underlying linear regression

1.残差

F为真实值,为预测值,ε为残差。 OLS回归就是使残差最小。 2. 基本一元回归 regress y x

3.回归结果的保存

回归结果的系数保存在_b[varname]内存变量中,常数项的系数保存在 (_cons)内存变量中。

4、预测值及残差

? predict yhat

? predict yres, resid yres即为真实值得与预测值之差。 5、残差与X的散点图

twoway (scatter y_res x) (lfit y_res x)

9

6、衡量估计系数准确程度:标准误差。

用样本的标准偏差与系数之间的关系来衡量即T值(用系数除以标准差),同时P值是

根据T值的分布计算出来的,表示系数落入标准对应上下限的可能性。前提是残差符合以下假设:

同方差:Homoscedasticity (i.e., the residuals have a constant variance)

独立不相关:Non-correlation (i.e., the residuals are not correlated with each other) 正态分布:Normality (i.e., the residuals are normally distributed)

7、回归结果包含的一些内容的意思 ? 各变差的自由度:

? For the ESS, df = k-1 where k = number of regression coefficients (df = 2 – 1) ? For the RSS, df = n – k where n = number of observations (= 11 - 2) ? For the TSS, df = n-1 ( = 11 – 1)

? MS:变差除以自由度:The last column (MS) reports the ESS, RSS and TSS divided by their

respective degrees of freedom

? R平方:The R-squared = ESS / TSS

? 调整的R平方:Adj R-squared = 1-(1-R2)(n-1)/(n-k) ,消除了加入相关度不高解释变量后R平

方增加的不足。

? Root MSE = square root of RSS/n-k:模型的平均解释能力 ? The F-statistic = (ESS/k-1)/(RSS/n-k):模型的总解释能力

2.3 Correctly interpreting the coefficients

1、假如想检验big6的审计费用在公开发行和非公开发行公司之间的区别时,可用交互变量。Big6*listed.

10

STATA实用学习笔记(3).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/519856.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)