stata连享会

一份不太长的Stata简介(连玉君)

2017-10-21  本文已影响13人  stata连享会


           中山大学岭南学院
          电邮:arlionn@163.com
          主页:连玉君主页
          微博:http://weibo.com/arlionn
            First draft: 2010-7-14
            This version: 2013-4-12

1.Stata概貌

自从 2003 年开始使用 Stata 以来,我一直把“Stata”读为“Stay-ta”。有一次和一个从日本回来的朋友聊天,她把Stata读为“Star-ta”,让我甚感不适。经查阅,方才发现,原来“Stata”并非数个单词的缩写(因此其正确拼写为Stata而非STATA),而是由“statistics”和“data”合成的一个新词,Stata公司的员工都将其读做“Stay-ta”。从这个小小的趣闻中,可以看出Stata在问世之初(1985年)的主要功能在于统计分析和数据处理。经历了二十余年的发展,Stata已经升级到第11.1版(表1),在不断强化上述功能的同时,Stata在矩阵运算、绘图、编程等方面的功能也在不断加强。

表1 Stata发展历程

版本 发布时间 版本 发布时间 版本 发布时间
1.0 Jan-1985 3.1 Aug-1993 9.1 Sep-2005
1.1 Feb-1985 4.0 Jan-1995 9.2 Apr-2006
1.2 Mar-1985 5.0 Oct-1996 10.0 Jun-2007
1.4 Aug-1986 6.0 Jan-1999 10.1 Aug-2008
1.5 Feb-1987 7.0 Dec-2000 11.0 Jul-2009
2.0 Jun-1988 8.0 Jan-2003 11.1 Jun-2010
2.1 Jun-1989 8.1 Jul-2003 11.2 Mar-2011
2.1 Sep-1990 8.2 Oct-2003 12.0 Jul-2011
3.0 Mar-1992 9.0 Apr-2005 12.1 Jan-2012

source:http://www.Stata.com/support/faqs/res/history.html

Stata擅长数据处理、面板数据分析、时间序列分析、生存分析,以及调查数据分析,但其它方面的功能也并不逊色(表2)。

表2 Stata的功能一览

数据处理和绘图
Data management Graphics
统计分析和检验
Basic statistics Nonparametric methods Exact statistics
回归分析
Linear models GLMSEM MLE GMM
+Multilevel mixed models+ Panel data Probit/Logit/Count Time series
多变量模型(多元统计) 抽样和模拟分析
Multivariate methods Cluster analysis Resampling and simulation
调查分析和生存分析
Survey methods Survival analysis Epidemiologists
编程
mming language Mata User-written commands

2. 为何选择Stata?

这是个不太容易回答的问题。Stata网站列举了数条可能的原因。Edwards(2005)[1]曾经非常细致地对比了Stata, SPSS和SAS的优劣。Princeton大学的Torres-Reyna博士则将四种常用软件的特征总结为表3。整体而言,Stata具有较强的优势。

表3 四款统计软件的对比分析

Features Stata SPSS SAS R
Learning curve Steep/gradual Gradual/flat Pretty steep Pretty steep
User interface Programming/point-and-click Mostly point-and-click Programming Programming
Data manipulation Very strong Moderate Very strong Very strong
Data analysis Powerful Powerful Powerful/versatile Powerful/versatile
Graphics Very good Very good Good Good

Source:http://dss.princeton.edu/training/StataTutorial.pdf,p.3.

3. 如何学习Stata?

我经常会被问到“Stata好学吗”、“我多长时间能学会Stata”,诸如此类的问题。诚然,相比于SPSS和Eviews等软件,Stata的门槛的确要高一些。然而,问题的关键并不在于Stata本身有多么难学,而在于你在统计和计量方面花费了多少时间,这与学习Stata所需的时间显著负相关。因此,我的回答往往会是:“哦,这个不好说,如果……,其实很简单……”。
  相比于十年前,现在学习Stata的资料已经非常丰富了。虽说殊途同归,但不同的学习路径却存在着巨大的效率差异。对于初学者而言,我的建议是,首要的问题是知道“Stata能做什么”,继而才是“Stata如何做什么”。
  第一个问题之所以重要,是因为从本质上讲,Stata只是我们完成统计分析的工具而已,因此,其基本平台是否宽广、是否有扩展潜力,以及它提供的分析工具是否能满足你的专业需求,都是你在选择Stata之前需要深入了解的。Stata User’s Guide(400页,中文)对这些问题做出了很好的解答,是一幅绝佳的导航图,能帮助你在短时间内了解Stata的基本架构、语法特征和核心功能。对于第二个问题,则有众多的资料可供参考:

3.1 网络资源

附录A 中,我精选了一些链接。值得一提的有如下几个:

3.2 相关书籍

详见 哇!Stata 书库\书单来袭!」

