查看原文
其他

没有这5个Stata命令, 我真的会活不下去!

毛毛爱豆 计量经济圈 2021-10-23

凡是搞计量经济的,都关注这个号了

稿件:econometrics666@126.com

所有计量经济圈方法论丛的code程序, 宏微观数据库和各种软件都放在社群里.欢迎到计量经济圈社群交流访问.

关于Stata相关技能,各位学者可以参阅如下文章:1.Stata16新增功能有哪些? 满满干货拿走不谢2.Stata资料全分享,快点收藏学习3.Stata统计功能、数据作图、学习资源等4.Stata学习的书籍和材料大放送, 以火力全开的势头5.史上最全Stata绘图技巧, 女生的最爱6.把Stata结果输出到word, excel的干货方案7.编程语言中的函数什么鬼?Stata所有函数在此集结8.世界范围内使用最多的500个Stata程序9.6张图掌握Stata软件的方方面面, 还有谁, 还有谁?10.LR检验、Wald检验、LM检验什么鬼?怎么在Stata实现11.Stata15版新功能,你竟然没有想到,一睹为快12."高级计量经济学及Stata应用"和"Stata十八讲"配套数据13.数据管理的Stata程序功夫秘籍14.非线性面板模型中内生性解决方案以及Stata命令15.把动态面板命令讲清楚了,对Stata的ado详尽解释16.半参数估计思想和Stata操作示例17.Stata最有用的points都在这里,无可替代的材料18.PSM倾向匹配Stata操作详细步骤和代码,干货十足19.随机前沿分析和包络数据分析 SFA,DEA 及Stata操作20.福利大放送, Stata编程技巧和使用Tips大集成21.使用Stata进行随机前沿分析的经典操作指南,22.Stata, 不可能后悔的10篇文章, 编程code和注解23.用Stata学习Econometrics的小tips, 第二发礼炮24.用Stata学习Econometrics的小tips, 第一发礼炮25.广义合成控制法gsynth, Stata运行程序release26.多重中介效应的估计与检验, Stata MP15可下载27.输出变量的描述性统计的方案28.2SLS第一阶段输出, 截面或面板数据及统计值都行29.盈余管理指标的构建及其Stata实现程序, 对应解读和经典文献30.Python, Stata, R软件史上最全快捷键合辑!31.用Stata做面板数据分析, 操作代码应有尽有32.用Stata做面板数据分析, 操作代码应有尽有还有很多相关文章,各位学者可以自行搜索参阅。

相关阅读:第一(二)卷.Stata最新且有趣的程序系列汇编,②第三卷.Stata最新且急需的程序系列汇编,③第四卷.Stata最新且急需的程序系列汇编
正文
关于下方文字内容,整理者:社群群友@毛毛爱豆。今天是4月1日愚人节(美东时间),Stata半玩笑着说:“cluster in Stata, not in public”.
1.双重聚类cluster咋做? 线性, logit, tobit可以双聚类吗? 2.啥时候使用聚类标准误, 以及数据聚类的修正方法? 3.在什么级别上标准误聚类, 个体, 县, 省或行业, 时间?4.面板数据聚类, 因子分析和主成分分析咋做? 5.聚类分析(Cluster Analysis)及操作过程
以下是5个在我生活中(学术中)必不可少的Stata命令。
  1. help

  2. help

  3. help logit

  4. help ivreg2

  5. outreg2 / esttab

