同理,Stata 还提供了其他时期函数(Date and time functions)用于帮助我们获得其他日期数据对应的数值,这些数值对于开展某些研究而言可能是有用的,这里仅关注常规的时期数据(即“年-月-日”)。 代码语言:javascript 代码运行次数:0 运行 AI代码解释 dimdy(12,31,1959)*-1dimdy(1,1,1960)*0dimdy(1,3,1960)*...
dateofbirth str9 %9s Date of birth reason str15 %15s Reason for visit admit_d str8 %9s Admission date admit_t str17 %17s Admission date and time discharge_d str9 %9s Discharge date discharge_t str14 %14s Discharge date and time --- Sorted by: */ list admit_d dateofbirth /* +...
这里date就是一个长的字符串日期了。接着还是转换+格式化。 更多转换函数和日期格式,可参考Stata相关帮助文件。 References StataDate and time functions帮助文件
此外,你还可以使用时间序列分析命令(如tsline、tsset等)来处理和分析时间序列数据。 额外资源 为了更深入地了解Stata处理日期数据的方法,你可以参考以下资源: Stata官方文档:Date and Time Functions 自定义命令datedv的详细实现和用法:链接(提取码:1234) 希望这些解答能帮助你更好地在Stata中处理日期数据!
反之,对于分列的字符型日期变量,直接生成新变量,用+连接分开的变量即可。比如: gen date = year + month + day 这里date就是一个长的字符串日期了。接着还是转换+格式化。 更多转换函数和日期格式,可参考Stata相关帮助文件。 References StataDate and time functions帮助文件 ---全文结束---...
Stata日期和时间处理指南说明书 in Stata Gabriela Ortiz Applied Econometrician StataCorp LLC 1
StataCorp. 2023.Stata 18 Functions Reference Manual. College Station, TX: Stata Press. Download » Table of contents IntroIntroduction to functions reference manual Functions by category Functions by name Date and time functions Mathematical functions ...
mata setSet and display Mata system parameters mata stataExecute Stata command mata whichIdentify function namelistsSpecifying matrix and function names [M-4] Categorical guide to Mata functions IntroCategorical guide to Mata functions DatesDate and time functions ...
New date and time functions Stata 17 adds a plethora of date and time convenience functions in three main areas: Datetime durations, such as ages Relative dates, such as the next birthday relative to a reference date Datetime components, functions that extract various components from datetime value...
Date functions date functions Time-series functions time-series functions Matrix functions matrix functions 弹出来的对话框告诉我们,STATA包括八类函数,分别是数学函数,分布函数,随机数函数,字符函数,程序函数,日期函数,时间序列函数和矩阵函数。本章主要介绍数学函数和字符函数,其他函数将在后面相应的章节介绍。 常用...