首页> 学术问答> 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 是一套提供其使用者数据分析、数据管理以及绘制专业图表的完整及整合性统计软件。它提供许许多多功能,包含线性混合模型、均衡重复反复及多项式普罗比模式
以上是一些小的基本技巧,同学如果需要系统的老师的详细辅导可以联系我们哦~
相关问答
最新问答
英国毕业论文选题不合适可以修改吗?
你好,我在英国读本科,最近在准备毕业论文,我之前定了一个论文题目,但是研究过程中发现和我最初的设想有一些出入,所以想改一下选题,请问我能改吗?
考而思2024-05-16密歇根州立大学毕业论文写不完可以申请延期吗?如何申请?
我在密歇根州立大学,快到提交毕业论文的时间了,但是我还有很大一部分内容没来得及写,因为前面耽误了一些时间,导致现在没办法按时完成,请问毕业论文写不完可以申请延期吗?如何申请?
考而思2024-05-16华威大学供应链与物流管理课程预习哪些内容?
我过段时间要去华威大学读硕士,专业是供应链与物流管理,想问一下如果现在预习的话,应该预习哪些内容?怎么预习?希望老师能指导预习,感谢。
考而思2024-05-16