今天看啥  ›  专栏  ›  数量经济学

Stata:时间序列教程

数量经济学  · 公众号  ·  · 2024-07-30 22:34

文章预览

来源:综合整理自:http://dss.princeton.edu/training/ 转载请注明来源 本文主要包括数据类型转换、自相关图、平稳性、协整、格兰杰检验等内容 1 From daily/monthly date variable to quarterly 1、Quarterly date from daily date  导入数据,查看数据 use date.dta desc ed 可以发现Date2 is a string date variable 然后进行转换 gen datevar=date(date2,"MDY", 2099) format datevar %td gen quarterly = qofd(datevar) format quarterly %tq 2、Quarterly date from monthly date  gen month = month(datevar) gen day=day(datevar) gen year=year(datevar) gen monthly = ym(year,month) format monthly %tm     结果为: 2 From daily to weekly and getting yearly gen datevar = date(date2, "MDY", 2099) format datevar %td gen year= year(datevar) gen w = week(datevar) gen weekly = yw(year,w) format weekly %tw  browse  结果为:  From daily to yearly  gen  year1 = year(datevar)  From quarterly to yearly  gen year2 = yofd( ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照
总结与预览地址:访问总结与预览