STATA实用学习提高笔记材料.doc





《STATA实用学习提高笔记材料.doc》由会员分享,可在线阅读,更多相关《STATA实用学习提高笔记材料.doc(44页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、 北京科技大学STATA 应用学习摘录2第一章 STATA 的基本操作 一、设置内存容set mem 500m, perm一、显示输入内容 Display 1 Display “clive”二、显示数据集结构 describe Describe /d三、编辑 edit Edit四、重命名变量 Rename var1 var2五、显示数据集内容 list/browse List in 1 List in 2/10六、数据导入:数据文件是文本类型(.csv)1、 insheet: . insheet using “C:Documents and SettingsAdministrator桌面 ST
2、9007datasetFees1.csv”, clear2、 内存为空时才可以导入数据集,否则会出现(you must start with an empty dataset) (1)清空内存中的所有变量:.drop _all (2)导入语句后加入“clear”命令。 七、保存文件1、 save “C:Documents and SettingsAdministrator桌面ST9007datasetFees1.dta” 2、 save “C:Documents and SettingsAdministrator桌面ST9007datasetFees1.dta”, replace 八、打开及退
3、出已存文件 use 1、.Use 文件路径及文件名, clear 2、. Drop _all/.exit 九、记录命令和输出结果(log) 1、 开始建立记录文件:log using “J:phdoutput.log“, replace 2、 暂停记录文件:log off 3、 重新打开记录文件:log on 4、 关闭记录文件:log close 十一、创建和保存程序文件:(doedit, do) 1、 打开程序编辑窗口:doedit 2、 写入命令 3、 保存文件,.do. 4、 运行命令:.do 程序文件路径及文件名 十二、多个数据集合并为一个数据集(变量和结构相同)纵向合并 appen
4、d insheet using “J:phdFees1.csv“, clear save “J:phdFees1.dta“, replace insheet using “J:phdFees2.csv“, clear3append using “J:phdFees1.dta“ save “J:phdFees1.dta“, replace十三、横向合并,在原数据集基础上加上另外的变量 merge 1、insheet using “J:phdFees1.csv“, clear sort companyid yearend save “J:phdFees1.dta“, replace describ
5、e insheet using “J:phdFees6.csv“, clear sort companyid yearend merge companyid yearend using “J:phdFees1.dta“ save “J:phdFees1.dta“, replace describe2、_merge=1 obs. From master data _merge=2 obs. From using data_merge=3 obs. From both master and using data十四、帮助文件:help1、. Help describe 十五、描述性统计量1、sum
6、marize incorporationyear 单个 summarize incorporationyear-big6 连续多个 summarize _all or simply summarize 所有2、更详细的统计量summarize incorporationyear, detail3、centile centile auditfees, centile(0(10)100) centile auditfees, centile(0(5)100) 4、tabulate 不同类型变量的频数和比例 tabulate companytype tabulate companytype big6
7、, column 按列计算百分比 tabulate companytype big6, row 按行计算百分比 tab companytype big6 if companytype=0 2001; PincusPincus andand Rajgopal,Rajgopal, 2002).2002). b)b)CompaniesCompanies decidedecide whetherwhether toto grantgrant stockstock optionsoptions (Core(Core andand Guay,Guay, 1999).1999). c)c)Companies
8、Companies decidedecide whetherwhether toto hirehire BigBig 5 5 oror non-Bignon-Big 5 5 auditorsauditors (e.g.,(e.g., ChaneyChaney etet al.,al., 2004).2004). d)d)GovernmentsGovernments decidedecide whetherwhether toto fullyfully oror partiallypartially privatizeprivatize (Guedhami(Guedhami andand Pit
9、tman,Pittman, 2006).2006). e)e)CompaniesCompanies decidedecide whetherwhether toto followfollow internationalinternational financialfinancial reportingreporting strategystrategy (Leuz(Leuz andand Verrecchia,Verrecchia, 2000).2000). f)f)CompaniesCompanies decidedecide whetherwhether toto recognizerec
10、ognize financialfinancial instrumentsinstruments atat fairfair valuevalue oror disclosedisclose (Ahmed(Ahmed etet al.,al., 2006).2006). g)g)CompaniesCompanies decidedecide whetherwhether oror notnot toto gogo privateprivate (Engel(Engel etet al.,al., 2002).2002).2 2、ConcernsConcerns aboutabout selec
11、tivityselectivity arisearise whenwhen thethe RHSRHS dummydummy variablevariable (D)(D) isis endogenous:endogenous:EndogeneityEndogeneity resultsresults inin biasbias ifif E(uE(u | | D)D) 0.0. TheThe intuitionintuition underlyingunderlying HeckmanHeckman isis toto estimateestimate andand thenthen con
12、trolcontrol forfor E(uE(u | | D).D). FirstFirst modelmodel thethe choicechoice ofof D:D:39Z Z isis a a vectorvector ofof exogenousexogenous variablesvariables thatthat affectaffect D D butbut havehave nono directdirect effecteffect onon Y.Y.DZY3 3、HeckmanHeckman 的方法:的方法:TheThe intuitionintuition und
13、erlyingunderlying HeckmanHeckman isis toto estimateestimate E(uE(u | | D)D) andand includeinclude itit asas a a controlcontrol variablevariable onon thethe RHSRHS ofof thethe Y Y model:model: E(uE(u | | D)D) = = IMRIMR wherewhere40TheThe IMRIMR variablevariable isis addedadded asas a a “control“cont
14、rol forfor selectivity”selectivity” inin thethe Y Y model:model:TheThe D D andand Y Y modelsmodels cancan bebe estimatedestimated inin two-stepstwo-steps oror estimatedestimated jointlyjointly usingusing maximummaximum likelihoodlikelihood (ML)(ML) MLML yieldsyields separateseparate estimatesestimat
15、es ofof andand . . TheThe two-steptwo-step yieldsyields anan estimateestimate ofof . . UnderUnder thethe nullnull ofof nono selectivityselectivity bias,bias, = = 0 0 andand = = 0.0. 4 4、另一种思路:、另一种思路:原始模型:原始模型:还可以转化为还可以转化为 以下方程组:以下方程组:加入控制变量后变为加入控制变量后变为41可以分别可以分别 D=1D=1 或或 D=0D=0 的情况下分别回归。的情况下分别回归。5
16、5、选择模型使用、选择模型使用 heckmanheckman 的例子:的例子:useuse “J:phdheckman.dta“,“J:phdheckman.dta“, clearclear heckmanheckman wagewage educationeducation age,age, select(emp=select(emp= marriedmarried childrenchildren educationeducation age)age) twosteptwostep42 WomensWomensWomens wageswageswages areareare higherh
17、igherhigher if if if theytheythey areareare olderolderolder andandand moremoremore highlyhighlyhighly educatededucatededucated TheTheThe probitprobitprobit modelmodelmodel ofofof employmentemploymentemployment is is is exactlyexactlyexactly thethethe samesamesame asasas whatwhatwhat wewewe hadhadhad
18、 beforebeforebefore WomenWomenWomen areareare moremoremore likelylikelylikely tototo bebebe in inin employmentemploymentemployment if if if theytheythey areareare married,married,married, havehavehave children,children,children, areareare moremoremore highlyhighlyhighly educatededucatededucated oror
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- STATA 实用 学习 提高 笔记 材料

限制150内