stata第二讲
- 格式:ppt
- 大小:344.00 KB
- 文档页数:37
Stata介绍作为流行的计量经济学软件,Stata的功能十分地全面和强大。
可以毫不夸张地说,凡是成熟的计量经济学方法,在Stata中都可以找到相应的命令,而这些命令都有许多选项以适应不同的环境或满足不同的需要。
即使是最详细的Stata手册,也难免有遗珠之憾,更何况本文仅是一个粗浅的介绍。
掌握Stata最好的办法是在实践中学习:Stata 本身提供了非常强大的帮助系统,并且关于Stata的书籍和网络资源都不少。
本文拟根据如下顺序介绍Stata:1.界面;2.文件和数据;3.语法和命令;4.数据管理;5.描述统计;6.画图;7.回归和回归分析;8.常用命令。
第3和第4部分是最体现Stata灵活性的地方,也是应用Stata的基础。
第5和第6部分介绍如何用Stata完成基本的统计功能。
Stata的功能很多,比如回归,曲线拟合,生存分析,主成分分析,因子分析,聚类分析,时间序列分析等等。
但回归无疑是其中最重要的功能。
第7部分介绍如何用Stata作线性回归和Logistic回归。
本文第2和第3部分包含了作者的观点,难免有偏颇之处。
其余部分主要来自文献的归纳和总结。
限于水平有限,错误在所难免,敬请原谅。
1.界面图1 Stata界面Stata有4个窗口:1. Stata Command(右下)用于向Stata输入命令;2. Stata Results(右上)用于显示运行结果;3. Review(左上)记录使用过的命令;4. Variables(左下)显示当前memory中的所有变量。
窗口上方是工具栏,其上的按钮依次为(从左到右)Open, Save, Print Graph/Print Log, Log Start/Stop/Suspend, Bring Log to Front, Bring Graph to Front, Do-file Editor, Data Editor, Data Browser, Clear –more- condition, Break。
Stata简明讲义王非中国经济研究中心ebwf@〇、写在前面的话关于学习Stata的意义,大家只需知道:目前,Stata是计量经济学、特别是微观计量经济学的主流软件。
因此,Stata很重要、很有用,而大家也会在使用Stata 的过程中慢慢体会到它的特点。
本讲义取名为“Stata简明讲义”,意在突出“简”和“明”两个字。
虽然讲义长达五十多页,但相比Stata的完全手册来说,还不及九牛之一毛,故为“简”。
实际上,完全手册中的很多内容都鲜有人(特别是计量经济学者)问津,而本讲义列出的内容则是大家经常用到的操作;所以,“简”也有“简”的好处。
即便如此,掌握这份讲义也并非易事。
所谓“明”,是明晰的意思。
本讲义本着“手把手教”的精神,力求把每项操作都说得具体明晰,以方便初学者(特别是没有程序操作经历的初学者)尽快上手。
至于本讲义在“简明”上做得怎么样,还需要各位读者来评判。
中心的一位学长邹传伟,曾经写过一份“Stata介绍”,在网上可以下载。
那份讲义比较全面,但不够具体明晰。
本讲义参照那份讲义,在框架上查漏补缺,并进一步地明晰化。
本讲义第二部分的“do文件”和第七部分的“残差分析”的相关内容均来自于中心的沈艳老师的相关讲义,而沈老师对于本讲义的成形给予了细致的指导。
本讲义附带了一些数据文件,其中“WAGE1.dta”和“WAGEPRC.dta”均来自Wooldridge的中级计量教材的数据集,而其他数据则为作者自己的杜撰。
尽管从别人那里拿来了许多好东西,但本讲义的任何错误仍源于作者自己的疏忽。
本讲义是这样安排的:第一部分讲Stata的界面,第二部分讲do文件,第三部分讲怎样把数据导入Stata,第四部分专门讲help和search命令以及帮助文件的阅读方法,第五部分讲数据的描述及管理,第六部分讲如何画图,第七部分讲初步的回归分析。
祝各位学习愉快。
一、Stata长什么样?首先,让我们看看Stata长什么样。
我们以Stata 9.1(以下简称Stata)为例。
Stata软件基本操作和数据分析入门(完整版讲义)Stata软件基本操作和数据分析入门第一讲Stata操作入门张文彤赵耐青第一节概况Stata最初由美国计算机资源中心(Computer Resource Center)研制,现在为Stata公司的产品,其最新版本为7.0版。
它操作灵活、简单、易学易用,是一个非常有特色的统计分析软件,现在已越来越受到人们的重视和欢迎,并且和SAS、SPSS一起,被称为新的三大权威统计软件。
Stata最为突出的特点是短小精悍、功能强大,其最新的7.0版整个系统只有10M左右,但已经包含了全部的统计分析、数据管理和绘图等功能,尤其是他的统计分析功能极为全面,比起1G以上大小的SAS 系统也毫不逊色。
另外,由于Stata在分析时是将数据全部读入内存,在计算全部完成后才和磁盘交换数据,因此运算速度极快。
由于Stata的用户群始终定位于专业统计分析人员,因此他的操作方式也别具一格,在Windows席卷天下的时代,他一直坚持使用命令行/程序操作方式,拒不推出菜单操作系统。
但是,Stata的命令语句极为简洁明快,而且在统计分析命令的设置上又非常有条理,它将相同类型的统计模型均归在同一个命令族下,而不同命令族又可以使用相同功能的选项,这使得用户学习时极易上手。
更为令人叹服的是,Stata 语句在简洁的同时又拥有着极高的灵活性,用户可以充分发挥自己的聪明才智,熟练应用各种技巧,真正做到随心所欲。
除了操作方式简洁外,Stata的用户接口在其他方面也做得非常简洁,数据格式简单,分析结果输出简洁明快,易于阅读,这一切都使得Stata成为非常适合于进行统计教学的统计软件。
Stata的另一个特点是他的许多高级统计模块均是编程人员用其宏语言写成的程序文件(ADO文件),这些文件可以自行修改、添加和下载。
用户可随时到Stata网站寻找并下载最新的升级文件。
事实上,Stata 的这一特点使得他始终处于统计分析方法发展的最前沿,用户几乎总是能很快找到最新统计算法的Stata 程序版本,而这也使得Stata自身成了几大统计软件中升级最多、最频繁的一个。
Stata学习讲义刘志阔一、如何导入数据Stata的数据处理功能是极其强大的,不过我们最好在excel中整理数据,然后导入到stata中就可以了。
命令:insheet using name.csv*注意,Stata只能用csv格式,另外把数据放到stata的目录中。
二、如何进行回归Stata中有很多命令,这些命令都是现成的,直接用就可以了。
不过,怎么用是个问题。
熟悉命令的基础上学会如何使用Help。
最简单的命令reg做ols回归,xtreg处理面板等。
命令:reg y x*注意,Stata命令的格式,自己回去看手册。
网络帮助可以采用如下命令获得findit scat3, net;search scat3, net三、如何导出结果Stata可以直接导出发表论文中回归结果,当然不是完全一样。
命令:outreg2 Results using name.word四、如何画图Stata的画图功能也是极其强大的,可以画出各种类型的图标。
命令:scatter y x || lfit y x五、如何存储结果Stata可以储存回归结果,便于分析。
命令:log using name log closed1.codebook可以查看数据有没有缺失2.xml_tab estout 可以输出结果3.qui tab year, gen(yr) 可以生产时间虚拟变量。
4.g q=quarterly( qtr,"YQ")5.form q %tq6.recode province (min/11=1) (12/19=2) (20/31=3)gen eastern=(province==1)gen middle=(province==2)gen western=(province==3)Logout 命令可以把界面内容存到word里面,而不用复制。
Logout,save(名称) word/excel replace:各种描述性命令,statsXml_tab可以输出Excel格式的结果。
STATA初级视频教程(2010版)使用说明连玉君(中山大学 岭南学院 金融系)arlionn@目 录1 课程简介 (1)2 课程特色 (2)3 课程配套资料 (2)4 配套资料的使用方法 (2)5 讨论和建议 (4)6 讲师介绍 (4)7 报名咨询 (4)8 培训优惠 (4)附录A:STATA初级视频目录(时间节点) (5)第一讲STATA简介 (5)第二讲数据处理 (9)第三讲Stata绘图 (13)第四讲矩阵操作 (16)第五讲STATA 编程初步 (18)附录B:STATA高级视频教程简介 (20)工欲善其事,必先利其器。
无论是经济学、管理学还是社会科学的其他学科,定量分析都变得越来越重要了。
作为一个较为年轻的计量软件,STATA自1985年问世以来,以其在数据处理、绘图、回归分析等方面的出色表现,赢得了越来越多的青睐。
然而,相比于SPSS、Eviews等以菜单操作为主的软件,以命令操作见长的STATA软件门槛相对较高。
由于进入国内的时间较短,相关的参考资料甚为有限,而STATA公司提供的近10000页的全英文使用手册更是令多数初学者望而生畏。
这也成为阻碍多数国内同仁学习这款功能强大的计量软件的主要障碍。
鉴于上述情况,我们分别于2007年11月和2008年10月推出了“STATA初级视频教程”和“STATA高级视频教程”,内容涉及STATA的基本操作、数据处理、绘图、编程、常用计量模型的估计,以及Bootstrap和Monte Carlo模拟等内容。
视频教学的直观性,加之课程的实用性导向,使这两套教程获得了广泛的好评。
承蒙广大STATA视频教程学员的积极参与和反馈,我在过去两年多的时间里收集到了100余条修改建议,历经半年多的制作,最终得以为大家呈现这套新版STATA初级视频——“STATA初级视频教程(2010版)”。
STATA初级视频教程(2010版)共5讲,包含36个视频文件,总计40余个学时。
Contentsintro............................................Introduction to base reference manual about............................................Display information about your Stata adoupdate................................................Update user-written ado-files ameans.....................................Arithmetic,geometric,and harmonic means anova.............................................Analysis of variance and covariance anova postestimation......................................Postestimation tools for anova areg..................................Linear regression with a large dummy-variable set areg postestimation........................................Postestimation tools for areg asclogit....................Alternative-specific conditional logit(McFadden’s choice)model asclogit postestimation..................................Postestimation tools for asclogit asmprobit...............................Alternative-specific multinomial probit regression asmprobit postestimation..............................Postestimation tools for asmprobit asroprobit..............................Alternative-specific rank-ordered probit regression asroprobit postestimation..............................Postestimation tools for asroprobit BIC note.............................................Calculating and interpreting BIC binreg........................Generalized linear models:Extensions to the binomial family binreg postestimation....................................Postestimation tools for binreg biprobit....................................................Bivariate probit regression biprobit postestimation..................................Postestimation tools for biprobit bitest.......................................................Binomial probability test bootstrap...........................................Bootstrap sampling and estimation bootstrap postestimation................................Postestimation tools for bootstrap boxcox..................................................Box–Cox regression models boxcox postestimation....................................Postestimation tools for boxcox brier......................................................Brier score decomposition bsample..................................................Sampling with replacement bstat........................................................Report bootstrap results centile...........................................Report centile and confidence interval ci...............................Confidence intervals for means,proportions,and counts clogit......................................Conditional(fixed-effects)logistic regression clogit postestimation......................................Postestimation tools for clogit plementary log-log regression cloglog postestimation..................................Postestimation tools for cloglog cls............................................................Clear Results window cnsreg...................................................Constrained linear regression cnsreg postestimation....................................Postestimation tools for cnsreg constraint..................................................Define and list constraints contrast..............................Contrasts and linear hypothesis tests after estimation contrast postestimation..................................Postestimation tools for contrast copyright...............................................Display copyright information copyright apache.........................................Apache copyright notification copyright boost............................................Boost copyright notification copyright freetype.......................................FreeType copyright notification copyright icu...............................................ICU copyright notification copyright jagpdf.........................................JagPDF copyright notificationiii Contentscopyright PACK copyright notification copyright libpng..........................................libpng copyright notification copyright miglayout..................................MiG Layout copyright notification copyright scintilla........................................Scintilla copyright notification copyright ttf2pt1..........................................ttf2pt1copyright notification copyright zlib..............................................zlib copyright notification correlate.............................Correlations(covariances)of variables or coefficients cumul.......................................................Cumulative distribution cusum........................................Cusum plots and tests for binary variables unch dialog diagnostic plots..........................................Distributional diagnostic plots display................................................Substitute for a hand calculator do....................................................Execute commands from afile doedit................................................Edit do-files and other textfiles parative scatterplots dstdize.............................................Direct and indirect standardization dydx........................................Calculate numeric derivatives and integrals eform option......................................Displaying exponentiated coefficients eivreg...................................................Errors-in-variables regression eivreg postestimation.....................................Postestimation tools for eivreg error messages.........................................Error messages and return codes esize............................................Effect size based on mean comparison estat........................................................Postestimation statistics estat classification......................................Classification statistics and table estat gof...............................Pearson or Hosmer–Lemeshow goodness-of-fit test estat ic...................................................Display information criteria estat summarize..........................................Summarize estimation sample estat vce...........................................Display covariance matrix estimates estimates........................................Save and manipulate estimation results estimates describe..........................................Describe estimation results estimates for..............................Repeat postestimation command across models estimates notes.........................................Add notes to estimation results estimates replay............................................Redisplay estimation results estimates save..........................................Save and use estimation results estimates stats...............................................Model-selection statistics estimates store.......................................Store and restore estimation results estimates pare estimation results estimates title............................................Set title for estimation results estimation options.................................................Estimation options exit.....................................................................Exit Stata exlogistic...................................................Exact logistic regression exlogistic postestimation................................Postestimation tools for exlogistic expoisson...................................................Exact Poisson regression expoisson postestimation...............................Postestimation tools for expoisson fp...................................................Fractional polynomial regression fp postestimation............................................Postestimation tools for fp frontier....................................................Stochastic frontier models frontier postestimation..................................Postestimation tools for frontier fvrevar.................................Factor-variables operator programming commandContents iiifvset..................................................Declare factor-variable settings gllamm......................................Generalized linear and latent mixed models glm.......................................................Generalized linear models glm postestimation........................................Postestimation tools for glm glogit......................................Logit and probit regression for grouped data glogit postestimation..............Postestimation tools for glogit,gprobit,blogit,and bprobit gmm........................................Generalized method of moments estimation gmm postestimation......................................Postestimation tools for gmm grmeanby..............................Graph means and medians by categorical variables hausman...................................................Hausman specification test heckman...................................................Heckman selection model heckman postestimation................................Postestimation tools for heckman heckoprobit.................................Ordered probit model with sample selection heckoprobit postestimation............................Postestimation tools for heckoprobit heckprobit.........................................Probit model with sample selection heckprobit postestimation..............................Postestimation tools for heckprobit help..........................................................Display help in Stata hetprobit.................................................Heteroskedastic probit model hetprobit postestimation................................Postestimation tools for hetprobit histogram.............................Histograms for continuous and categorical variables icc...................................................Intraclass correlation coefficients inequality.......................................................Inequality measures intreg...........................................................Interval regression intreg postestimation......................................Postestimation tools for intreg ivpoisson.................................Poisson regression with endogenous regressors ivpoisson postestimation................................Postestimation tools for ivpoisson ivprobit..............................Probit model with continuous endogenous regressors ivprobit postestimation..................................Postestimation tools for ivprobit ivregress................................Single-equation instrumental-variables regression ivregress postestimation................................Postestimation tools for ivregress ivtobit................................Tobit model with continuous endogenous regressors ivtobit postestimation....................................Postestimation tools for ivtobit jackknife.......................................................Jackknife estimation jackknife postestimation................................Postestimation tools for jackknife kappa..........................................................Interrater agreement kdensity...........................................Univariate kernel density estimation ksmirnov..............................Kolmogorov–Smirnov equality-of-distributions test kwallis.................................Kruskal–Wallis equality-of-populations rank test dder of powers level.....................................................Set default confidence level limits.....................................................Quick reference for limits lincom..............................................Linear combinations of estimators linktest.................................Specification link test for single-equation models lnskew0..................................Find zero-skewness log or Box–Cox transform log.....................................................Echo copy of session tofile logistic........................................Logistic regression,reporting odds ratios logistic postestimation....................................Postestimation tools for logistic logit..........................................Logistic regression,reporting coefficientsiv Contentslogit postestimation........................................Postestimation tools for logit rge one-way ANOV A,random effects,and reliability lowess..........................................................Lowess smoothing lpoly.......................................Kernel-weighted local polynomial smoothing pute area under ROC curve and graph the curve lrtest..............................................Likelihood-ratio test after estimation lsens............................Graph sensitivity and specificity versus probability cutoff lv.............................................................Letter-value displays margins.........................Marginal means,predictive margins,and marginal effects margins postestimation..................................Postestimation tools for margins margins,contrast................................................Contrasts of margins margins,pwcompare...................................Pairwise comparisons of margins marginsplot...............................Graph results from margins(profile plots,etc.) matsize................................Set the maximum number of variables in a model maximize.............................................Details of iterative maximization mean...............................................................Estimate means mean postestimation......................................Postestimation tools for mean meta................................................................Meta-analysis mfp.........................................Multivariable fractional polynomial models mfp postestimation........................................Postestimation tools for mfp misstable....................................................Tabulate missing values mkspline..................................Linear and restricted cubic spline construction ml...................................................Maximum likelihood estimation mlexp........................Maximum likelihood estimation of user-specified expressions mlexp postestimation.....................................Postestimation tools for mlexp mlogit......................................Multinomial(polytomous)logistic regression mlogit postestimation....................................Postestimation tools for mlogit more........................................................The—more—message mprobit.................................................Multinomial probit regression mprobit postestimation..................................Postestimation tools for mprobit nbreg...................................................Negative binomial regression nbreg postestimation............................Postestimation tools for nbreg and gnbreg nestreg.......................................................Nested model statistics net............................Install and manage user-written additions from the Internet net search....................................Search the Internet for installable packages netio....................................................Control Internet connections news.............................................................Report Stata news nl.................................................Nonlinear least-squares estimation nl postestimation............................................Postestimation tools for nl nlcom............................................Nonlinear combinations of estimators nlogit........................................................Nested logit regression nlogit postestimation......................................Postestimation tools for nlogit nlsur......................................Estimation of nonlinear systems of equations nlsur postestimation......................................Postestimation tools for nlsur nptrend............................................Test for trend across ordered groups ologit....................................................Ordered logistic regression ologit postestimation......................................Postestimation tools for ologit oneway.................................................One-way analysis of variance oprobit.....................................................Ordered probit regressionContents v oprobit postestimation....................................Postestimation tools for oprobit orthog........................Orthogonalize variables and compute orthogonal polynomials pcorr......................................Partial and semipartial correlation coefficients permute................................................Monte Carlo permutation tests pk...........................................Pharmacokinetic(biopharmaceutical)data pkcollapse................................Generate pharmacokinetic measurement dataset pkcross................................................Analyze crossover experiments pkequiv.................................................Perform bioequivalence tests pkexamine.........................................Calculate pharmacokinetic measures pkshape....................................Reshape(pharmacokinetic)Latin-square data pksumm.............................................Summarize pharmacokinetic data poisson..........................................................Poisson regression poisson postestimation..................................Postestimation tools for poisson predict................................Obtain predictions,residuals,etc.,after estimation predictnl..................Obtain nonlinear predictions,standard errors,etc.,after estimation probit.............................................................Probit regression probit postestimation......................................Postestimation tools for probit proportion......................................................Estimate proportions proportion postestimation..............................Postestimation tools for proportion prtest..........................................................Tests of proportions pwcompare.....................................................Pairwise comparisons pwcompare postestimation............................Postestimation tools for pwcompare pwmean...............................................Pairwise comparisons of means pwmean postestimation..................................Postestimation tools for pwmean qc............................................................Quality control charts qreg............................................................Quantile regression qreg postestimation...................Postestimation tools for qreg,iqreg,sqreg,and bsqreg query.....................................................Display system parameters ranksum.............................................Equality tests on unmatched data ratio...............................................................Estimate ratios ratio postestimation........................................Postestimation tools for ratio reg3.........................Three-stage estimation for systems of simultaneous equations reg3postestimation........................................Postestimation tools for reg3 regress...........................................................Linear regression regress postestimation....................................Postestimation tools for regress regress postestimation diagnostic plots......................Postestimation plots for regress regress postestimation time series............Postestimation tools for regress with time series #review...................................................Review previous commands roc.....................................Receiver operating characteristic(ROC)analysis roccomp...............................................Tests of equality of ROC areas rocfit........................................................Parametric ROC models rocfit postestimation......................................Postestimation tools for rocfit rocreg.................................Receiver operating characteristic(ROC)regression rocreg postestimation....................................Postestimation tools for rocreg rocregplot.....................Plot marginal and covariate-specific ROC curves after rocreg roctab...................................................Nonparametric ROC analysis rologit................................................Rank-ordered logistic regression rologit postestimation....................................Postestimation tools for rologit rreg..............................................................Robust regressionvi Contentsrreg postestimation........................................Postestimation tools for rreg runtest.......................................................Test for random order scobit.....................................................Skewed logistic regression scobit postestimation......................................Postestimation tools for scobit sdtest.....................................................Variance-comparison tests search...................................Search Stata documentation and other resources serrbar................................................Graph standard error bar chart set....................................................Overview of system parameters set cformat........................................Format settings for coefficient tables set defaults............................Reset system parameters to original Stata defaults set emptycells.............................Set what to do with empty cells in interactions set seed....................................Specify initial value of random-number seed set showbaselevels..................................Display settings for coefficient tables signrank...............................................Equality tests on matched data simulate....................................................Monte Carlo simulations sj........................................Stata Journal and STB installation instructions sktest.........................................Skewness and kurtosis test for normality slogit..................................................Stereotype logistic regression slogit postestimation......................................Postestimation tools for slogit smooth...................................................Robust nonlinear smoother spearman........................................Spearman’s and Kendall’s correlations spikeplot..................................................Spike plots and rootograms ssc...........................................Install and uninstall packages from SSC stem.........................................................Stem-and-leaf displays stepwise........................................................Stepwise estimation stored results.........................................................Stored results suest..................................................Seemingly unrelated estimation summarize.......................................................Summary statistics sunflower..........................................Density-distribution sunflower plots sureg..........................................Zellner’s seemingly unrelated regression sureg postestimation......................................Postestimation tools for sureg swilk..............................Shapiro–Wilk and Shapiro–Francia tests for normality symmetry....................................Symmetry and marginal homogeneity tests table..............................................Flexible table of summary statistics pact table of summary statistics tabulate oneway..........................................One-way table of frequencies tabulate twoway..........................................Two-way table of frequencies tabulate,summarize().......................One-and two-way tables of summary statistics test.............................................Test linear hypotheses after estimation testnl.........................................Test nonlinear hypotheses after estimation tetrachoric...................................Tetrachoric correlations for binary variables tnbreg..........................................Truncated negative binomial regression tnbreg postestimation....................................Postestimation tools for tnbreg tobit..............................................................Tobit regression tobit postestimation........................................Postestimation tools for tobit total................................................................Estimate totals total postestimation........................................Postestimation tools for total tpoisson.................................................Truncated Poisson regression tpoisson postestimation..................................Postestimation tools for tpoisson translate......................................................Print and translate logsContents vii truncreg........................................................Truncated regression truncreg postestimation..................................Postestimation tools for truncreg ttest...................................................t tests(mean-comparison tests) update.....................................................Check for official updates vce option.......................................................Variance estimators view............................................................Viewfiles and logs vwls.................................................Variance-weighted least squares vwls postestimation........................................Postestimation tools for vwls which......................................Display location and version for an ado-file xi............................................................Interaction expansion zinb.........................................Zero-inflated negative binomial regression zinb postestimation........................................Postestimation tools for zinb zip..................................................Zero-inflated Poisson regression zip postestimation..........................................Postestimation tools for zip Author index..................................................................... Subject index.....................................................................。
年0606月月0101日,日,日,200820082008年第年第年第44期,总第期,总第66期编者按:Stata 的数据管理能力非常powerful ,而我们EpiMan 论坛上有很多优秀的帖子,我们会不定期对其进行整理,以期使得大家可以更好地掌握Stata 软件,提高工作和学习的效率和乐趣。
毕竟,Stata 是一款巨有特色的统计软件包,推荐使用。
我常用到的Stata命令by 无为而治的西瓜与西瓜老死不相往来Special IssueFundamental of Data ManipulationUsing Stata EpiMan Cluster特刊:我常用到的Stata命令Special Issue我常用到的Stata命令文章作者:无为而治的西瓜与西瓜老死不相往来本期主编:epiman本期审校:epiman本期排版:epiman2008年06月01日2008年第4期总第6期邮箱:epiman@ 网址:目录第一讲,do文件的穿靴戴帽第二讲,原始数据→分析数据第三讲,批量生成虚拟变量第四讲,改变数据结构第五讲,复杂数据处理技巧--迂回 第六讲,本期声明和好汉招募第一讲,help和search的区别以及do文件的穿靴戴帽第一讲,help和search的区别以及do文件的穿靴戴帽作者:无为而治的西瓜与西瓜老死不相往来@最重要的两个命令莫过于help和search了。
即使是经常使用stata的人也很难,也没必要记住常用命令的每一个细节,更不用说那些不常用到的了。
所以,在遇到困难又没有免费专家咨询时,使用stata自带的帮助文件就是最佳选择。
stata的帮助文件十分详尽,面面俱到,这既是好处也是麻烦。
当你看到长长的帮助文件时,是不是对迅速找到相关信息感到没有信心?闲话不说了。
help和search都是查找帮助文件的命令,它们之间的区别在于help用于查找精确的命令名,而search是模糊查找。
如果你知道某个命令的名字,并且想知道它的具体使用方法,只须在stata的命令行窗口中输入help空格加上这个名字。