基于stata的回归分析课件.pptx
Example 4.5 背景介绍,以We4 P132 Example 4.5 hprice2.dta 为例;研究问题:住房价格和空气污染的关系;(简化:median housing price 研究对象:波士顿地区506个社区;变量定义: nox: 空气中氮氧化物的浓度; dist: 社区距离5个就业中心的距离;,第1页/共15页,Example 4.5 背景介绍以We4 P132 Exam,Example 4.5 背景介绍,变量定义: rooms:社区中住房的平均房间数目; stratio: 社区中中学的平均学生和老师比例;回归模型: log(price)=0+ 1log(nox) + 2log(dist) + + 3rooms + 4stratio+u,第2页/共15页,Example 4.5 背景介绍变量定义:第2页/共15页,1、数据的统计性质,导入数据:方法一:cd F:研究生研一下双学位中计2课件statafiles;(设定当前工作区)use hprice2, clear (调用数据)方法二:use F:研究生研一下双学位中计2课件statafileshprice2.dta, clear,第3页/共15页,1、数据的统计性质导入数据:第3页/共15页,Data,第4页/共15页,Datapricenoxroomsdiststratio12,Contains data from hprice2.dta obs: 506 vars: 13 31 Oct 1996 16:37 size: 24,794 - storage display valuevariable name type format label variable label-price float %9.0g median housing price, $nox float %9.0g nit ox concen; parts per 100mrooms float %9.0g avg number of roomsdist float %9.0g wght dist to 5 employ centersstratio float %9.0g average student-teacher ratiolprice float %9.0g log(price)lnox float %9.0g log(nox)-Sorted by:,Describe & list,第5页/共15页,Contains data from hprice2.dta,Summarize & Sum &Sort,gen ldist=log(dist)sum lprice lnox ldist rooms stratio,第6页/共15页,Summarize & Sum &Sortgen ldist,散点矩阵图,Graph matrix price nox dist rooms strtioGraph matrix lprice lnox ldist rooms strtioComparison and Model selection,第7页/共15页,散点矩阵图Graph matrix price nox di,第8页/共15页,第8页/共15页,第9页/共15页,第9页/共15页,2、do file & log file,参见代码,第10页/共15页,2、do file & log file参见代码第10页/共,独立、均值独立、不相关,第11页/共15页,独立、均值独立、不相关第11页/共15页,独立,随机事件独立的定义:事件A、B相互独立 P(AB)=P(A)*P(B) P(AlB)=P(A);多维随机变量间的独立性:设n维随机变(X1,X2,Xn)的联合分布函数为F(x1,x2,xn),Fi(xi)为Xi的边际分布函数。如果对任意n个实数x1,x2,xn,有 则称X1,X2,Xn相互独立。,第12页/共15页,独立随机事件独立的定义:事件A、B相互独立 P(AB)=P(,均值独立,E(ulx)=0独立 均值独立Proof:,第13页/共15页,均值独立E(ulx)=0第13页/共15页,反例:,第14页/共15页,反例:第14页/共15页,感谢您的观赏!,第15页/共15页,感谢您的观赏!第15页/共15页,