自从 Hamilton(1990)[13] 出版 《Statistics with Stata》以来,一系列将计量理论与软件操作结合起来的书籍开始相继面世,而在此之前,人们似乎都认为软件操作是件非常简单的事情。也正因为如此,很多学生在修习完了一个学年的计量经济学课程后,仍然不知道该如何完成OLS估计。为此,我列举的书籍多附有Stata实例(* 表示我的推荐程度),多数书中的范例数据都可通过Stata官方网站下载

3.3 Stata视频

相比于网络教程和纸本教材,通过视频学习Stata可能是最快捷的方式了。坊间流传有两套Stata视频教程:一套是UCLA免费发布的视频教程,内容涉及Stata入门、数据处理和绘图等。该视频教程采用英文讲解,思路清晰。局限在于所涉及内容不够系统,但对于想快速入门的学生则是一份不错的参考资料。同时,藉由这份资料也可以练习一下英语听力。另一套是由中山大学岭南学院的连玉君博士制作的Stata视频教程。该教程分为Stata初级视频(36学时)、Stata高级视频(48学时)和Stata学术论文专题视频(80学时)三个部分。初级教程涵盖了Stata简介、数据处理、矩阵、绘图、编程等基本操作;高级教程中包含了OLS、GLS、MLE、GMM、Bootstrap、Monte Carlo模拟、时间序列分析、面板数据模型等分析工具;学术论文专题则详细讲解了14篇经典论文的Stata实现过程。详见附录C

4.最后的话


附录A:一些有用的Stata链接

  1. Websites of Stata CP

    Stata website: http://www.Stata.com || 导航图
    Sata resources: http://www.Stata.com/links/resources1.html (大量网络教程链接)
    Stata journal: http://www.Stata.com/support/faqs/res/sj.html  
    Stata library: http://www.ats.ucla.edu/stat/Stata/library/
    Statalist archive: http://www.hsph.harvard.edu/cgi-bin/lwgate/STATALIST/archives/
    Stata FAQs: http://www.Stata.com/support/faqs/
    Stata statistics FAQs: http://www.Stata.com/support/faqs/stat/
    Stata listserver: http://www.Stata.com/support/Statalist/
    Stata discussion list: Statalist@hsphsun2.harvard.edu
    Stata bookstore: http://www.Stata.com/bookstore/ || Example Datasets || 中文
    Stata Manual: http://www.Stata-press.com/manuals/ || Example Datasets || 中文

  2. Websites in China

  1. UCLA Academic Technology Services (极力推荐)
  1. Stata Portal (a comprehensive links)


附录B:43个不可不知的Stata命令

