2. Descriptive statistics in EViews
Features of EViews:
• Data processing
(importing, editing, handling, exporting data)
• Basic statistical tools
(descriptive statistics, inference, graphical tools)
• Regression analysis
• Time series analysis
• Specification diagnostics, specification testing
2.1. Introduction to EViews
Fundamental concept behind EViews:• EViews is based on objects Some typical EViews objects:
• Data series (single: series, collection of series: groups)
• graphs
• equations
How to enter EViews commands:
Basis of all EViews actions:
• workfile
Definition of a workfile:
• Container for all EViews objects with which you want to work (series, graphs, equations)
Features of a workfile:
• Prespecified data frequency
Creating an EViews-workfile:
• Either by typing the command create
• Or by clicking through the menu items File/New/ Workfile
−→ dialogue requesting two pieces of information: (1) Data frequency
Data frequency and data representation Frequency Representation annual 2014, 2015, etc. semi-annual 2015:1, 2015:2 quarterly 2015:1, ... , 2015:4 monthly 2015:01, ... , 2015:12 weekly mm/dd/yyyy, e.g. 03/26/2015
daily (5 days weeks) mm/dd/yyyy
daily (7 days weeks) mm/dd/yyyy
Generating data series:
• Manual data input
(invoking the EViews data editor by the command data)
• Importing data from external data bases (e.g. from Excel, Lotus, ...)
Afterwards, we may use data series
• to generate graphs
Two fundamental EViews concepts:
• Transformating data series (via the genr command)
• Setting the active sample (via the smpl command)
Objective of many data transformations:
Example:
Assume we are given the following series in EViews:
• EX RATE: the nominal Euro-USD exchange rate
• P EURO: the overall price level in Euroland
• P US: the overall price level in the US Creating the real exchange-rate series:
Some operators and functions for the genr command Operator Meaning Example
+ Sum
- Difference
* Product
/ Ratio
^ Power genr H = (A+B/(H+K))^2
log(x) Natural log genr Z = log(X) exp(x) Natural exp
abs(x) Absolute value
sqr(x) Square root
sin(x) Sine
Lagged values (lag operator, lags):
• Let Pt denote an overall price level at date t
• The inflation rate πt between the dates t −1 and t is defined as
πt = Pt − Pt−1 Pt−1
Lag operator in EViews:
• Let P be the price-level series in EViews
Setting the active sample:
• Sometimes, it may not be reasonable to consider all obser-vations of a series in statistical operations
• Via the smpl command we are able to restrict the data range to be processed
Example:
Assume that your worfile contains yearly GDP data between 1950 and 2015:
• If you only need to consider the time period 1970 until 2010, you set
smpl 1970 2010
Remarks:
• The smpl command allows us to further restrict our data base via the if statement
• If you only need to analyze the years between 1970 and 2010, in which the inflation rate exceeded 2%, you set
2.2. Descriptive statistics
Notation:
• Consider the data series x1, . . . , xT
• T is the number of observations, xt is the t-th observation
Example:
Prices (in euros) of the mutual fund DEKALUX-JAPAN during the calender weeks #10 and #11 in 2002
Date t xt x(t) 03/04/2002 1 527.54 x(3) 03/05/2002 2 523.79 x(2) 03/06/2002 3 521.92 x(1) 03/07/2002 4 540.91 x(7) 03/08/2002 5 551.68 x(9) 03/11/2002 6 556.54 x(10) 03/12/2002 7 543.45 x(8) 03/13/2002 8 530.52 x(4) 03/14/2002 9 534.60 x(5)
2.2.1. Histogram and empirical cumulative
distri-bution function
Definition 2.1: (Histogram)
The histogram divides the series range (the distance between the maximum and minimum values) into a number of equal length intervals (bins) and displays a count of the number of observa-tions that fall into each bin.
Definition 2.2: (Empirical cumulative distribution function)
Given the data series x1, . . . , xT, for every x ∈ R the empirical cumulative distribution function FT : R → [0,1] is defined as
Histogram with descriptive statistics in EViews 0 1 2 3 520 525 530 535 540 545 550 555 560 Series: DEKALUX Sample 3/04/2002 3/15/2002 Observations 10 Mean 536.8990 Median 536.3200 Maximum 556.5400 Minimum 521.9200 Std. Dev. 11.51973 Skewness 0.340804 Kurtosis 2.018182 Jarque-Bera 0.595232 Probability 0.742587
Empirical cumulative distribution function in EViews 0.0 0.2 0.4 0.6 0.8 1.0 524 528 532 536 540 544 548 552 556 P robabi li ty DEKALUX
2.2.2. Measures of a single series
Minimum, maximum:
• Formulae: xmin = x(1), xmax = x(T)
• EViews commands: =@min(DEKALUX), =@max(DEKALUX)
Arithmetic mean: • Formula: x = 1 T · (x1 + x2 + . . . + xT) = 1 T · T X t=1 xt
Median: • Formula: xmed = x([T+1]/2) , if T odd 1 2 · h x(T /2) + x([T+2]/2)i , if T even
• EViews command: =@median(DEKALUX)
Variance, standard deviation:
• Formulae: s2 = 1 T − 1· T X t=1 (xt − x)2 , s = v u u u t 1 T − 1 · T X t=1 (xt − x)2
Skewness: • Formula: xskew = 1 T T X t=1 q1 xt − x T PT t=1 (xt − x)2 3
• EViews command: =@skew(DEKALUX)
Kurtosis: • Formula: xkurt = 1 T T X t=1 q1 xt − x T PT t=1(xt − x)2 4
2.2.3. Covariance and correlation
Now:
• Assume that you have collected pairwise observations (x1, y1), . . . ,(xT, yT) for the two data series X and Y in EViews
Covariance: • Formula: SXY = 1 T − 1 T X t=1 (xt − x)(yt − y)
Correlation coefficient: • Formula: RXY = SXY SX · SY = PT t=1(xt − x)(yt − y) rhPT t=1(xt − x)2 i hPT t=1(yt − y)2 i