分享

计量经济学服务中心十八讲之108个常用命令

 兵王兵 2017-10-27 发布于北京



本文由计量经济学服务中心编辑整理,转载请注明出处。下面命令按照重要程度以及相关分析方法步骤等依次列出。


Some useful Stata commands


help : online help on a specific command

findit : online references on a keyword or topic

ssc : access routines from the SSC Archive

pwd : print the working directory

cd : change the working directory

log : log output to an external file

tsset : define the time indicator for timeseries or panel data

compress : economize on space used by variables

clear : clear memory

quietly : do not show the results of a command

update query : see if Stata is up to date

adoupdate : see if user-written commands are up to date

exit : exit the program (,clear if dataset is not saved)


 Data manipulation commands


generate : create a new variable

describe : describe a data set or current contents of memory

replace : modify an existing variable

rename : rename variable

renvars : rename a set of variables

sort : change the sort order of the dataset

drop : drop certain variables and/or observations

keep : keep only certain variables and/or observations

append : combine datasets by stacking

merge : merge datasets (one-to-one or match merge)

encode : generate numeric variable from categorical variable

recode : recode categorical variable

destring : convert string variables to numeric

foreach : loop over elements of a list, performing a block of code

forvalues : loop over a numlist, performing a block of code

local : define or modify a local macro (scalar variable)


use : load a Stata data set

save : write the contents of memory to a Stata data set

insheet : load a text file in tab- or comma-delimited format

infile : load a text file in space-delimited format or as defined in a

dictionary

outfile : write a text file in space- or comma-delimited format

outsheet : write a text file in tab- or comma-delimited format

contract : make a dataset of frequencies

collapse : make a dataset of summary statistics

tab : abbreviation for tabulate: 1- and 2-way tables

table : tables of summary statistics


Statistical commands


summarize : descriptive statistics

correlate : correlation matrices

ttest : perform 1-, 2-sample and paired t-tests

anova : 1-, 2-, n-way analysis of variance

regress : least squares regression

predict : generate fitted values, residuals, etc.

test : test linear hypotheses on parameters

lincom : linear combinations of parameters

cnsreg : regression with linear constraints

testnl : test nonlinear hypothesis on parameters

margins : marginal effects (elasticities, etc.)

ivregress : instrumental variables regression

prais : regression with AR(1) errors

sureg : seemingly unrelated regressions

reg3 : three-stage least squares

qreg : quantile regression



Limited dependent variable estimation commands


logit, logistic : logit model, logistic regression

probit : binomial probit model

tobit : one- and two-limit Tobit model

cnsreg : Censored normal regression (generalized Tobit)

ologit, oprobit : ordered logit and probit models

mlogit : multinomial logit model

poisson : Poisson regression

heckman : selection model


 Time series estimation commands


arima : Box–Jenkins models, regressions with ARMA errors

arfima : Box–Jenkins models with long memory errors

arch : models of autoregressive conditional heteroskedasticity

dfgls : unit root tests

corrgram : correlogram estimation

var : vector autoregressions (basic and structural)

irf : impulse response functions, variance decompositions

vec : vector error–correction models (cointegration)

sspace : state-space models

dfactor : dynamic factor models

ucm : unobserved-components models

rolling: prefix permitting rolling or recursive estimation over subsets


 Panel data estimation commands


xtreg,fe : fixed effects estimator

xtreg,re : random effects estimator

xtgls : panel-data models using generalized least squares

xtivreg : instrumental variables panel data estimator

xtlogit : panel-data logit models

xtprobit : panel-data probit models

xtpois : panel-data Poisson regression

xtgee : panel-data models using generalized estimating equations

xtmixed : linear mixed (multi-level) models

xtabond : Arellano-Bond dynamic panel data estimator

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多