Preparing the Data1 RATS Dialog Interface WINDOWS: It is most convenient to use RATS using two windows: one for input and the other for output. When you.

Slides:



Advertisements
Similar presentations
EViews Student Version. Today’s Workshop Basic grasp of how EViews manages data Creating Workfiles Importing data Running regressions Performing basic.
Advertisements

Exercise 7.5 (p. 343) Consider the hotel occupancy data in Table 6.4 of Chapter 6 (p. 297)
A. The Basic Principle We consider the multivariate extension of multiple linear regression – modeling the relationship between m responses Y 1,…,Y m and.
Applied Econometrics Second edition
 2005 Pearson Education, Inc. All rights reserved Introduction.
Ch11 Curve Fitting Dr. Deshi Ye
Lecture 9 Today: Ch. 3: Multiple Regression Analysis Example with two independent variables Frisch-Waugh-Lovell theorem.
Welcome to Econ 420 Applied Regression Analysis Study Guide Week Three Ending Tuesday, September 11 (Note: You must go over these slides and complete every.
Chapter 4 Multiple Regression.
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 2 1 Microsoft Office Excel 2003 Tutorial 2 – Working With Formulas and Functions.
Review of Matrix Algebra
Chapter 11 Multiple Regression.
Estimating a VAR After making the necessary data transformations, you must define the equations to use in the VAR. Typically, you will use the following.
Nonlinear Estimation1 Formulas A formula is a (possibly) nonlinear mathematical relationship. A SERIES is a vector of numbers Formulas versus SET: –You.
1 1 Slide © 2003 South-Western/Thomson Learning™ Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
1 Computing for Todays Lecture 8 Yumei Huo Spring 2006.
SPSS Statistical Package for the Social Sciences is a statistical analysis and data management software package. SPSS can take data from almost any type.
Introduction to SPSS Short Courses Last created (Feb, 2008) Kentaka Aruga.
Time Series and Forecasting
CHAPTER 18 Models for Time Series and Forecasting
Regression Method.
Microsoft Excel Diane M. Coyle Spring 2009 CS 105.
XP Abdul Hameed 1 Microsoft Office Excel 2013 Tutorial 2 – Working With Formulas and Functions.
Class Meeting #11 Data Analysis. Types of Statistics Descriptive Statistics used to describe things, frequently groups of people.  Central Tendency 
Basic Excel Tutorial Session. Agenda 1. Basics 3. Formula & Functions4. Charts 2. Format.
The Examination of Residuals. The residuals are defined as the n differences : where is an observation and is the corresponding fitted value obtained.
Branching Instructions1 Conditional Statements There are two forms of the IF instruction %if(x,y,z) –if condition x is true, then y, else z –Example: SET.
1 1 Slide © 2004 Thomson/South-Western Slides Prepared by JOHN S. LOUCKS St. Edward’s University Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
CHAPTER 14 MULTIPLE REGRESSION
Pure Serial Correlation
Introduction to MATLAB ENGR 1181 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
Copyright © 2015 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
EViews Training Samples
The Examination of Residuals. Examination of Residuals The fitting of models to data is done using an iterative approach. The first step is to fit a simple.
Lecture 7: Forecasting: Putting it ALL together. The full model The model with seasonality, quadratic trend, and ARMA components can be written: Ummmm,
Chap 14-1 Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc. Chapter 14 Additional Topics in Regression Analysis Statistics for Business.
School of Information - The University of Texas at Austin LIS 397.1, Introduction to Research in Library and Information Science LIS Introduction.
Introduction to SPSS. Object of the class About the windows in SPSS The basics of managing data files The basic analysis in SPSS.
HAWKES LEARNING SYSTEMS Students Matter. Success Counts. Copyright © 2013 by Hawkes Learning Systems/Quant Systems, Inc. All rights reserved. Section 12.3.
CORRELATION. Correlation key concepts: Types of correlation Methods of studying correlation a) Scatter diagram b) Karl pearson’s coefficient of correlation.
1 Ka-fu Wong University of Hong Kong EViews Commands that are useful for Assignment #2.
Structured Programming I – Relational & Logical Operators Objectives: By the end of this class you should be able to: Change graph interactively in EXCEL.
LINREG linreg(options) depvar start end residuals # list where: depvar The dependent variable. start endThe range to use in the regression. The default.
XP 1 Microsoft Office Excel 2003 Working With Formulas and Functions.
Module 4 Forecasting Multiple Variables from their own Histories EC 827.
1 Faculty Name Prof. A. A. Saati. 2 MATLAB Fundamentals 3 1.Reading home works ( Applied Numerical Methods )  CHAPTER 2: MATLAB Fundamentals (p.24)
Introduction to Eviews Eviews Workshop September 6, :30 p.m.-3:30 p.m.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
Analysis of financial data Anders Lundquist Spring 2010.
Chapter 4: Basic Estimation Techniques
Chapter 4 Basic Estimation Techniques
ECE 1304 Introduction to Electrical and Computer Engineering
Correlation and Simple Linear Regression
Basic Estimation Techniques
DEPARTMENT OF COMPUTER SCIENCE
Multiple Regression.
Correlation and Simple Linear Regression
Statistical Analysis with Excel
Basic Estimation Techniques
Statistical Analysis with Excel
6-1 Introduction To Empirical Models
Correlation and Simple Linear Regression
Eviews Tutorial for Labor Economics Lei Lei
Vector AutoRegression models (VARs)
Simple Linear Regression and Correlation
Working with Formulas and Functions
Correlation and Simple Linear Regression
Correlation and Simple Linear Regression
Presentation transcript:

