📄 mf_st_tsrevar.hlp
字号:
{smcl}
{* 23mar2005}{...}
{cmd:help mata st_tsrevar()}
{hline}
{* index stata time-series operated variable}{...}
{* index st_tsrevar()}{...}
{title:Title}
{p 4 4 2}
{bf:[M-5] st_tsrevar() -- Create time-series op.varname variables}
{title:Syntax}
{p 8 12 2}
{it:real rowvector}
{cmd:st_tsrevar(}{it:string rowvector s}{cmd:)}
{title:Description}
{p 4 4 2}
{cmd:st_tsrevar(}{it:s}{cmd:)} is the equivalent of Stata's
{bf:{help tsrevar:[TS] tsrevar}} programming command: It generates temporary
variables containing the evaluation of any {it:op}{cmd:.}{it:varname}
combinations appearing in {it:s}.
{title:Remarks}
{p 4 4 2}
In {it:s} you have a rowvector of
Stata variable names, some of which might contain
time-series {it:op}{cmd:.}{it:varname} combinations (such as {cmd:l.gnp}).
Say {it:s} contains
{it:s} = {cmd:("gnp", "r", "l.gnp")}
{p 4 4 2}
You want to create a view of the data in {it:V}, but you cannot code
{cmd:st_view(}{it:V}{cmd:, .,} {it:s}{cmd:)}
{p 4 4 2}
because {bf:{help mf_st_view:[M-5] st_view()}} does not allow time-series
operated variables. The solution is to code
{cmd:st_view(}{it:V}{cmd:, ., st_tsrevar(}{it:s}{cmd:))}
{p 4 4 2}
{cmd:st_tsrevar()} will create temporary variables for each
{it:op}{cmd:.}{it:varname}
combination ({cmd:l.gnp} in our example), and then return the
Stata variable indices of each of the variables, whether newly created
or already existing. For instance, in the example above, let us assume
that {cmd:gnp} is the 2nd variable in the dataset, {cmd:r} the 23rd, and that,
in total, there are 54 variables. Returned by {cmd:st_tsrevar()} will be (2,
23, 55). Variable 55 is new, created by {cmd:st_tsrevar()}, and it
contains the values of {cmd:l.gnp}.
{title:Conformability}
{cmd:st_tsrevar(}{it:s}{cmd:)}:
{it:s}: 1 {it:x c}
{it:result}: 1 {it:x c}
{title:Diagnostics}
{p 4 4 2}
{cmd:st_tsrevar()} aborts with error if any variable name is not found
or any {it:op}{cmd:.}{it:varname} combination is invalid.
{title:Source code}
{p 4 4 2}
Function is built-in.
{title:Also see}
{p 4 13 2}
Manual: {hi:[M-5] st_tsrevar()}
{p 4 13 2}
Online: help for
{bf:{help mf_st_varname:[M-5] st_varname()}};
{bf:{help m4_stata:[M-4] stata}}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -