Professional Documents
Culture Documents
Descriptive Statistics and Distribution Functions in Eviews
Descriptive Statistics and Distribution Functions in Eviews
Descriptive Statistics
These functions compute descriptive statistics for a specified sample, excluding missing
values if necessary. The default sample is the current workfile sample. If you are
performing these computations on a series and placing the results into a series, you can
specify a sample as the last argument of the descriptive statistic function, either as a
string (in double quotes) or using the name of a sample object. For example:
series z = @mean(x, "1945m01 1979m12")
or
w = @var(y, s2)
where S2 is the name of a sample object and W and X are series. Note that you may not
use a sample argument if the results are assigned into a matrix, vector, or scalar object.
For example, the following assignment:
vector(2) a
series x
a(1) = @mean(x, "1945m01 1979m12")
is not valid since the target A(1) is a vector element. To perform this latter computation,
you must explicitly set the global sample prior to performing the calculation performing
the assignment:
smpl 1945:01 1979:12
a(1) = @mean(x)
To determine the number of observations available for a given series, use the @obs
function. Note that where appropriate, EViews will perform casewise exclusion of data
with missing values. For example, @cov(x,y) and @cor(x,y) will use only observations
for which data on both X and Y are valid.
In the following table, arguments in square brackets [ ] are optional arguments:
[s]: sample expression in double quotes or name of a sample object. The optional
sample argument may only be used if the result is assigned to a series. For
@quantile,
you must provide the method option argument in order to include the
optional sample argument.
If the desired sample expression contains the double quote character, it may be entered
using the double quote as an escape character. Thus, if you wish to use the equivalent of,
smpl if name = "Smith"
in your @MEAN function, you should enter the sample condition as:
series y = @mean(x, "if name=""Smith""")
The pairs of double quotes in the sample expression are treated as a single double quote.
Function
Name
Description
@cor(x,y[,s])
correlation
@cov(x,y[,s])
covariance
@covp(x,y[,s])
population
covariance
@covs(x,y[,s])
sample
covariance
@inner(x,y[,s])
@obs(x[,s])
number of
observations
@nas(x[,s])
number of
NAs
@mean(x[,s])
mean
@median(x[,s])
median
@min(x[,s])
minimum
@max(x[,s])
maximum
@quantile(x,q[,m,s]) quantile
@ranks(x[,o,t,s])
rank
@stdev(x[,s])
standard
deviation
@stdevp(x[,s])
population
standard
deviation
@stdevs(x[,s])
sample
standard
deviation
@var(x[,s])
variance
@varp(x[,s])
population
variance
@vars(x[,s])
sample
variance
@skew(x[,s])
skewness
skewness of values in X.
@kurt(x[,s])
kurtosis
kurtosis of values in X.
@sum(x[,s])
sum
the sum of X.
@prod(x[,s])
product
@sumsq(x[,s])
sum-ofsquares
@gmean(x[,s])
geometric
mean
Beginning of Name
@d
@q
@r
The remainder of the function name identifies the distribution. For example, the functions
for the beta distribution are @cbeta, @dbeta, @qbeta and @rbeta.
When used with series arguments, EViews will evaluate the function for each observation
in the current sample. As with other functions, NA or invalid inputs will yield NA values.
For values outside of the support, the functions will return zero.
Note that the CDFs are assumed to be right-continuous:
. The quantile
functions will return the smallest value where the CDF evaluated at the value equals or
exceeds the probability of interest:
, where
. The inequalities are
only relevant for discrete distributions.
The information provided below should be sufficient to identify the meaning of the
parameters for each distribution.
Distribution Functions
Beta
Binomial
Chi-square
Exponential
Density/Probability Function
@cbeta(x,a,b),
@dbeta(x,a,b),
@qbeta(p,a,b),
@rbeta(a,b)
for
and for
is the @beta function.
@cbinom(x,n,p),
@dbinom(x,n,p),
@qbinom(s,n,p),
@rbinom(n,p)
if
for
@cchisq(x,v),
@dchisq(x,v),
@qchisq(p,v),
@rchisq(v)
@cexp(x,m),
@dexp(x,m),
@qexp(p,m),
@rexp(m)
Extreme
Value
(Type Iminimum)
@cextreme(x),
@dextreme(x),
@qextreme(p),
@cloglog(p),
@rextreme
Fdistribution
@cfdist(x,v1,v2),
@dfdist(x,v1,v2),
@qfdist(p,v1,v2),
@rfdist(v1,v1)
, where
, and 0 otherwise,
.
where
, and
. Note that the
degrees of freedom parameter need
not be an integer.
for
for
, and
where
, and
. Note that
the functions allow for fractional
degrees of freedom parameters and
.
Gamma
@cgamma(x,b,r),
@dgamma(x,b,r),
@qgamma(p,b,r),
@rgamma(b,r)
where
, and
Generalized
Error
@cged(x,r),
@dged(x,r),
@qged(p,r),
@rged(r)
where
Laplace
Logistic
Log-normal
Negative
Binomial
@claplace(x),
@dlaplace(x),
@qlaplace(x)v
@rlaplace
@clogistic(x),
@dlogistic(x),
@qlogistic(p),
@rlogistic
for
for
@clognorm(x,m,s),
@dlognorm(x,m,s),
@qlognorm(p,m,s),
@rlognorm(m,s)
@cnegbin(x,n,p),
@dnegbin(x,n,p),
@qnegbin(s,n,p),
@rnegbin(n,p)
, and
, and
if
for
, and 0 otherwise,
@cnorm(x),
@dnorm(x),
@qnorm(p),
@rnorm, nrnd
for
Poisson
@cpoisson(x,m),
@dpoisson(x,m),
@qpoisson(p,m),
@rpoisson(m)
if
for
@cpareto(x,k,a),
@dpareto(x,k,a),
@qpareto(p,k,a),
@rpareto(k,a)
Student's distribution
Normal
(Gaussian)
Pareto
, and 0 otherwise,
.
and
@ctdist(x,v),
@dtdist(x,v),
@qtdist(p,v),
@rtdist(v)
for
, and
. Note that
, yields the Cauchy distribution.
Uniform
Weibull
@cunif(x,a,b),
@dunif(x,a,b),
@qunif(p,a,b),
@runif(a,b), rnd
for
@cweib(x,m,a),
@dweib(x,m,a),
@qweib(p,m,a),
@rweib(m,a)
where
and
, and
Distribution
Description
@chisq(x,v)
Chi-square
@fdist(x,v1,v2)
@tdist(x,v)
t-distribution