期待大家说出5个必不可少的Stata命令,而以下来自John Mullahy教授的帖子跟帖(见文后)。
  1. import delimited

  2. collapse

  3. egen

  4. merge

  5. tabulate


  1. collapse

  2. estout

  3. strpos

  4. program

  5. gr_edit


  1. help

  2. help

  3. help

  4. help  

  5. help


  1. set more off

  2. use

  3. destring

  4. egen

  5. tab and sum


  1. 𝚊𝚜𝚜𝚎𝚛𝚝

  2. 𝚖𝚕𝚊𝚋

  3. recast strL

  4. missing

  5. help fvvarlist

  6. clonevar


  1. motivate

  2. motivate

  3. motivate

  4. motivate  

  5. motivate


  1. tex/webdoc (sometimes markstat instead)

  2. coefplot

  3. heatplot  (I need to break my Ben Jann theme)

  4. tabout2

  5. svy:  commands

  6. Also , cond(),

  7. _n subscripting,

  8. mod(), and all the extended_fcn macros!


  1. Esttab

  2. Forval /foreach

  3. Append

  4. Merge

  5. reg


  1. mata

  2. margins

  3. glm

  4. twoway

  5. contract


  1. lookfor

  2. char

  3. isid

  4. browse

  5. a few others


  1. set scheme X, where X is anything but the default baby blue border abomination.

  2. regular expressions

  3. ftools

  4. gtools

  5. reghdfe


  1. shell python

  2. shell matlab

  3. shell R

  4. shell cp

  5. shell


  1. cls

  2. local

  3. global

  4. ///

  5. rename _all, lower

  6. findit  

  7. egen flag = tag(group)


  1. Foreach/forval

  2. Egen

  3. If/else

  4. Merge/append

  5. Reshape


  1. reshape

  2. gen

  3. bys

  4. egen

  5. merge


  1. egen

  2. reshape

  3. replace

  4. twoway  

  5. merge


  1. display

  2. texdoc

  3. foreach/forvalues

  4. local

  5. twoway


  1. egen

  2. egen

  3. egen

  4. egen

  5. egen


  1. inlist

  2. reshape

  3. help reshape

  4. foreach

  5. help foreach


  1. by/bysort: great for lag/lead type calculates or panel data in general.

  2. byhist makes nice categorical histograms in a single panel.

  3. Putexcel is great for making custom reproducible tables in excel (plus excel to latex  extension for latex).

  4. labmask is great for replacing strings with labeled intergers for i. or reducing file sizes.

  5. levelsof is great more making lists of values of string variables.


  1. "set trace on"(When combined with the classic green font, black background, it makes everything look like The Matrix. Fine, I guess it also helps with debugging code by showing exactly where things go wrong)


  1. Robust SEs


  1. collapse

  2. egen

  3. append

  4. margins

  5. reshape


  1. help

  2. foreach

  3. post

  4. margins

  5. twoway


  1. reshape wide

  2. reshape long

  3. reshape wide  

  4. reshape long

  5. reshape wide


  1. margins

  2. merge

  3. collapse

  4. glm

  5. estout


  1. help

  2. tw  

  3. eststo/esttab

  4. glm

  5. lookfor

  6. cluster

  7. qui


  1. margins

  2. forval/foreach

  3. fasterxtile

  4. stset

  5. estout/outreg2


  1. br

  2. egen

  3. tabstat

  4. merge

  5. foreach/forval


  1. Gen

  2. Egen

  3. Browse

  4. Tabulate

  5. Merge

  6. fre


  1. sum, detail

  2. twoway

  3. merge

  4. date

  5. egen


  1. Foreach/forval  

  2. svyset  

  3. Reg  

  4. tab & br

  5. Egen


  1. set scheme

  2. estout / putexcel  

  3. tokenize

  4. tempfile  

  5. grc1leg


  1. mvdecode  

  2. coefplot

  3. predict

  4. xtline  

  5. mdesc


  1. margins

  2. local

  3. pause (if you teach)

  4. recode

  5. foreach


  1. Gen/replace

  2. Recode

  3. Over / by

  4. If

  5. m


  1. reshape

  2. merge

  3. append

  4. bysort

  5. replace


  1. estout  

  2. outreg2  

  3. xtnbreg

  4. codebook

  5. merge


  1. svyset, svydes, svy: ...

  2. foreach, forvalues, while

  3. capture

  4. preserve(, restore)

  5. mat def & nullmat()


  1. egen

  2. merge

  3. reshape

  4. substr

  5. All of the date commands


  1. catplot

  2. vplot

  3. compress

  4. codebook

  5. Anything by N Cox


  1. char

  2. extended_fcn

  3. meglm  

  4. twoway  

  5. program


  1. reshape

  2. foreach/forval

  3. collapse

  4. local/global

  5. tempfile/tempvar


  1. reghdfe

  2. gcollapse

  3. greshape

  4. help

  5. ta


  1. svyset

  2. predict

  3. scatter

  4. collapse

  5. outreg


  1. stcox

  2. egen

  3. merge

  4. foreach

  5. label define/values


  1. Foreach -for loops

  2. tab - bivariates matter!

  3. margins and marginsplot -visualizing interactions

  4. Factor notation: i.[varname] -dummy coding is a breeze

  5. set more off - every single file starts with it.


  1. contract


  1. egen (rowfirst)     - to coalesce across rows

  2. levelsof  - to iterate across values  

  3. tuples - all combinations of a list  

  4. preserve - goes well with collapse

  5. tab,sort - to list variables by frequency


  1. collapse

  2. ivreg2

  3. twoway

  4. xtabond2

  5. reshape


  1. I use egen and frame all the time.

  2. I use forval (with local) to turn 50 lines of code into three lines.

  3. And I use esttab and Latab for anything LaTeX related.


  1. codebook

  2. hist

  3. regress

  4. metan

  5. clear


  1. renvars (renaming variables)  

  2. mdesc (assess missingness)

  3. distinct (# of unique cases)

  4. strmatch (string function)  

  5. inlist (tag values within a variable)


  1. numlabel, add


  1. Collapse  

  2. Levelsof var, local(varval)

  3. Tab var, g(vardum)

  4. Pause on

  5. And of course.... Reshape.


  1. Fre  

  2. Margins  

  3. Coefplot

  4. Khb  

  5. Svy


  1. list

  2. label

  3. tab1  

  4. bysort

  5. test  

  6. svy set

  7. mi

  8. foreach


  1. margins

  2. teffects

  3. cmp

  4. shell

  5. collapse


  1. shell Rscript [scriptName.r]


  1. kdensity & akdensity

  2. cmp  

  3. coefplot

  4. esttab  

  5. rifreg (& now generalised to rifhdreg

Source: https://dwz.cn/Fu3gApMa

期待大家说出5个必不可少的Stata命令

拓展性阅读:

关于一些计量方法的合辑,各位学者可以参看如下文章:实证研究中用到的200篇文章, 社科学者常备toolkit”、实证文章写作常用到的50篇名家经验帖, 学者必读系列过去10年AER上关于中国主题的Articles专辑AEA公布2017-19年度最受关注的十大研究话题, 给你的选题方向2020年中文Top期刊重点选题方向, 写论文就写这些。后面,咱们又引荐了使用CFPS, CHFS, CHNS数据实证研究的精选文章专辑!这40个微观数据库够你博士毕业了, 反正凭着这些库成了教授Python, Stata, R软件史上最全快捷键合辑!关于(模糊)断点回归设计的100篇精选Articles专辑!关于双重差分法DID的32篇精选Articles专辑!关于合成控制法SCM的33篇精选Articles专辑!最近80篇关于中国国际贸易领域papers合辑!最近70篇关于中国环境生态的经济学papers合辑!使用CEPS, CHARLS, CGSS, CLHLS数据库实证研究的精选文章专辑!最近50篇使用系统GMM开展实证研究的papers合辑!
下面这些短链接文章属于合集,可以收藏起来阅读,不然以后都找不到了。

2.5年,计量经济圈近1000篇不重类计量文章,

可直接在公众号菜单栏搜索任何计量相关问题,

Econometrics Circle




数据系列空间矩阵 | 工企数据 | PM2.5 | 市场化指数 | CO2数据 |  夜间灯光 | 官员方言  | 微观数据 | 内部数据计量系列匹配方法 | 内生性 | 工具变量 | DID | 面板数据 | 常用TOOL | 中介调节 | 时间序列 | RDD断点 | 合成控制 | 200篇合辑 | 因果识别 | 社会网络 | 空间DID数据处理Stata | R | Python | 缺失值 | CHIP/ CHNS/CHARLS/CFPS/CGSS等 |干货系列能源环境 | 效率研究 | 空间计量 | 国际经贸 | 计量软件 | 商科研究 | 机器学习 | SSCI | CSSCI | SSCI查询 | 名家经验计量经济圈组织了一个计量社群,有如下特征:热情互助最多前沿趋势最多、社科资料最多、社科数据最多、科研牛人最多、海外名校最多。因此,建议积极进取和有强烈研习激情的中青年学者到社群交流探讨,始终坚信优秀是通过感染优秀而互相成就彼此的。

: . Video Mini Program Like ,轻点两下取消赞 Wow ,轻点两下取消在看

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存