⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tdates.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 05apr2005}{...}
{cmd:help tdates}
{hline}

{title:Title}

{pstd}
{hi:[U] 24.3 Time-series dates}


{title:Remarks}

{pstd}
In addition to {cmd:%d} date formats (see {help dates}) Stata has five
other date formats it understands:

{p 8 39 2}Format {space 1} Description {space 9} Coding{p_end}
	{hline}
{p 8 39 2}{cmd:%td} {space 4} daily (same as {cmd:%d}) {space 2} 0 = 01jan1960, 1 = 02jan1960{p_end}
{p 8 39 2}{cmd:%tw} {space 4} weekly {space 14} 0 = 1960w1, {space 2} 1 = 1960w2{p_end}
{p 8 39 2}{cmd:%tm} {space 4} monthly {space 13} 0 = 1960m1, {space 2} 1 = 1960m2{p_end}
{p 8 39 2}{cmd:%tq} {space 4} quarterly {space 11} 0 = 1960q1, {space 2} 1 = 1960q2{p_end}
{p 8 39 2}{cmd:%th} {space 4} halfyearly {space 10} 0 = 1960h1, {space 2} 1 = 1960h2{p_end}
{p 8 39 2}{cmd:%ty} {space 4} yearly {space 14} 1960 = 1960, {space 1} 1961 = 1961{p_end}
	{hline}
{p 8 8 2}Note:  times before 1960 are allowed.  For instance, -1 means
31dec1959 in {cmd:%td} format and 1959q4 in {cmd:%tq} format.


{pstd}
In any of these formats, if you subtract two dates (meaning the corresponding
integers), you obtain the number of units between them; for example,

{p 8 16 2}01feb1960 - 02jan1960 {space 1} = 31-1 {space 8} =  30 days

{p 8 16 2}2005w32 - 1983w5 {space 6} = 2371 - 1200 {space 1} =  1171 weeks

{p 8 16 2}1980m5 - 1978m4 {space 7} = 244 - 219 {space 3} =  25 months

{p 8 16 2}1985q3 - 1960q2 {space 7} = 102 - 2 {space 5} =  100 quarters

{p 8 16 2}2002h2 - 2000h1 {space 7} = 85 - 80 {space 5} =  5 half years

{p 8 16 2}1999 - 1978 {space 11} = 1999 - 1978 {space 1} =  21 years

{pstd}
Stata provides functions to convert from one format to another and other
functions to manipulate time-series dates.  These date functions are
sometimes called the time-series date functions because they are often used
with time-series data.  See

{p2colset 9 20 22 2}{...}
{p2col :{help dlyfcns}}Inputting dates (translating dates from strings){p_end}
{p2col :{help ywfcns}}Creating dates from year and week, year and quarter, ... {p_end}
{p2col :{help tfcn}}Typing fixed dates in expressions{p_end}
{p2col :{help dcfcns}}Converting between {cmd:%t} date formats{p_end}
{p2col :{help dexfcns}}Extracting month, day, year, etc., from a date{p_end}
{p2col :{help tfmt}}Details of the {cmd:%t} format{p_end}
{p2col :{help tinfcn}}Selecting time spans of data{p_end}

{p2col :{help dates}}Stata's base date format{p_end}


{pstd}
Note:  after creating a date variable, use the {helpb format} command to
place the appropriate {cmd:%t} format on the variable.

{phang2}{cmd:. generate mydate = quarterly(}{it:...}{cmd:)}{p_end}
{phang2}{cmd:. format mydate %tq}

{phang2}{cmd:. generate mydate = weekly(}{it:...}{cmd:)}{p_end}
{phang2}{cmd:. format mydate %tw}


{title:Also see}

{psee}
Manual:  {bf:[U] 12.5.4 Time-series formats},{break}
{bf:[U] 24 Dealing with dates},{break}
{bf:[U] 24.3 Time-series dates}

{psee}
Online:  {help dates}; {helpb format}; {help time};
{help dcfcns},
{help dexfcns},
{help dlyfcns},
{help tfcn},
{help tfmt},
{help tinfcn},
{help ywfcns}
{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -