Command Reference : Function Reference : Function Reference: E
  
Function Reference: E
 
@ebtw
@ediv
@eeq
@eeqna
@ege
@egt
@eigenvalues
@eigenvectors
@einv
@eisna
@ele
@elimin
@elt
@emax
@emin
@emult
@enddate
@eneq
@eneqna
@enisna
@env
@epow
@eqna
@equaloption
@erecode
@erf
@erfc
@errorcount
@event
@evpath
@exp
exp
@explode
@expm1
@ebtw Element by element test for whether values are between two other values.
@ediv Element by element division of two matrices.
@eeq Element by element equality comparison of two data objects.
@eeqna Element by element equality comparison of two data objects with NAs treated as ordinary value for comparison.
@ege Element by element tests for whether the elements in the data objects are greater than or equal to corresponding elements in another data object.
@egt Element by element tests for whether the elements in the data object strictly greater than corresponding elements in another data object.
@eigenvalues Vector of eigenvalues of a sym.
@eigenvectors Matrix whose columns contain the eigenvectors of a matrix.
@einv Element by element inverses of a matrix.
@eisna Element by element missing value tests of data objects.
@ele Element by element tests for whether the elements in the data object are less than or equal to corresponding elements in another data object.
@elimin Elimination matrix.
@elt Element by element tests for whether the elements in the data object are strictly less than corresponding elements in another data object.
@emax Element by element maximums of two conformable data objects.
@emin Element by element minimums of two conformable data objects.
@emult Element by element multiplication of two matrix objects.
@enddate Last possible date of observation.
@eneq Element by element inequality comparison of two data objects.
@eneqna Element by element inequality comparison of two data objects with NAs treated as ordinary value for comparison.
@enisna Element by element non-missing value tests of data objects.
@env Windows environment variable string.
@epow Raises each element in a matrix to a power.
@eqna Test for equality of values, treating NAs and null strings as ordinary and not missing values.
@equaloption Equals-to option value provided in the exec or run commands.
@erecode Element by element recode of matrices.
@erf Error function (Gauss error function).
@erfc Complementary (Gauss) error function.
@errorcount Number of errors encountered running a program.
@event Event identifier for observation.
@evpath Directory path of the EViews executable.
@exp Exponential function.
exp Exponential function.
@explode Square matrix from a sym matrix object.
@expm1 Exponential function minus.
@ebtw
Element by element test for whether values are between two other values.
Syntax: @ebtw(x, v1, v2)
x: numeric or alphanumeric object
v1: numeric or alphanumeric object
v2: numeric or alphanumeric object
Return: vector or matrix object
where v1 and v2 correspond to the low and high values of the range.
Returns indicators equal to 1 for elements where x is greater than or equal to v1 and less than or equal to v2, and 0 otherwise.
Examples
vector d1 = @ebtw(x, 10, 100)
creates a dummy variable that takes the value 1 where the value of X is in the range defined by the values 10 and 100.
vector d2 = @ebtw(x, lowvals, highvals)
creates a dummy variable that takes the value 1 where the value of X is in the range defined by the series LOWVALS and HIGHVALS.
vector d3 = @ebtw("myval", svalslow, svalshigh)
tests for whether the string “myval” is between the low and high values in the string vectors SVALSLOW and SVALSHIGH.
Cross-references
See also @between and @inlist.
@ediv
Element by element division of two numeric objects.
Syntax: @ediv(m1, m2)
m1: numeric object
m2: numeric object
Return: vector or matrix object
Returns the element by element division of two numeric objects.
Each element of the returned matrix is equal to the corresponding element in m1 divided by the corresponding element in m2.
Note m1 and m2 must be of identical dimensions.
Examples
Let X and Y be matrices of IID normal variates. Then
matrix Z = @ediv(X, Y)
creates Z, a matrix of IID Cauchy variates.
Cross-references
See also @einv, @emult, and @epow.
@eeq
Element by element equality comparison of two data objects.
Syntax: @eeq(m1, m2)
m1: numeric or alphanumeric object
m2: numeric or alphanumeric object
Return: vector or matrix object
Returns the element by element test of equality between numeric or alphanumeric objects.
Each element of the returned object is equal to 1 or 0 depending on whether the corresponding element in m1 is equal to the corresponding element in m2.
Note m1 and m2 must be of identical dimensions.
Examples
Let X and Y be matrices. Then
= @eeq(X, Y)
returns an binary matrix that indicates where X and Y match (on 0 or on 1).
Cross-references
See also @ege, @egt, @ele, and @elt.
See also @eeqna, @eneq, and @eneqna.
@eeqna
Element by element equality comparison of two data objects with NA handling.
Syntax: @eeqna(m1, m2)
m1: numeric or alphanumeric object
m2: numeric or alphanumeric object
Return: vector or matrix object
Returns the element by element test of equality between numeric or alphanumeric objects. NAs and missing strings are treated as ordinary values for purposes of comparison.
Each element of the returned matrix is equal to 1 or 0 depending on whether the corresponding element in m1 is equal to the corresponding element in m2.
Note m1 and m2 must be of identical dimensions.
Examples
Let X and Y be matrices. Then
= @eeqna(X, Y)
returns an binary matrix that indicates where X and Y match (on 0, 1, or NA).
Cross-references
See also @eisna, @ege, @egt, @ele, and @elt.
See also @eeq, @eneq, and @eneqna.
@ege
Element by element greater than or equal tests of two data objects.
Syntax: @ege(m1, m2)
m1: numeric or alphanumeric object
m2: numeric or alphanumeric object
Return: vector or matrix object
Returns a test for whether the elements in the data object m1 are greater than or equal to the corresponding elements in m2.
Each element of the returned matrix is equal to 1 or 0 depending on the outcome of the comparison.
Note m1 and m2 must be of identical dimensions.
Examples
Let X and Y be matrices. Then
= @ege(X, Y)
returns an binary matrix indicating places where X is greater than or equal to Y.
Cross-references
See also @eisna, @egt, @ele, and @elt.
See also @eeq, @eeqna, @eneq, and @eneqna.
@egt
Element by element greater than tests of two data objects
Syntax: @egt(m1,m2)
m1: numeric or alphanumeric object
m2: numeric or alphanumeric object
Return: vector or matrix object
Returns a test for whether the elements in the object m1 are greater than the corresponding elements in m2.
Each element of the returned matrix is equal to 1 or 0 depending on the outcome of the comparison.
Note m1 and m2 must be of identical dimensions.
Examples
Let X and Y be matrices. Then
= @egt(X, Y)
returns an binary matrix indicating places where X is greater Y.
Cross-references
See also @eisna, @ege, @ele, and @elt.
See also @eeq, @eeqna, @eneq, and @eneqna.
@eigenvalues
Eigenvalues of symmetric matrix.
Syntax: @eigenvalues(s)
s: sym
Return: vector
Returns a vector containing the eigenvalues of the sym s.
The eigenvalues are those scalars that satisfy where is the sym associated with the argument . The eigenvalues are arranged in ascending order.
Examples
sym s1 = @unvech(@mnrnd(15))
vector v1 = @eigenvalues(s1)
creates V1, a vector of eigenvalues of S1.
Cross-references
See also @eigenvectors, @det, and @trace.
@eigenvectors
Eigenvectors of symmetric matrix.
Syntax: @eigenvectors(s)
s: sym
Return: matrix
Returns a square matrix whose columns are the eigenvectors of the sym s.
Each eigenvector v satisfies , where is the symmetric matrix given by s, and where n is the eigenvalue associated with the eigenvector v. The eigenvalues are arranged in ascending order, and the columns of the eigenvector matrix correspond to the sorted eigenvalues.
Examples
sym s1 = @unvech(@mnrnd(15))
matrix m1 = @eigenvectors(s1)
creates M1, a matrix of eigenvectors of S1.
Cross-references
See @eigenvalues.
@einv
Element by element inverses (reciprocals) of a numeric data object.
Syntax: @einv(m)
m: numeric data object
Return: numeric data object
Returns the element by element inverse of a data object.
Each element of the returned object is equal to 1 divided by the corresponding element of the input object.
Examples
Let C1 be a matrix of IID Cauchy variates with scale . Then
= @einv(c1)
returns a matrix of IID Cauchy variates with scale .
Cross-references
See also @ediv, @emult, and @epow.
@eisna
Element by element missing value tests of data objects.
Syntax: @eisna(m)
m: numeric or alphanumeric object
Return: vector or matrix object
Returns a test for whether the elements in the data object m are numeric missing values, or empty strings.
Each element of the returned matrix is equal to 1 or 0 depending on the outcome of the comparison. Missing values are set to 1, and non-missing are set to 0.
Examples
Let X be an matrix. Then
= @eisna(X)
returns an binary matrix indicating places where X is missing.
Cross-references
See also @enisna, @ege, @egt, and @elt.
See also @eeq, @eeqna, @eneq, and @eneqna.
@ele
Element by element less than or equal to tests of data objects.
Syntax: @ege(m1, m2)
m1: numeric or alphanumeric object
m2: numeric or alphanumeric object
Return: vector or matrix object
Returns a test for whether the elements in the data object m1 are greater than or equal to the corresponding elements in m2.
Each element of the returned matrix is equal to 1 or 0 depending on the outcome of the comparison.
Note m1 and m2 must be of identical dimensions.
Examples
Let X and Y be matrices. Then
= @ele(X, Y)
returns an binary matrix indicating places where X is less than or equal to Y.
Cross-references
See also @eisna, @ege, @egt, and @elt.
See also @eeq, @eeqna, @eneq, and @eneqna.
@elimin
Elimination matrix.
Syntax: @elimin(n)
n: integer
Return: matrix
The elimination matrix transforms the half vectorization of a sym matrix to the vectorization of the matrix.
Returns the matrix , which satisfies
for an sym matrix ,
Examples
sym s1 = @unvech(@mnrnd(15))
vector diff = @vech(s1) - @elimin(s1.@cols) * @vec(s1)
demonstrates the properties of the duplication matrix since DIFF equals zero.
Cross-references
See also @commute, @duplic, and @duplicinv.
@elt
Element by element less than tests of data objects matrices.
Syntax: @elt(m1, m2)
m1: numeric or alphanumeric object
m2: numeric or alphanumeric object
Return: vector or matrix object
Returns a test for whether the elements in the data objector m1 are less than the corresponding elements in m2.
Each element of the returned matrix is equal to 1 or 0 depending on the outcome of the comparison.
Note m1 and m2 must be of identical dimensions.
Examples
Let X and Y be matrices. Then
= @elt(X, Y)
returns an binary matrix indicating places where X is less than Y.
Cross-references
See also @eisna, @ege, @egt, and @ele.
See also @eeq, @eeqna, @eneq, and @eneqna.
@emax
Element by element maximums of two data objects.
Syntax: @emax(m1, m2)
m1: numeric or alphanumeric object
m2: numeric or alphanumeric object
Return: vector or matrix object
Returns the element maximum of the conformable data objects m1 and m2.
Examples
Suppose there are n individuals deciding between two courses of action. Let U1 be an n-vector whose i-th element represents the utility the i-th individual derives from taking the first action. Define U2 similarly. Then
= @emax(u1, u2)
returns an n-vector of utilities that results from each individual taking the course of action that maximizes utility.
Cross-references
See also @emin.
@emin
Element by element minimums of two data objects matrices.
Syntax: @emin(m1, m2)
m1: numeric or alphanumeric object
m2: numeric or alphanumeric object
Return: vector or matrix object
Returns the element minimum of the conformable matrices m1 and m2.
Examples
Suppose there are n individuals deciding between two courses of action. Let L1 be an n-vector whose i-th element represents the loss the i-th individual experiences from taking the first action. Define L2 similarly. Then
= @emin(l1, l2)
returns an n-vector of losses that results from each individual taking the course of action that minimizes loss.
Cross-references
See also @emax.
@emult
Element by element multiplication of two numeric data objects.
Syntax: @emult(m1, m2)
m1: numeric object
m2: numeric object
Return: numeric object
Returns the element by element multiplication of two numeric objects.
Each element of the returned object is equal to the corresponding element in m1 multiplied by the corresponding element in m2.
Note m1 and m2 must be of identical dimensions.
Examples
Let M1 and M2 be matrices of IID log-normal variates. Then
matrix m3 = @emult(m1, m2)
creates M3, an matrix of IID log-normal variates.
Cross-references
See also @einv, @ediv, and @epow.
@enddate
Last possible date of observation.
Syntax: @enddate
Return: series
Returns the date number associated with the end date of each observation in the workfile.
The end date number associated with an observation is the last (largest) date number corresponding to the observation date interval.
Examples
series dt = @enddate
saves the enddate numbers into the series DT. The default display format for these numbers will match the workfile frequency, but you may work with and display the series values as numbers.
alpha dts_1 = @datestr(@enddate,"yyyy:q")
alpha dts_2 = @strdate("yyyy:q")
Create two string series with the end observation dates formatted in “yyyy:q” format.
Cross-references
See “Date Numbers” and “Date Formats”.
See also @date, @datestr and @strdate.
@eneq
Element by element inequality comparison of two data objects.
Syntax: @eneq(m1,m2)
m1: numeric or alphanumeric object
m2: numeric or alphanumeric object
Return: vector or matrix object
Returns the element by element test of inequality between two data objects. Each element of the returned matrix is equal to 1 or 0 depending on whether the corresponding element in m1 is not equal to the corresponding element in m2. Note m1 and m2 must be of identical dimensions.
Examples
Let X and Y be binary matrices. Then
= @eneq(X, Y)
returns an binary matrix that indicates where X and Y do not match (on 0 or on 1).
Cross-references
See also @eisna, @ege, @egt, @ele, and @elt.
See also @eeq, @eeqna, and @eneqna.
@eneqna
Element by element inequality comparison of two data objects with NA handling.
Syntax: @eneqna(m1, m2)
m1: numeric or alphanumeric object
m2: numeric or alphanumeric object
Return: vector or matrix object
Returns the element by element test of inequality between two data objects. NAs and empty strings are treated as ordinary values for purposes of comparison.
Each element of the returned matrix is equal to 1 or 0 depending on whether the corresponding element in m1 is not equal to the corresponding element in m2.
Note m1 and m2 must be of identical dimensions.
Examples
Let X and Y be matrices. Then
= @eneqna(X, Y)
returns an binary matrix that indicates where X and Y do not match (on 0, 1, or NA).
Cross-references
See also @ege, @egt, @ele, and @elt.
See also @eeq, @eeqna, and @eneq.
@enisna
Element by element non-missing value tests of data objects.
Syntax: @enisna(m)
m: numeric or alphanumeric object
Return: vector or matrix object
Returns a test for whether the elements in the data object m are numeric non-missing values, or non-empty strings.
Each element of the returned matrix is equal to 1 or 0 depending on the outcome of the comparison. Non-missing values are set to 1, and missing are set to 0.
Examples
Let X be an matrix. Then
= @enisna(X)
returns an binary matrix indicating places where X is not missing.
Cross-references
See also @eisna, @ege, @egt, and @elt.
See also @eeq, @eeqna, @eneq, and @eneqna.
@env
Windows environment variable string.
Syntax: @env(str)
str: string
Return: string
Returns the value of the Windows environment variable str.
Examples
@env("username")
returns the user-name of the current logged in user.
@env("computername")
returns the name of the computer.
@env("homepath")
returns the path of the current logged in user.
The command
svector a = @env(@sfill("username", "computername", "homepath"))
returns the three strings in the svector object A.
@epow
Element by element raise to a power in a data object.
Syntax: @epow(m1, m2)
m1: numeric object
m2: numeric object
Return: numeric object
Returns a matrix where every element is equal to the corresponding element in m1 raised to the power given by m2.
Examples
Let X be a matrix of IID standard normal variates. Then
= @epow(x, 2)
returns a matrix of IID chi-square variates with unit degree of freedom.
Cross-references
See also @ediv, @einv, and @emult.
@eqna
Tests for equality of values.
Syntax: @eqna(arg1, arg2)
arg1: number or string
arg2: number or string
Return: number
Tests for equality of the arg1 and arg2, treating NAs and null strings as ordinary, and not as missing values. Simple equality testing which propagates null string NAs may be performed using the “=” binary comparison operator.
Return value is an integer (0, 1). Arguments which test as equal return a 1, and 0 otherwise.
When used with series objects, the test is performed for every observation in the workfile sample. Note that when used with matrix objects, the comparison is an equality test of all of the elements of the two matrices, and will return 0 if any element comparison is false. Individual element tests are available in @eeqna
Examples
The test
scalar f = @eqna(NA, 2)
returns the value 0, not an NA.
Consider the comparison
vector v1 = @fill(1, 2, 2)
scalar f2 = @eqna(v1, 2)
compares the entire vector V1 to 2, and returns 0 since some of the elements of V1 are not equal to 2. Note that the comparison is an equality test of the entire vector that returns a 0 if any element is not equal, and a 1 if all elements are equal, ignoring NAs.
If SER1 and SER2 are numeric series,
series s2 = @eqna(ser1, ser2)
tests SER1 and SER2 for equality, ignoring NAs, for each observation in the workfile sample.
Define the string objects
string s1 = "abc"
string s2 = ""
Then
scalar b1 = @eqna("abc", "abc")
scalar b2 = @eqna("abc", s1)
sets the scalar objects B1 and B2 to 1, while
scalar c1 = @eqna("", "def")
scalar c2 = @eqna(s2, "def")
scalar c3 = @eqna(s1, s2)
sets C1, C2, and C3 to 0.
If ALPHA1 and ALPHA2 are alpha series,
series d1 = @eqna(alpha1, "abc")
series d2 = @eqna(alpha1, s1)
series d3 = @eqna(alpha1, alpha2)
perform the equality test using ALPHA1 and ALPHA2 for each observations in the workfile sample.
If SVEC1 and SVEC2 are svectors,
scalar sc1 = @eqna(svec1, "abc")
scalar sc2 = @eqna(svec1, svec2)
perform the equality test of SVEC1 against “abc”, and the contents of SVEC2. Note that this is a full equality test of SVEC1 against the string, or against each element of SVEC2, and that the test will return a 0 if any element is not equal, and a 1 if all elements are equal (ignoring empty strings).
Cross-references
See also @eeqna, @eisna, @isna, and @neqna.
@equaloption
Equals-to option value provided in the exec or run commands.
Syntax: @equaloption(str)
str: string
Return: string
returns the text to the right of the “str=” option provided in the exec or run commands.
If the str keyword is not found, the function will return an empty string.
Example
For example, if you have specified the option “kernel=tri” in your exec command,
string opt = @equaloption("kernel")
will return the string “TRI”.
Cross-references
See exec and run.
@erecode
Element by element recode of data objects.
Syntax: @erecode(m1, m2, m3)
m1: numeric object
m2: numeric or alphanumeric object
m3: numeric or alphanumeric object
Return: numeric or alphanumeric object
Returns the element recode using the conformable numeric condition object m1 and the matrices m2 and m3. If an element of m1 is non-zero, then assign the value using the corresponding element of m2, otherwise use the corresponding value of m3.
Examples
Let M1 be a matrix. Then
= @erecode(@egt(M1, 0), M1, na)
returns a matrix that is identical to M1 except that negative values are replaced with NAs.
Cross-references
See also @eeq.
@erf
Error function (Gauss error function).
Syntax: @erf(x)
x: number
Return: number
for .
Examples
= @erf(1/@sqrt(2))
returns 0.68268... (area under the normal curve within 1 standard deviation of the mean).
Cross-references
See also @erfc.
@erfc
Complimentary (Gauss) error function.
Syntax: @erfc(x)
x: number
Return: number
.
for .
Examples
= @erfc(1/@sqrt(2))
returns 0.31731... (area under the normal curve beyond 1 standard deviation of the mean).
Cross-references
See also @erf.
@errorcount
Number of errors encountered running a program.
Syntax: @errorcount
Return: integer
Returns a scalar containing the number of errors encountered during program execution.
Cross-references
See also @maxerrcount, setmaxerrs, clearerrs, seterr, and seterrcount.
@event
Event identifiers for observation.
Syntax: @event(h[, b])
h: string
b: (optional) string
Return: series
where h is the one-off event specification and b is a basis specification.
Returns the proportion or identifier of a one-off event covered by the observation, for each observation in the workfile. If the workfile has a regular frequency and spans the entire event, the returned series will sum to one over all observations. If the workfile is irregular or does not span the entire event, the series may sum to less than one due to the observations that have been omitted.
The optional basis parameter may be used to specify that only certain days of the week or times of the day should be included as part of the holiday. This parameter has the format
"start_weekday-end_weekday[, start_time-end_time]"
e.g. “mon-thu” or “mon-sun,10am-4pm”.
@event is similar to @holiday, but handles only a single non-repeating date or date range and only the basis option.
Examples
"1980Q3"
Cross-references
See “Event Function” for extensive discussion. See also @holiday.
@evpath
Directory path of the EViews executable
Syntax: @evpath
Return: string
Returns a string containing the directory path for the EViews executable.
Examples
If your currently executing copy of EViews is installed in “d:\eviews”, then
%y = @evpath
assigns a string of the form “D:\EVIEWS”.
Cross-references
See also cd, @datapath, @addinspath, and @temppath.
@exp
Exponential function.
Syntax: @exp(x)
x: number
Return: number
Returns .
Examples
= @exp(1)
returns 2.71828....
Cross-references
See also exp and @expm1.
exp
Exponential function.
Syntax: exp(x)
x: number
Return: number
Returns .
Examples
= exp(1)
returns 2.71828....
Cross-references
See also @exp and @expm1.
@explode
Square matrix from a sym matrix.
Syntax: @explode(s)
s: sym
Return: matrix
Creates a square matrix from a sym s, by duplicating the lower triangle elements into the upper triangle.
Examples
Let S be a sym object. Then
matrix m = @explode(s)
creates M, a matrix object whose size and elements are identical to those of S.
Cross-references
See also @implode and @implodeu.
@expm1
Exponential function minus 1.
Syntax: @expm1(x)
x: number
Return: number
Returns .
Provides higher precision calculation than direct evaluation using
@exp(x) - 1
for near 0.
Examples
= @expm1(0.05)
returns 0.05127....
Cross-references
See also @exp.