留学生课程辅导

STATA怎么用?希望有老师可以系统的辅导一下

2022-01-05 11:09:23来源:考而思在线阅读量:188

摘要

STATA怎么用?希望有老师可以系统的辅导一下考而思在线回答点击联系老师获取帮助stata基本知识:1、基本操作:(1)窗口锁定:Edit-preferences-generalpreferences-windowing-locksplitter(2)数据导入;(3)打开文件:useE:\example.dta,clear(4)日期数据导入:gennewvar=date(varname,“ymd”

STATA怎么用?希望有老师可以系统的辅导一下

考而思在线回答 点击联系老师获取帮助

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

是一套提供其使用者数据分析、数据管理以及绘制专业图表的完整及整合性统计软件。它提供许许多多功能,包含线性混合模型、均衡重复反复及多项式普罗比模式

以上是一些小的基本技巧,同学如果需要系统的老师的详细辅导可以联系我们哦~

当前文章链接:

凡来源标注“考而思”均为考而思原创文章,版权均属考而思教育所有,任何媒体、网站或个人不得转载,否则追究法律责任

留学生辅导

定制课程

电话咨询

400-640-8558

客服微信

在线客服