常用命令
** do-file general tting
clear
t memory 100m
t matsize 800
t more off
** open a existed file
u "E:\stata上机\earn.dta", clear
** draw a picture
春天的魅力plot annearn year
** creat a new variable
ge age2=age^2
** create a log file
capture log using E:\stata上机\jiliang001, replace ……
log clo
** usual regressions
fit hrearn exper
reg hrearn exper
predict newname,xb
** panel regression
u "E:\stata上机\INVEST.DTA", clear
sort company time
iis company
tis time
xtreg invest market stock
脚踏实地xi: xtreg invest market stock i.time, fe
est store jil002
xi: xtreg invest market stock i.time, re
hausman jil002
**if refud, then Random effect model cannot be chood. ** display the statistics value
su
list invest in 1/20
tab company
怎么调饺子馅
dis (304-13)*0.2399
ge a=chi2(26,35.64)
dis a
** merge data
u "E:\stata上机\example.dta", clear
guoqing
sort x
merge x using E:\stata上机\example2.dta
sort x
drop _merge
** define/modify a variable
ge xsqr=x^2
drop if x==110
rename time t
** define/modify a function
技的成语
egen avfmsize=mean(firmsize), by(year)
青皮的功效egen avindqyr=sd(avindoutput) if avindoutput~=., by(year) ** other regular operation美丽的颜色
do jil001
cd ..
cd c:
cd E:\stata上机\
ls
** save the data车间安全注意事项
u "E:\stata上机\INVEST.DTA", clear
keep if time<=15
collap invest market, by(time)
save c:\projects\firmsize\datafile\firm_90.dta, replace