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 |the correlation between X and Y. |

|@cov(x,y[,s]) |covariance |the covariance between X and Y (division by|

| | |[pic]). |

|@covp(x,y[,s]) |population covariance|the covariance between X and Y (division by|

| | |[pic]). |

|@covs(x,y[,s]) |sample covariance |the covariance between X and Y (division by|

| | |[pic]). |

|@inner(x,y[,s]) |inner product |the inner product of X and Y. |

|@obs(x[,s]) |number of |the number of non-missing observations for |

| |observations |X in the current sample. |

|@nas(x[,s]) |number of NAs |the number of missing observations for X in|

| | |the current sample. |

|@mean(x[,s]) |mean |average of the values in X. |

|@median(x[,s]) |median |computes the median of the X (uses the |

| | |average of middle two observations if the |

| | |number of observations is even). |

|@min(x[,s]) |minimum |minimum of the values in X. |

|@max(x[,s]) |maximum |maximum of the values in X. |

|@quantile(x,q[,m,s]) |quantile |the q-th quantile of the series X. m is an |

| | |optional string argument for specifying the|

| | |quantile method: "b" (Blom), "r" |

| | |(Rankit-Cleveland), "o" (Ordinary), "t" |

| | |(Tukey), "v" (van der Waerden), "g" |

| | |(Gumbel). The default value is "r". |

|@ranks(x[,o,t,s]) |rank |the ranking of each observation in X. |

| | |The order of ranking is set using o: "a" |

| | |(ascending - default) or "d" (descending). |

| | |Ties are broken according to the setting of|

| | |t: "i" (ignore), "f" (first), "l" (last), |

| | |"a" (average - default), "r" randomize. |

|@stdev(x[,s]) |standard deviation |square root of the unbiased sample variance|

| | |(sum-of-squared residuals divided by |

| | |[pic]). |

|@stdevp(x[,s]) |population standard |square root of the population variance |

| |deviation |(sum-of-squared residuals divided by |

| | |[pic]). |

|@stdevs(x[,s]) |sample standard |square root of the unbiased sample |

| |deviation |variance. Note this is the same calculation|

| | |as @stdev. |

|@var(x[,s]) |variance |variance of the values in X (division by |

| | |[pic]). |

|@varp(x[,s]) |population variance |variance of the values in X. Note this is |

| | |the same calculation as @var. |

|@vars(x[,s]) |sample variance |sample variance of the values in X |

| | |(division by [pic]). |

|@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 |the product of X (note this function could |

| | |be subject to numerical overflows). |

|@sumsq(x[,s]) |sum-of-squares |sum of the squares of X. |

|@gmean(x[,s]) |geometric mean |the geometric mean of X. |

Statistical Distribution Functions

The following functions provide access to the density or probability functions, cumulative distribution, quantile functions, and random number generators for a number of standard statistical distributions.

There are four functions associated with each distribution. The first character of each function name identifies the type of function:

|Function Type |Beginning of Name |

|Cumulative distribution (CDF) |@c |

|Density or probability |@d |

|Quantile (inverse CDF) |@q |

|Random number generator |@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: [pic]. The quantile functions will return the smallest value where the CDF evaluated at the value equals or exceeds the probability of interest: [pic], where [pic]. 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 |Density/Probability Function |

|Beta |@cbeta(x,a,b), @dbeta(x,a,b),|[pic] |

| |@qbeta(p,a,b), @rbeta(a,b) |for [pic]and for [pic], where [pic]is the @beta function. |

|Binomial |@cbinom(x,n,p), |[pic] |

| |@dbinom(x,n,p), |if [pic], and 0 otherwise, for [pic]. |

| |@qbinom(s,n,p), @rbinom(n,p) | |

|Chi-square |@cchisq(x,v), @dchisq(x,v), |[pic] |

| |@qchisq(p,v), @rchisq(v) |where [pic], and [pic]. Note that the degrees of freedom |

| | |parameter [pic]need not be an integer. |

|Exponential |@cexp(x,m), |[pic] |

| |@dexp(x,m), |for [pic], and [pic]. |

