第三讲多元线性回归模型检验及stata软件应用.ppt

第三讲多元线性回归模型检验及stata软件应用.ppt

第四章 多元线性回归模型检验 p 值检验法 为了方便起见,将F统计量的值记为F0 计算 p=P{F F0} 称为p 值(p-value ) 如果p ?,则p/2 ?/2, F0落入不能拒绝域,不能拒绝H0,如果p ?,落入拒绝域,应拒绝H0。 准则: 当P 值小于显著性水平时,方程在给定显著性水平下是显著的 当P 值大于显著性水平时,方程在给定显著性水平下是不显著的。 P值检验法(p-value test) p 值的概念: 为了方便,将 t 统计量的值记为 计算 p=P{|t|t 0} 称为p 值(p-value ) 通常的计量经济学软件都可自动计算出p 值 如果p?,则p/2 ?/2, t0落入拒绝域,应拒绝H0 Stata 操作 命令行格式:最常用的方法 use “d:\data\auto.dta”, clear /*打开数据库*/ regress y x1 x2 x3 菜单格式: Stata8以后开始有菜单 选择菜单进行操作后,在命令栏里可以看到命令行格式是如何写的。 Reshape命令 *From long-long form to long-wide form reshape wide @inc, i(hid year) j(sex) string *From long-wide form to long-long form reshape long @inc, i(hid year) j(sex) string *From long-long form to wide-long form reshape wide inc, i(hid sex) j(year) *From wide-long form to long-long form reshape long inc, i(hid sex) j(year) *From long-wide form to wide-wide form reshape wide minc finc, i(hid) j(year) *From wide-wide form to long-wide form reshape long minc finc, i(hid) j(year) *From wide-long form to wide-wide form reshape wide @inc90 @inc91, i(hid) j(sex) string *From wide-wide form to wide-long form reshape long @inc90 @inc92, i(hid) j(sex) string @ :如果变量为字符型,如sex的值为f和m,要把inc变量生成finc和minc,则需要用@。 Collapse 命令 产生新的数据集 collapse (统计量) 变量, by (变量) collapse (mean) price, by(foreign) collapse (mean) mprice=price (sum) sprice=price, by(foreign) table foreign,c(mean price sum price) replace 统计功能 描述统计 交叉表格 估计 描述统计 Sum x Histogram 表格 Table 可以作四维表格 table foreign,c(n price mean price sd price max price min price) row table year region gender,c(mean price sd price max price min price) by(agegroup) row Tabulate tabulate vid,gen(vidumy) tabulate vid gender do 文件的编写 编写do文件的作用 记录你的操作过程 减少命令的输入 do 文件的编写 Stata 中的do file编辑器 其它的软件:Textpad 其它一些常用命令 clear drop keep sum des list If 条件 bysort 变量 outreg ereturn list Outreg 生成像杂志那样的表格 Outreg using 文件名, coefastr p bdec(2) 3aster replace Outreg using 文件名, coefastr se 3aster append bdec(2): 留两位数 Coefastr:给系数加星号 P: 系数下面标P值 Se:

文档评论(0)

1亿VIP精品文档

相关文档