Preparing the Data1 RATS Dialog Interface WINDOWS: It is most convenient to use RATS using two windows: one for input and the other for output. When you begin RATS, the ACTIVE, OUTPUT, and INPUT are identical. This Window is NONAME00.TXT If you open a second window without closing NONAME.TXT the new window will become the ACTIVE window, but not the input or output window. If yow want to use this new window for input and/or output, use the Window-Use for Input or the Window-Use for Output commands listed on the WINDOW menu. The Window-Tile command, makes the multiple windows visible. You can switch between windows using the mouse, menu or using

Preparing the Data2 RATS Dialog Interface: II LOCAL MODE: Allows you to enter commands or instructions, without execution taking place. Thus, you can use RATS as a wordprocessor. This is a toggle: the second returns you to ready mode. SELECT TEXT: CUT, COPY, PASTE: Use the mouse or use the SHIFT key in conjunction with the arrow keys or the PgUp or PgDn keys to mark text. Marked text can be cut, pasted, or copied using the EDIT menu. Note that is equivalent to Cut, is equivalent to Copy, and is equivalent to Paste. COMPOUND INSTRUCTIONS: Certain instructions have supplementary cards (e.g., the GRAPH Command). If you make an error on a supplementary card, you must reenter the entire instruction from the beginning.

Preparing the Data3 RATS Dialog Interface: III ONLINE HELP: You can get online help from the HELP Pull-Down Menu. You can get help on the specific RATS Instructions using the F1 key. PRINTING GRAPHS: To print a graph, you use the PRINT command from the FILE menu. RATS will print only the material in the currently shown window. As such, the graph window must be shown on the screen. SAVING YOUR WORK: It is possible to save your program on to a disk using the SAVE or the SAVE AS command on the FILE menu. As such, you will not have to retype your commands the next time you use RATS. Simply use the OPEN command from the FILE menu to begin your next session. (Be sure the new program is in the active window!).

Preparing the Data4 The file labeled MONEY_DEM.XLS contains quarterly values of seasonally adjusted U.S. nominal GDP, real GDP in 1996 dollars (RGDP), the money supply as measured by M2 and M3, and the 3-month and 1-year treasury bill rates for the period 1959:1 – 2001:1. Both interest rates are expressed as annual rates and the other variables are in billions of dollars cal all 2001:1 open data c:\money_dem.xls data(org=obs,format=xls)

Preparing the Data5 Calendar calendar year period frequency or cal(q) 1959:1 where:year The year of the first entry in the data set periodThe period of the first entry in the data set frequencyThe number of observations per year. Examples: For monthly data beginning with February 1973, use calendar For semiannual data beginning with July 1973, use calendar For annual data it is permissible to use only the starting year. As such, you can omit the period and frequency and use the more compact calendar 1973 instead of calendar