| |@qexp(p,m), | |

| |@rexp(m) | |

|Extreme Value |@cextreme(x), @dextreme(x), |[pic] |

|(Type I-minimum) |@qextreme(p), @cloglog(p), |for [pic]. |

|  |@rextreme | |

|F-distribution |@cfdist(x,v1,v2), |[pic] |

| |@dfdist(x,v1,v2), |where [pic], and [pic]. Note that the functions allow for |

| |@qfdist(p,v1,v2), |fractional degrees of freedom parameters [pic]and [pic]. |

| |@rfdist(v1,v1) | |

|Gamma |@cgamma(x,b,r), |[pic] |

| |@dgamma(x,b,r), |where [pic], and [pic]. |

| |@qgamma(p,b,r), @rgamma(b,r) | |

|Generalized Error |@cged(x,r), |[pic] |

| |@dged(x,r), |where [pic], and [pic]. |

| |@qged(p,r), | |

| |@rged(r) | |

|Laplace |@claplace(x), @dlaplace(x), |[pic] |

| |@qlaplace(x)v @rlaplace |for [pic]. |

|Logistic |@clogistic(x), @dlogistic(x),|[pic] |

| |@qlogistic(p), @rlogistic |for [pic]. |

|Log-normal |@clognorm(x,m,s), |[pic] |

| |@dlognorm(x,m,s), |[pic], [pic], and [pic]. |

| |@qlognorm(p,m,s), | |

| |@rlognorm(m,s) | |

|Negative Binomial |@cnegbin(x,n,p), |[pic] |

| |@dnegbin(x,n,p), |if [pic], and 0 otherwise, for [pic]. |

| |@qnegbin(s,n,p), | |

| |@rnegbin(n,p) | |

|Normal (Gaussian) |@cnorm(x), |[pic] |

| |@dnorm(x), |for [pic]. |

| |@qnorm(p), | |

| |@rnorm, nrnd | |

|Poisson |@cpoisson(x,m), |[pic] |

| |@dpoisson(x,m), |if [pic], and 0 otherwise, for [pic]. |

| |@qpoisson(p,m), @rpoisson(m) | |

|Pareto |@cpareto(x,k,a), |[pic] |

| |@dpareto(x,k,a), |for location parameter [pic]and shape parameter [pic]. |

| |@qpareto(p,k,a), | |

| |@rpareto(k,a) | |

|Student's |@ctdist(x,v), @dtdist(x,v), |[pic] |

|[pic]-distribution |@qtdist(p,v), @rtdist(v) |for [pic], and [pic]. Note that [pic], yields the Cauchy |

| | |distribution. |

|Uniform |@cunif(x,a,b), |[pic] |

| |@dunif(x,a,b), |for [pic]and [pic]. |

| |@qunif(p,a,b), | |

| |@runif(a,b), rnd | |

|Weibull |@cweib(x,m,a), @dweib(x,m,a),|[pic] |

| |@qweib(p,m,a), @rweib(m,a) |where [pic], and [pic]. |

Additional Distribution Related Functions

The following utility functions were designed to facilitate the computation of p-values for common statistical tests. While these results may be derived using the distributional functions above, they are retained for convenience and backward compatibility.

|Function |Distribution |Description |

|@chisq(x,v) |Chi-square |Returns the probability that a Chi-squared |

| | |statistic with [pic]degrees of freedom exceeds |

| | |[pic]: |

| | |@chisq(x,v)=1-@cchisq(x,d) |

|@fdist(x,v1,v2) |F-distribution |Probability that an F-statistic with |

| | |[pic]numerator degrees of freedom and |

| | |[pic]denominator degrees of freedom exceeds |

| | |[pic]: |

| | |@fdist(x,v1,v2)=1-@cfdist(x,v1,v2) |

|@tdist(x,v) |t-distribution |Probability that a t-statistic with [pic]degrees|

| | |of freedom exceeds [pic]in absolute value |

| | |(two-sided p-value): |

| | |@tdist(x,v)=2*(1-@ctdist(@abs(x),v)) |

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download