Top Banner
Introduction: EViews Dr. Peerapat Wongchaiwat [email protected]
19

EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

May 25, 2018

Download

Documents

doankiet
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

Introduction: EViews

Dr. Peerapat Wongchaiwat [email protected]

Page 2: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

Today’s Workshop

• Basic grasp of how EViews manages data

• Creating Workfiles

• Importing data

• Running regressions

• Performing basic tests

• Creating/changing Series

• Working with commands

Page 3: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

Thinking About EViews • Workfile

Central place to keep

all of your work

• Objects

– Series (Numeric, no alpha series in student version)

– Equations

– Graphs

– Groups

*Always comes with series for a constant, c, and residuals, resid

Page 4: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

Workfiles

• Creating a Workfile

– File → New → Workfile

• Data Structure

Time Series → Dated/Regular → Frequency + Date Range

Cross-Sectional → Undated/Irregular → Range of observations

• Save & Name (do not have to do this for this exercise)

• New Pages (Eviews 6)

– By clicking on the “New Page” label at the bottom of the Workfile you can create new pages • Select “By Frequency”

Page 5: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

Importing Data

• Copy/Past Method 1. Open new “Empty Group”

• Quick → Empty Group • Click on Cell 1 and press the “Up” arrow on keyboard

2. Open Excel

• Make sure variable names are one constant “String” (no spaces!) • Troubleshoot for other problems

3. Copy Data 4. Paste into Eviews Cell 1

Page 6: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

Importing Data • Import Directly

1. Count the number of variables and CLOSE Excel file 2. Proc →Import →Read Text-Locus-File 3. Browse for Excel file 4.

Page 7: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

Descriptive Statistics

• Group

– Stores select series together

– Object → New Object → Group → Select Series → Name

• Descriptive Statistics

– When group spreadsheet is open:

– View → Descriptive Statistics → Common Sample

→ Correlogram

Page 8: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

• Create a new Equation

– In your Workfile:

– Object → New Object → Equation

Separated by spaces: *Dependent variable *Constant, c *Independent variables (or Group)

Regressions

Sample Range

Type of Regression

Page 9: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

• Output

• Name = Save to Workfile

Regression Tests & Fixes

Estimate: Modify Regression

This View

Useful to Create Model

To Run Tests

Regression Summary

Coefficient Summary

Statistics

SAVE!

Page 10: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

• Looking at Residuals

– In Equation View:

– View → Actual, Fitted, Residual → Actual, Fitted, Residual Table

• Plotting Resid Vs. Fitted Values

– Generate fitted values

– In Equation View: “Forecast” → OK (is named “variable”f)

– In Workfile: Object → New Object → Graph

• Graph: resid “variable”f

• Options → Type → Scatter

Regression Tests & Fixes

Page 11: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

• Heteroskedasticity

– In Equation View:

– View → Residual Tests → White Heteroskedasticity (no cross)

– Look at Chi-square value from a table (want a small value)

– Fix: Click on “Estimate” • Click on “Options” → check box for “Heteroskedasticity consistent

coefficient covarariance” → OK

Regression Tests & Fixes

Page 12: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

• Normality

– View → Residual Tests → Histogram-Normality Test

– Look at Jarque-Bera stat (H0: Normal distribution)

– Fix: Depending on skew, you can adjust variables (ex: square, log, etc) or add/delete variables

Regression Tests & Fixes

Page 13: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

• Correlation & Multicolinearity

– Create Correlation Matrix:

– Quick → Group Statistics → Correlations

– Off-diagonal values should be less than 0.5

– Fix: Talk to your advisor

Regression Tests & Fixes

Page 14: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

Changing/Creating Variables

• Edit Mode

– In Spreadsheet: Toggle “Edit+/-”

– CAREFUL! No “undo”

• Generate new variable

– In Workfile:

• Click on “Genr”

• Enter equation:

“new variable name” = equation

• Regular math function keys

• Lag: variable(-1)

Page 15: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

Commands

• Top, Left-Hand “Command Box”

• Single commands

• Batch (program)

• Syntax:

Command (Option) Argument

Page 16: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

Commands

• Frequently Used Commands:

– show variable

– genr variable = equation

– sample n1 n2

• n1 and n2 represent the start and end of range

• Or qualifiers such that:

sample variable if >15

• Statistical Operations:

– equation name .ls(h) dependent c independent variables

– cor variables

– group variables

Page 17: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

Help!

• For general instruction or commands:

– EViews PDFs !

– Help → Users Guide (pdf)

→ Command & Programming Reference (pdf)

Page 18: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

# Exercise # • Import data

• Run Descriptive Statistics

• Run Simple regression

GDP = c + a*Cp + resid

• Plot fitted values vs. residuals

• Check for Heteroskedasticity and fix if necessary

• Check for Multicolinearity

• Check for Normality

Page 19: EViews - Kasetsart Universityfin.bus.ku.ac.th/135512 Economic Environment for Finance/Lecture...Introduction: EViews Dr. Peerapat Wongchaiwat ... •New Pages (Eviews 6) ... Fitted

All Done!