Preparing the Data6 Calendar II CALENDAR(DAILY) year month day Sets date of first entry for business-day (5-day per week) daily data. CALENDAR(PERDAY=# of periods) year month day Sets starting date, frequency, and the number of periods per day for intraday data calendar(a) year:1 Annual calendar(q) year:quarter Quarterly calendar(b) year:month:day Biweekly calendar(w) year:month:day Weekly calendar(d) year:month:day Daily (5/week) calendar(7) year:month:day Daily (7/week)

Preparing the Data7 Allocate In older versions, it was necessary to use ALLOCATE immediately following CALENDAR. However, in new versions it is convenient, but not necessary. Examples: –For monthly data ending with April 1990 use allocate 1990:4. For monthly data ending with December 1990, use allocate 1990:12.

Preparing the Data8 Open and DATA The OPEN and DATA statements are used together. data(format=xls,org=obs) start end series where: start end Range of entries to read. seriesThe list of series to read. (If series is omitted, all variables in the data set are read into memory) Notice the slash (/) in the DATA instruction. In RATS, you can set the range explicitly or use a slash to refer to the default range. Example: cal(q) 1960:1 all 2012:4 open data quarterly(2012).xls data(org=obs,format=xls)

Preparing the Data9 Form of the Data Sets DATE Tb3mo Tb1yr RGDP Potent Deflator M2 PPI Curr 1960Q Q Q Q Q Q Q Q

Preparing the Data10 Sample Statistics Table table(picture="*.##") statistics Tb3mo table / tb3mo tb1yr print / tb3mo tb1yr

Preparing the Data11 SET set series start end = function(T) 1. A slash (/) or the omission of start end both default to the maximum permissible range as indicated on ALLOCATE. 2. If you make a mistake, RATS will create missing values instead of an error message whenever possible. THIS CAN BE A PROBLEM IF YOU ARE UNAWARE OF THE MISTAKE! 3.You must use a space before and after the equal sign. 4.RATS accepts addition (+), subtraction (-), multiplication (*), division (/), and exponentiation (**) using the usual order of precedence. 5.ABS(X), EXP(X), LOG(X), and SQRT(X) are used to denote the absolute value, exponential value (i.e., e x ), natural logarithm, and square root of the argument X, respectively. 6.All levels of parentheses ( ) are supported but you cannot use braces { } or brackets [ ] in place of parentheses.

Preparing the Data12 SET: II RATS allows you to use braces { } as a shorthand way to represent time subscripts; you can use series{lag} in place of series(t-lag). Examples: –Instead of using y(t-1), you can use y{1}. The number placed in the braces { } indicates the lag number. –A negative number in braces indicates a leading value of the variable so that y(t+2) and y{-2} are equivalent ways to write the second lead of y. –Also, the notation {A to B} can be used to indicate lags A through B so that y{1 to 4} indicates the first four lags of ja.

Preparing the Data13 Set: III set dlrgdp = log(rgdp) - log(rgdp{1}) set dlm2 = log(m2) - log(m2{1}) set drs = tb3mo - tb3mo{1} set dr1 = tb1yr - tb1yr{1} set dlp = log(deflator) - log(deflator{1}) set dlppi = log(ppi) - log(ppi{1})

Preparing the Data14 Set: IV Shortcuts –log y / ly –difference y / y You must define the start end range or use the slash (/) on the DIFFERENCE statement. Unlike the SET statement, if you explicitly define the range, you must allow for the number of lags created. –exp y / ey –seasonal seasons –set trend = t

Preparing the Data15 Graph GRAPH(Options) number # series start end symbol choice (one for each series) number: number of series to graph Options STYLE=[LINE]/POLYGON/BAR/STACKEDBAR/OVERLAPBAR/ VERTICAL/STEP/SYMBOL PATTERNS/[NOPATTERNS] HEADER='string' SUBHEADER='label‘ HLABEL='label' VLABEL='label‘ NODATES (RATS will label the horizontal axis unless the NODATES option is specified.) KEY=[NONE]/UPLEFT/UPRIGHT/LOLEFT/LORIGHT/ABOVE/BELOW/ LEFT/RIGHT OVERLAY=[LINE]/POLYGON/BAR/STACKEDBAR/OVERLAPBAR /VERTICAL/STEP/SYMBOL OVCOUNT=Number of series for right-side scale [1]

Examples graph(header="The Interest Rates",key=below) 2 # tb3mo ; # tb1yr graph(hea="Real and Potential GDP",key=upleft) 2 # rgdp ; # potent Preparing the Data16

Preparing the Data17 Multiple Graphs per Page SPGRAPH(hfields=,vfields=,header = ‘ ‘, subheader = ‘ ‘) : Spgraph(Done) Example: SPGRAPH(HFIELDS=2,VFIELDS=2) Graph 1 # x1 …. Graph 1 # x4 SPGRAPH(DONE)

Preparing the Data18 spgraph(footer="Graphs of the Series",hfields=2,vfields=2) graph(header="Panel 1: The Interest Rates",key=below,nokbox) 2 # tb3mo ; # tb1yr graph(header="Panel 2: Real and Potential GDP",key=upleft) 2 # rgdp ; # potent graph(header="Panel 3: Time path of money growth",noaxis) 1 # dlm2 graph(header="Panel 4: Time path of Inflation",noaxis) 1 # dlp spgraph(done)

Preparing the Data19 Scatter Diagrams SCATTER(Options) pairs # x-series y-series start end The important options are the same as those for Graph Instruction NOTE: ON COMPOUND STATEMENTS LIKE GRAPH AND SCATTER, IT YOU MAKE A MISTAKE ON THE SECOND LINE, YOU MUST RE- ENTER THE FIRST LINE.

Preparing the Data20 Linear Regression Suppose you want to estimate the regression lin drs / resids # constant drs{1 to 7}

Preparing the Data21 LINREG linreg(options) depvar start end residuals # list where: depvar The dependent variable. start endThe range to use in the regression. residuals(Optional) Series name for the residuals. listThe list of explanatory variables.

Preparing the Data22 Linear Regression - Estimation by Least Squares Dependent Variable DRS Quarterly Data From 1962:01 To 2012:04 Usable Observations 204 Degrees of Freedom 196 Centered Rˆ R-Barˆ Uncentered Rˆ Mean of Dependent Variable Std Error of Dependent Variable Standard Error of Estimate Sum of Squared Residuals Regression F(7,196) Significance Level of F Log Likelihood Durbin-Watson Statistic Variable Coeff Std Error T-Stat Signif ************************************************************************************ 1. Constant DRS{1} DRS{2} DRS{3} DRS{4} DRS{5} DRS{6} DRS{7}

Preparing the Data23 LINREG: II The most useful options are: DEFINE = Name the equation by setting DEFINE = ‘NAME NOPRINTDo not print the regression output. VCVPrint the covariance/correlation matrix of the coefficients. LINREG creates a number of variables that you can use in subsequent computations. A partial list of these variables is: %BETA The coefficient vector. The first coefficient estimated is %BETA(1), the second %BETA(2), and so on. %tstats %NDF Degrees of freedom %NOBSNumber of observations. %NREG Number of regressors. %RSSResidual sum of squares. %RSQUAREDCentered R 2 (i.e, the usual measure of R 2 ) %SEESQStandard error of estimate squared

Preparing the Data24 Correlations CORRELATE: Calculates the autocorrelations (and the partial autocorrelations) of a specified series. The syntax and principal options are: correlate(options) series start end where: series The series used to compute the correlations. start endThe range of entries to use. The default is the entire series. The principal options are: NUMBER= The number of autocorrelations to compute. PARTIAL=Series for the partial autocorrelations. QSTATSUse this option if you want the Ljung-Box Q-statistics. DFC=Degrees of freedom correction. SPAN=Use with qstats to set the width of the intervals tested. For example, with quarterly data, you can set span = 4, to obtain Q(4), Q(8), Q(12), and so forth.

Preparing the Data25 correlate(options) series start end where: series The series used to compute the correlations. start endThe range of entries to use. The default is the entire series. corrsSeries used to save the autocorrelations (Optional). The principal options are: NUMBER= The number of autocorrelations to compute. The default is the integer value of one-fourth the total number of observations. PARTIAL=Series for the partial autocorrelations. If you omit this option, the PACF will not be calculated. QSTATSUse this option if you want the Ljung-Box Q-statistics. SPAN=Use with qstats to set the width of the intervals tested. For example, with quarterly data, you can set span = 4, to obtain Q(4), Q(8), Q(12), and so forth. In the example at hand, we can obtain the first twelve autocorrelations, partial autocorrelations (and the associated Q-statistics) of the residuals with: cor(number=12,partial=partial,qstats,span=4) resids

Preparing the Data26 Restrictions 1. Exclusion and Sum Restrictions Examples: exclude # drs{5 to 7} exclude # constant drs{5 to 7} summarize # drs{5 to 7}

Preparing the Data27 TEST: Individual Coefficient Restrictions 2. Test This instruction contains three lines: TEST # list of coefficients to be restricted # constants against which coeff. are tested Example: To test if beta(6) = 0.1, beta(7) = 0.1 and %beta(8) = 0., use: test # # To test the restriction that the constant equals zero and that  5 = 0.1,  6 = 0.1, and  7 = 0.1, use: test # #

Preparing the Data28 Restrict 3. RESTRICT can test multiple linear restrictions on the coefficients and estimate the restricted model. Each restriction is entered in the form: β i a i + β j a j β k a k = r where: a i are the coefficients of the estimated model (i.e., each coefficient is referred to by its assigned number). β i are weights you assign to each coefficient. r represents the restricted value of the sum

Preparing the Data29 Restrict: II Examples 1. To test the joint restriction that a 2 + 2a 3 = 0 (i.e., 1.0*a *a 3 = 0), use: restrict 1 # 2 3 # To test the joint restriction that a 2 + 2a 3 = 0 (i.e., 1.0*a *a 3 = 0), use: restrict 1 # 2 3 # restrict(create) 2 resids # # # 2 3 # 1 ‑ 1 0

Preparing the Data30 Forecast FORECAST: Creates dynamic forecasts of a previously defined equation. FORECAST uses a supplementary card for each equation in the system. In univariate forecasting, the typical syntax for FORECAST is: forecast(print) number steps start # equation forecasts where: number The number of equations in the system. In univariate forecasting, number is necessarily equal to 1. stepsThe number of forecasts to create. startThe starting period of the forecasts. equationThe name of the previously defined equation. forecastsThe name of the series in which you want to save the forecasts. This field is optional.

Preparing the Data31 Forecast: II Example: lin(define=eq1) rcons 1947:1 1997:2 resids # constant trend t3 t4 t5 forecast(print) :3 # eq1 fore