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 Forecasting, simulation studies Programming 7
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: Via the EViews menu (clicking) Via the command line (typing commands) 8
EViews screenshot 9
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 Prespecified sampling period 10
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 (2) Start date and end date 11
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 integer date 1,..., 150 12
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 in statistcial and econometric routines 13
Two fundamental EViews concepts: Transformating data series (via the genr command) Setting the active sample (via the smpl command) Objective of many data transformations: Creating new data series from existing data series 14
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: genr EX RATE REAL = EX RATE * P US / P EURO 15
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 cos(x) Cosine genr Z = log(sqr(sin(y))) 16
Lagged values (lag operator, lags): Let P t denote an overall price level at date t The inflation rate π t between the dates t 1 and t is defined as π t = P t P t 1 P t 1 Lag operator in EViews: Let P be the price-level series in EViews The inflation rates may be generated via the command genr INFL RATE = (P-P(-1))/P(-1) 17
Setting the active sample: Sometimes, it may not be reasonable to consider all observations 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 Then, all subsequent EViews operations only process these data 18
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 smpl 1970 2010 if INFL RATE > 2.0 19
2.2. Descriptive statistics Notation: Consider the data series x 1,..., x T T is the number of observations, x t is the t-th observation The ordered series is x (1) x (2)... x (T ) 20
Example: Prices (in euros) of the mutual fund DEKALUX-JAPAN during the calender weeks #10 and #11 in 2002 Date t x t 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) 03/15/2002 10 538.04 x (6) 21
2.2.1. Histogram and empirical cumulative distribution 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 observations that fall into each bin. Definition 2.2: (Empirical cumulative distribution function) Given the data series x 1,..., x T, for every x R the empirical cumulative distribution function F T : R [0, 1] is defined as F T (x) = number of x t x. T 22
Histogram with descriptive statistics in EViews 3 2 1 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 0 520 525 530 535 540 545 550 555 560 23
Empirical cumulative distribution function in EViews 1.0 DEKALUX 0.8 Probability 0.6 0.4 0.2 0.0 524 528 532 536 540 544 548 552 556 24
2.2.2. Measures of a single series Minimum, maximum: Formulae: x min = x (1), x max = x (T ) EViews commands: =@min(dekalux), =@max(dekalux) Arithmetic mean: Formula: x = 1 T (x 1 + x 2 +... + x T ) = 1 T EViews command: =@mean(dekalux) T x t t=1 25
Median: Formula: x med = x ([T +1]/2) 1 2 [ ] x (T/2) + x ([T +2]/2), if T odd, if T even EViews command: =@median(dekalux) Variance, standard deviation: Formulae: s 2 = 1 T 1 T t=1 (x t x) 2, s = 1 T 1 T t=1 (x t x) 2 EViews commands: =@vars(dekalux), =@stdev(dekalux) 26
Skewness: Formula: x skew = 1 T T t=1 x t x 1T Tt=1 (x t x) 2 3 EViews command: =@skew(dekalux) Kurtosis: Formula: x kurt = 1 T T t=1 x t x 1T Tt=1 (x t x) 2 4 EViews command: =@kurt(dekalux) 27
2.2.3. Covariance and correlation Now: Assume that you have collected pairwise observations (x 1, y 1 ),..., (x T, y T ) for the two data series X and Y in EViews Covariance: Formula: S XY = 1 T 1 T t=1 EViews command: =@covs(x,y) (x t x)(y t y) 28
Correlation coefficient: Formula: R XY = S XY S X S Y = Tt=1 (x t x)(y t y) [ Tt=1 (x t x) 2] [ Tt=1 (y t y) 2] EViews command: =@cor(x,y) 29