Command Reference : Function Reference : Function Reference: A
  
Function Reference: A
 
@abs
abs
@acos
@addinspath
@addquotes
@after
@asc
@asin
@atan
@attrnames
@attrvals
@abs Absolute value.
abs Absolute value.
@acos Arc cosine (in radians).
@addinspath EViews add-ins directory path.
@addquotes Enclose string in quotation marks.
@after Indicators for whether observation postdates a date.
@asc ASCII value of character.
@asin Arc sin (in radians).
@atan Arc tangent (in radians).
@attrnames Attribute names in workfile page.
@attrvals Attribute values in workfile page.
@abs
Absolute value.
Syntax: @abs(x)
x: number
Return: number
Examples
= @abs(-3)
returns 3.
Cross-references
See also abs.
abs
Absolute value.
Syntax: abs(x)
x: number
Return: number
Examples
= abs(-3)
returns 3.
Cross-references
See also @abs.
@acos
Arc cosine.
Compute the arc cosine (in radians) of x.
Syntax: @acos(x)
x: number
Return: number
Examples
= @acos(1)
returns 0.
Cross-references
See also @asin, @atan, @cos, @sin, and @tan.
@addinspath
Path of the EViews add-ins directory.
Syntax: @addinspath
Return: string
Returns a string containing the EViews add-ins directory path.
Examples
If your currently add-ins path is “d:\eviews\add_ins”, then
%y = @addinspath
assigns a string of the form “D:\EVIEWS\ADD_INS”.
Cross-references
See also @evpath and @temppath.
@addquotes
Enclose string in quotation marks.
Syntax: @addquotes(str)
str: string, alpha, svector
Return: string, alpha, svector
Returns the contents of the string in str with double-quotation marks added to both the left and the right.
Examples
Define the string object
string s1 = "Chicken Marsala"
so that S1 contains the unquoted string “Chicken Marsala”.
Then the commands
string sq1 = """Chicken Marsala"""
string sq2 = @addquotes(s1)
create SQ1 and SQ2 which both contain the quoted string “"Chicken Marsala"”. The first command uses the double-quote escape sequence “""” to add the double-quotes. The latter command uses the function.
If ALPHSER is an alpha series, the command
alpha a1 = @addquotes(ALPHSER)
fills A1 with double-quoted values of ALPHSER for each observation in the workfile sample.
If AVEC is an svector, the commands
svector as1 = @addquotes(avec)
svector as2 = @addquotes(avec.@rows(@range(1, 3))
create svectors AS1 and AS2, where AS1 contains double-quoted values of AVEC, and AS2 contains double-quoted values of the first three rows of AVEC.
Cross-references
See also @stripquotes.
@after
Indicator series for whether an observation postdates a given date.
Syntax: @after(d)
d: string, alpha
Return: series
Returns a series containing indicators for whether each observation postdates the corresponding date d.
For dates d that are of equal or lower frequency than the observation, the results are (0, 1) indicators of whether the observation is on or after the beginning of d.
For dates d that are of higher frequency than the observation, the (0, n) results reflect the fraction of the observation on or after the beginning of d.
Examples
Suppose that we have a quarterly workfile with data from 2020q1 to 2022q4 that we create with the command:
workfile q 2020 2022
The command
series after_y = @after("2021")
uses a lower-frequency “yearly” date to creates the series AFTER_Y containing the value 1 from 2021q1 through the end of the workfile, and 0 elsewhere.
Using a “quarterly” date,
series after_q = @after("2021q3")
creates the series AFTER_Q containing the value 1 beginning in 2021q3 through the end of the workfile, and 0 elsewhere.
The command using a higher frequency “monthly” date
series after_m = @after("2021m5")
generates the series AFTER_M containing the value 0 from 2020q1 through 2021q1, a fractional value for 2021q2, and the value 1 from 2021q3 through the end of the data.
For the fractional 2021q2 value, there are 61 days in 2021-May and 2021-June that are after the beginning of the “2021m5” date and 91 days in the full quarter, so the fractional value for 2021q2 is 61/91 = 0.67033.
Cross-references
See also @before and @during.
@asc
String to ASCII value.
Syntax: @asc(str)
str: string
Return: string
Returns the integer ASCII value for the first character in the string str.
Examples
scalar s1 = @asc("C")
scalar s2 = @asc("c")
returns the scalars S1=67 and S2=99.
Cross-references
See also @chr.
@asin
Arc sine.
Compute the arc sine (in radians) of x.
Syntax: @asin(x)
x: number
Return: number
Examples
= @asin(1)
returns 1.57079... (radians).
Cross-references
See also @acos, @atan, @cos, @sin, and @tan.
@atan
Arc tangent.
Compute the arc tangent (in radians) of x.
Syntax: @atan(x)
x: number
Return: number
Examples
= @atan(1)
returns 0.78539... (radians).
Cross-references
See also @acos, @asin, @cos, @sin, and @tan.
@attrnames
Attribute names in workfile page.
Syntax: @attrnames(attr[, obj, opt])
attr: string
obj: (optional) string
opt: (optional) integer
Return: string
Returns a string list of all attribute names in the active workfile page that match the attr pattern and, optionally, whose object names also match the obj name pattern.
The attr is a space delimited list of attribute value patterns. The list may be made up of any number of names, or “?” (indicates any single character) or “*” (indicates any number of characters) patterns.
The obj list may be made up of any number of names, or “?” (indicates any single character) or “*” (indicates any number of characters) patterns separated by spaces.
The opt is an integer value indicating how a “*” or “?” in the attr should be treated when matching. Use “0” to treat the characters as wildcards, and “1” to treat the characters as literals. The default is “0”.
Matches are not case-sensitive.
Examples
If a workfile contains three objects named “GDP”, “UNEMP”, and “INFLATION”
@attrnames("M*")
returns the list of attributes of GDP, UNEMP, INFLATION that begin with “M”. Alternately,
@attrnames("M* S*", "GDP")
returns the list of attributes for the object GDP that begin with “M” and “S”.
If GDP had an attribute named “*Note” and UNEMP had an attribute named “footnote” the command
@attrnames("*NOTE", "*")
will return “*Note footnote” since by default, the “*” in “*Note” is treated as a wildcard. However, the command
@attrnames("*NOTE", "*", 1)
will return “*Note”, since the “*” in “*Note” is treated as a literal.
Cross-references
See also @attrvals, @wfattrnames, and @wfattrvals.
@attrvals
Attribute values in workfile page.
Syntax: @attrvals(attr[, obj, opt])
attr: string
obj: (optional) string
opt: (optional) integer
Return: string
Returns a string list of all attribute values in the active workfile page that match the attr pattern and, optionally, whose object names also match the obj name pattern.
The attr is a space delimited list of attribute value patterns. The list may be made up of any number of names, or “?” (indicates any single character) or “*” (indicates any number of characters) patterns.
The obj list may be made up of any number of names, or “?” (indicates any single character) or “*” (indicates any number of characters) patterns separated by spaces.
The opt is an integer value indicating how a “*” or “?” in the attr should be treated when matching. Use “0” to treat the characters as wildcards, and “1” to treat the characters as literals.
Matches are not case-sensitive.
Examples
If a workfile contains three objects named “GDP”, “UNEMP”, and “INFLATION”, each object contained a “month” attribute where the GDP “month” values was “Jan”, the UNEMP value was “Feb”, and the INFLATION value was “Mar”, then
@attrvals("M*")
return the string list “Mar”. All attributes values for all objects in the workfile that begin with “M” are included. Alternatively,
@attrvals("M* D*", "GDP")
returns the list of attribute values for the object GDP that begin with “M” and “S”.
If a fourth object INTEREST has an attribute value “*Mar” for “month,” the command
@attrvals("*mar", "*")
will return “*mar mar”, since by default, the “*” in “*mar” is treated as a wildcard and the value “Mar” from INFLATION and value “*Mar” from INTEREST match.
However, the command
@attrvals("*mar", "*", 1)
will only return “*mar”, since the “*” in “*Mar” is treated as a literal for purposes of matching, and only “*Mar” from INTEREST matches.
Cross-references
See also @attrnames, @wfattrnames, and @wfattrvals.