📄 tsappend.hlp
字号:
{smcl}
{* 08mar2005}{...}
{cmd:help tsappend}{right:dialog: {bf:{dialog tsappend}}}
{hline}
{title:Title}
{p2colset 5 22 24 2}{...}
{p2col :{hi:[TS]} tsappend {hline 2}}Add observations to a time-series dataset{p_end}
{p2colreset}{...}
{title:Syntax}
{p 8 17 2}
{cmd:tsappend}{cmd:,} {opt add(#)} {opt last(date)}
{opt tsfmt(string)} [{it:options}]
{synoptset tabbed}{...}
{synopthdr:options}
{synoptline}
{p2coldent:* {opt add(#)}}add specific number of observations{p_end}
{p2coldent:* {opt last(date)}}add observations at {it:date}{p_end}
{p2coldent:* {opt tsfmt(string)}}use time-series function {it:string} with
{opt last(date)}{p_end}
{synopt :{opt panel(panel_id)}}add observations to panel {it:panel_id}{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}* Either {opt add(#)} is required, or {opt last(date)} and
{opt tsfmt(string)} are required.{p_end}
{p 4 6 2}You must {helpb tsset} your data before using {cmd:tsappend}.
{title:Description}
{pstd}
{cmd:tsappend} appends observations to a time-series dataset or to a
panel dataset. {cmd:tsappend} uses and updates the information set by
{cmd:tsset}.
{title:Options}
{phang}
{opt add(#)} specifies the number of observations to add.
{phang}
{opt last(date)} and {opt tsfmt(string)} must be specified together and are an
alternative to {opt add()}.
{pmore}
{opt last(date)} specifies the date of the last observation to add.
{pmore}
{opt tsfmt(string)} specifies the name of the Stata time-series
function to use in converting the date specified in {opt last()} to an
integer. The function names are {cmd:d} (daily), {cmd:w} (weekly), {cmd:m}
(monthly), {cmd:q} (quarterly), {cmd:y} (yearly), and {cmd:h} (half-yearly).
{pmore}
For instance, you might specify {bind:{cmd:last(17may2004)}} {cmd:tsfmt(d)} or
{bind:{cmd:last(2001m1)} {cmd:tsfmt(m)}}
{phang}
{opt panel(panel_id)} specifies that observations be added only to panels with
the ID specified in {opt panel()}.
{title:Examples}
{pstd}
The following example shows how to add extra observations before
dynamically predicting from an AR(1) regression.
{p 8 12 2}{cmd:. tsset t2}{p_end}
{p 8 12 2}{cmd:. regress y l.y}{p_end}
{p 8 12 2}{cmd:. tsappend, add(12)}{p_end}
{p 8 12 2}{cmd:. predict CB}{p_end}
{pstd}
Instead of adding 12 observations, we can also fill in observations
through a certain date, say the first month of 2001. The {cmd:tsfmt(m)}
option specifies the date function {cmd:m()} for monthly data.
{p 8 12 2}{cmd:. tsappend, last(2001m1) tsfmt(m)}{p_end}
{title:Also see}
{psee}
Manual: {bf:[TS] tsappend}{p_end}
{psee}
Online: {helpb egen}, {helpb generate}, {helpb tsset}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -