首页> 学术问答> STATA怎么用?希望有老师可以系统的辅导一下
STATA怎么用?希望有老师可以系统的辅导一下
最佳答案
课程顾问-小管家
2023-04-19 22:08:53
stata基本知识:
1、基本操作 :
(1)窗口锁定:Edit-preferences-general preferences-windowing-lock splitter
(2)数据导入;
(3)打开文件:use E:\example.dta,clear
(4)日期数据导入:
gen newvar=date(varname, “ymd”) format newvar %td 年度数据
gen newvar=monthly(varname, “ym”) format newvar %tm 月度数据
gen newvar=quarterly(varname, “yq”) format newvar %tq 季度数据
(5)变量标签 :
Label variable tc ` “total output” ’
(6)审视数据:
describe
list x1 x2
list x1 x2 in 1/5
list x1 x2 if q>=1000
drop if q>=1000
keep if q>=1000
(7)考察变量的统计特征:
summarize x1
su x1 if q>=10000
su q,detail
su
tabulate x1
correlate x1 x2 x3 x4 x5 x6
(8)画图 :
histogram x1, width(1000) frequency
kdensity x1
scatter x1 x2
twoway (scatter x1 x2) (lfit x1 x2)
twoway (scatter x1 x2) (qfit x1 x2)
(9)生成新变量:
gen lnx1=log(x1)
gen q2=q^2
gen lnx1lnx2=lnx1*lnx2
gen larg=(x1>=10000)
rename larg large
drop large
g large=(q>=6000)
replace large=(q>=6000) drop ln*
(10)计算功能:
display log(2)
(11)线性回归分析:
regress y1 x1 x2 x3 x4
vce #显示估计系数的协方差矩阵
reg y1 x1 x2 x3 x4,noc #不要常数项
reg y1 x1 x2 x3 x4 if q>=6000
reg y1 x1 x2 x3 x4 if large
reg y1 x1 x2 x3 x4 if large==0
reg y1 x1 x2 x3 x4 if ~large
predict yhat
predict e1,residual
display 1/_b[x1]
test x1=1 # F检验,变量x1的系数等于1
test (x1=1) (x2+x3+x4=1) # F联合假设检验
test x1 x2 #系数显著性的联合检验
testnl _b[x1]= _b[x2]^2
(12)约束回归 :
constraint def 1 x1+x2+x3=1
cnsreg y1 x1 x2 x3 x4,c(1)
cons def 2 x4=1
cnsreg y1 x1 x2 x3 x4,c(1-2)
(13)stata的日志 :
File-log-begin-输入文件名
log off 暂时关闭
log on 恢复使用
log close 彻底退出
(14)stata命令库更新 :
Update all help command
Stata 是一套提供其使用者数据分析、数据管理以及绘制专业图表的完整及整合性统计软件。它提供许许多多功能,包含线性混合模型、均衡重复反复及多项式普罗比模式
以上是一些小的基本技巧,同学如果需要系统的老师的详细辅导可以联系我们哦~
相关问答
最新问答

英国全球治理论文可以安排到老师补习指导吗?
急求一名可以辅导英国UCL全球治理论文的老师,希望老师能负责一些,我有好多的问题想请教老师,老师知识渊博再好不过了,能给我提供越多的思路越好。
考而思2025-11-27
英国林肯大学BA (Hons) Business and Finance商务与金融专业能补习课程吗?
英国林肯大学BA (Hons) Business and Finance商务与金融专业能补习课程吗,我目前是大一,有一部门的课程想补习一下,就是我有不会的,就能找老师补习哪部分最好
考而思2025-11-18
英国读研挂科了怎么办?是不是就不能毕业了呢?
英国读研挂科了怎么办?会不会就不能毕业了?什么情况下会影响我的毕业啊,我总感觉我有一门课程会挂,自己本身也没有学好,明天考试注定了...挂科了怎么办?
考而思2025-11-18