虽然 Stata 已经历了三十余年的发展,命令不断增加,但牢记如下 43 个基本命令却是作为一个 Stata 用户的立身之本(Source:Stata Manual - Commands everyone should know。这里还有两个扩展版:30 分钟 Stata 教程 A || 30 分钟 Stata 教程 B

Getting online help

help, hsearch  
netsearch. seaarch       [U] 4 Stata’s help and search facilities

Keeping Stata up to date

ado, net, update  [U] 28 Using the Internet to keep up to date
adoupdate           [R] adoupdate

Operating system interface

pwd, cd             [D] cd

Using and saving data from disk

save                    [D] save
use                     [D] use
append, merge                       [U] 22 Combining datasets
compress                [D] compress

Inputting data into Stata          [U] 21 Inputting data

input                   [D] input
edit                    [D] edit
infile                  [D] infile (free format); [D] infile (fixed format)
infix                   [D] infix (fixed format)
insheet                 [D] insheet

Basic data reporting

describe                [D] describe
codebook                [D] codebook
list                    [D] list
browse                  [D] edit
count                   [D] count
inspect                 [D] inspect
table                   [R] table
tabulate                [R] tabulate oneway and [R] tabulate twoway

Data manipulation [U] 13 Functions and expressions

generate, replace                   [D] generate
egen                    [D] egen
rename                  [D] rename
drop, keep              [D] drop
sort                    [D] sort
encode, decode                      [D] encode
order                   [D] order
by                      [U] 11.5 by varlist: construct
reshape                 [D] reshape

Keeping track of your work

log                     [U] 15 Saving and printing output—log files
notes                   [D] notes

Convenience

display                 [R] display


附录C:Stata视频教程

自 2007 年以来,连玉君老师陆续制作了 Stata 系列 视频教程。相比于传统的教科书和课堂授课方式,视频教学大大降低了学习统计软件的门槛,因而受到了广大学员的一致好评。

Stata视频教程 由中山大学岭南学院的连玉君博士制作,分为Stata初级、Stata高级、Panel data专题和Stata学术论文视频三个部分,是一套学习计量经济学和Stata应用的绝佳教程。


参考文献:

关于我们

联系我们

往期精彩推文


欢迎加入Stata连享会(公众号: StataChina)
  1. Edwards, M (2005). SPSS, STATA, and SAS: Flavours of Statistical Software. URI: http://hdl.handle.net/1873/250,

  2. Long, J (2009). The workflow of data analysis using Stata. Stata Press

  3. 连玉君, 钟经樊 (2007). 中国上市公司资本结构动态调整机制研究. 南方经济, (1): 23-38.

  4. 连玉君, 苏治 (2009). 融资约束、不确定性与上市公司投资效率. 管理评论, (01): 19-26.

  5. Lian, Y, Chung C-F (2008). Are Chinese Listed Firms Over-Investing? SSRN working paper, Available at SSRN: http://ssrn.com/abstract=1296462,

  6. 连玉君 (2009). 中国上市公司投资效率研究. 北京: 经济管理出版社

  7. Watson, I (2007). Publications quality tables in Stata: a tutorial for the tabout program. Working Paper, http://fmwww.bc.edu/repec/bocode/t/tabout_tutorial.pdf,

  8. Jann, B, Long J (2010). Tabulating SPost results using estout and esttab. Stata Journal, 10 (1): 46-60.

  9. Jann, B (2005). Making regression tables from stored estimates. Stata Journal, 5 (3): 288-308.

  10. Jann, B (2007). Making regression tables simplified. Stata Journal, 7 (2): 227-244.

  11. Lokshin, M, Sajaia Z (2008). Creating print-ready tables in Stata. Stata Journal, 8 (3): 374-389.

  12. Gini, R, Pasquini J (2006). Automatic generation of documents. Stata Journal, 6 (1): 22-39.

  13. Hamilton, L (1990). Statistics with Stata. Brooks/Cole

  14. Baum, C (2006). An Introduction to Modern Econometrics using Stata. Stata Press

  15. Newton, H, Cox N (2009). Seventy-six Stata Tips. Stata Press

  16. Chen, X, Ender P, Mitchell M, Wells C, 2005, Stata Web Books: Regression with Stata (http://www.ats.ucla.edu/stat/stata/webbooks/reg/default.htm

  17. Adkins, L, Hill R (2008). Using stata for principles of econometrics. Wiley

  18. Wooldridge, J (2009). Introductory econometrics: A modern approach. South Western Cengage Learning

  19. Cameron, A, Trivedi P (2005). Microeconometrics: methods and applications. Cambridge University Press

  20. Cameron, A, Trivedi P (2009). Microeconometrics Using Stata. Stata Press

  21. Rabe-Hesketh, S, Everitt B (2006). A Handbook of Statistical Analyses Using Stata. Chapman & Hall/CRC

  22. Mitchell, M (2008). A visual guide to Stata graphics. Stata Press

  23. Kohler, U, Kreuter F (2005). Data Analysis Using Stata. Stata Press

  24. 杨菊华 (2008). 社会统计分析与数据处理技术——STATA软件的应用. 北京: 中国人民大学出版社

  25. Baum, C (2009). An Introduction to Stata Programming. Stata Press

  26. Hosmer, D, Lemeshow S (2000). Applied Logistic Regression. New York: John Wiley & Sons, Inc

  27. Long, J, Freese J (2001). Regression models for categorical dependent variables using Stata. Stata Press

  28. Long, J, Freese J (2006). Regression Models for Categorical Dependent Variables using Stata. Stata press

  29. Hilbe, J (2009). Logistic regression models. Chapman & Hall/CRC Press

  30. Rabe-Hesketh, S, Skrondal A, Pickles A (2004). GLLAMM manual. UC Berkeley Division of Biostatistics working paper series 160, http://www.bepress.com/ucbbiostat/paper160/,

  31. 王志刚 (2008). 面板数据模型及其在经济分析中的应用. 北京: 经济科学出版社

  32. Rabe-Hesketh, S, Skrondal A (2008). Multilevel and Longitudinal Modelling Using Stata (Second Edition). Stata Press

  33. Schmidheiny, K (2008). Coding with Mata in Stata. Lectures in Universitat Pompeu Fabra, http://kurt.schmidheiny.name/teaching/statamata.pdf,

  34. Sterne, J (2009). Meta-analysis in stata: An updated collection from the stata. Stata Press

  35. Hardin, J, Hilbe J, Hilbe J (2007). Generalized linear models and extensions. Stata Press

  36. Harrison, G (2008). Maximum Likelihood Estimation of Utility Functions Using Stata. University of Central Florida,

  37. Gould, W, Pitblado J, Sribney W (2006). Maximum likelihood estimation with Stata. Stata Press

  38. Cleves, M, Gould W, Gutierrez R, Marchenko Y (2008). An introduction to survival analysis using Stata. Stata Press

上一篇 下一篇

猜你喜欢

热点阅读