
- •Table of Contents
- •Foreword
- •Chapter 1. A Quick Walk Through
- •Workfile: The Basic EViews Document
- •Viewing an individual series
- •Looking at different samples
- •Generating a new series
- •Looking at a pair of series together
- •Estimating your first regression in EViews
- •Saving your work
- •Forecasting
- •What’s Ahead
- •Chapter 2. EViews—Meet Data
- •The Structure of Data and the Structure of a Workfile
- •Creating a New Workfile
- •Deconstructing the Workfile
- •Time to Type
- •Identity Noncrisis
- •Dated Series
- •The Import Business
- •Adding Data To An Existing Workfile—Or, Being Rectangular Doesn’t Mean Being Inflexible
- •Among the Missing
- •Quick Review
- •Appendix: Having A Good Time With Your Date
- •Chapter 3. Getting the Most from Least Squares
- •A First Regression
- •The Really Important Regression Results
- •The Pretty Important (But Not So Important As the Last Section’s) Regression Results
- •A Multiple Regression Is Simple Too
- •Hypothesis Testing
- •Representing
- •What’s Left After You’ve Gotten the Most Out of Least Squares
- •Quick Review
- •Chapter 4. Data—The Transformational Experience
- •Your Basic Elementary Algebra
- •Simple Sample Says
- •Data Types Plain and Fancy
- •Numbers and Letters
- •Can We Have A Date?
- •What Are Your Values?
- •Relative Exotica
- •Quick Review
- •Chapter 5. Picture This!
- •A Simple Soup-To-Nuts Graphing Example
- •A Graphic Description of the Creative Process
- •Picture One Series
- •Group Graphics
- •Let’s Look At This From Another Angle
- •To Summarize
- •Categorical Graphs
- •Togetherness of the Second Sort
- •Quick Review and Look Ahead
- •Chapter 6. Intimacy With Graphic Objects
- •To Freeze Or Not To Freeze Redux
- •A Touch of Text
- •Shady Areas and No-Worry Lines
- •Templates for Success
- •Point Me The Way
- •Your Data Another Sorta Way
- •Give A Graph A Fair Break
- •Options, Options, Options
- •Quick Review?
- •Chapter 7. Look At Your Data
- •Sorting Things Out
- •Describing Series—Just The Facts Please
- •Describing Series—Picturing the Distribution
- •Tests On Series
- •Describing Groups—Just the Facts—Putting It Together
- •Chapter 8. Forecasting
- •Just Push the Forecast Button
- •Theory of Forecasting
- •Dynamic Versus Static Forecasting
- •Sample Forecast Samples
- •Facing the Unknown
- •Forecast Evaluation
- •Forecasting Beneath the Surface
- •Quick Review—Forecasting
- •Chapter 9. Page After Page After Page
- •Pages Are Easy To Reach
- •Creating New Pages
- •Renaming, Deleting, and Saving Pages
- •Multi-Page Workfiles—The Most Basic Motivation
- •Multiple Frequencies—Multiple Pages
- •Links—The Live Connection
- •Unlinking
- •Have A Match?
- •Matching When The Identifiers Are Really Different
- •Contracted Data
- •Expanded Data
- •Having Contractions
- •Two Hints and A GotchYa
- •Quick Review
- •Chapter 10. Prelude to Panel and Pool
- •Pooled or Paneled Population
- •Nuances
- •So What Are the Benefits of Using Pools and Panels?
- •Quick (P)review
- •Chapter 11. Panel—What’s My Line?
- •What’s So Nifty About Panel Data?
- •Setting Up Panel Data
- •Panel Estimation
- •Pretty Panel Pictures
- •More Panel Estimation Techniques
- •One Dimensional Two-Dimensional Panels
- •Fixed Effects With and Without the Social Contrivance of Panel Structure
- •Quick Review—Panel
- •Chapter 12. Everyone Into the Pool
- •Getting Your Feet Wet
- •Playing in the Pool—Data
- •Getting Out of the Pool
- •More Pool Estimation
- •Getting Data In and Out of the Pool
- •Quick Review—Pools
- •Chapter 13. Serial Correlation—Friend or Foe?
- •Visual Checks
- •Testing for Serial Correlation
- •More General Patterns of Serial Correlation
- •Correcting for Serial Correlation
- •Forecasting
- •ARMA and ARIMA Models
- •Quick Review
- •Chapter 14. A Taste of Advanced Estimation
- •Weighted Least Squares
- •Heteroskedasticity
- •Nonlinear Least Squares
- •Generalized Method of Moments
- •Limited Dependent Variables
- •ARCH, etc.
- •Maximum Likelihood—Rolling Your Own
- •System Estimation
- •Vector Autoregressions—VAR
- •Quick Review?
- •Chapter 15. Super Models
- •Your First Homework—Bam, Taken Up A Notch!
- •Looking At Model Solutions
- •More Model Information
- •Your Second Homework
- •Simulating VARs
- •Rich Super Models
- •Quick Review
- •Chapter 16. Get With the Program
- •I Want To Do It Over and Over Again
- •You Want To Have An Argument
- •Program Variables
- •Loopy
- •Other Program Controls
- •A Rolling Example
- •Quick Review
- •Appendix: Sample Programs
- •Chapter 17. Odds and Ends
- •How Much Data Can EViews Handle?
- •How Long Does It Take To Compute An Estimate?
- •Freeze!
- •A Comment On Tables
- •Saving Tables and Almost Tables
- •Saving Graphs and Almost Graphs
- •Unsubtle Redirection
- •Objects and Commands
- •Workfile Backups
- •Updates—A Small Thing
- •Updates—A Big Thing
- •Ready To Take A Break?
- •Help!
- •Odd Ending
- •Chapter 18. Optional Ending
- •Required Options
- •Option-al Recommendations
- •More Detailed Options
- •Window Behavior
- •Font Options
- •Frequency Conversion
- •Alpha Truncation
- •Spreadsheet Defaults
- •Workfile Storage Defaults
- •Estimation Defaults
- •File Locations
- •Graphics Defaults
- •Quick Review
- •Index
- •Symbols

Chapter 16. Get With the Program
EViews comes with a built-in programming language which allows for very powerful and sophisticated programs. Because the language is very high level, it’s ideal for automating tasks in EViews.
Hint: Because EViews’ programming language is very high-level, it’s not very efficient for the kind of tasks which might be coded in C or Java.
Hint: To become a proficient author, you read great literature. In the same vein, to become a skilled EViews programmer you should read EViews programs. EViews ships with a variety of sample programs. You can find them under Help/Quick Help Reference/Sample Programs & Data. Appendix: Sample Programs at the end of these chapters includes several of the sample programs with annotations.
I Want To Do It Over and Over Again
If you have repetitive tasks, create an EViews program and run it as needed. EViews programs are not objects stored in the workfile. You don’t make them with Object/New Object…. An EViews program is held either in a program window created with File/New/Program or in a text file on disk ending with the extension “.prg”.
Hint: Clicking the button in a program window saves the file to disk with the extension “.prg”. But you’re free to create EViews programs in your favorite text editor or any word processor able to save standard ASCII files.
The program window at the right holds three standard commands. Every time you click these three commands are executed.

382—Chapter 16. Get With the Program
Hint: If you choose the Quiet radio button in the Run Program dialog (not shown here; see below), programs execute faster and more peacefully. But Verbose is sometimes helpful in debugging.
As a practical matter, you probably don’t want to run the same regression on the same series over and over and over. On the other hand, you might very well want to apply the same data transformation to a number of different data sets. For example, the Current Population Survey (CPS) records various measures of educational attainment, but doesn’t provide a “years of education” variable. The program “transformcps_ed.prg” translates the series A_HGA that appears in the data supplied in the CPS into years of education, ED. When new CPS data are released each March, we can run transformcps_ed again to re-create ED.
Documentary Hint: It’s sometimes important to keep a record of your analysis. While you can print lines typed in the command pane, or save them to disk as “COMMAND.log”, point-and-click operations aren’t recorded for posterity. Entering commands in a program and then running the program is the best way to create an audit trail in EViews.
Documentation Hint: Anything to the right of an apostrophe in a program line is treated as a comment. Writing lots of comments will make you happy later in life.
You Want To Have An Argument
You might want to run the same regression over and over again on different series. Our first program regressed LNWAGE on ED and then looked to see if there is a relation between the squared residuals and ED. Suppose we want to execute the same procedure with AGE and then again with UNION as the right-hand side variable.

Program Variables—383
Instead of writing three separate programs, we write one little program in which the right-hand side variable is replaced by an evaluated string variable argument. In an EViews program:
•A string variable begins with a “%” sign, holds text, and only exists during program execution. You may declare a string variable by entering
the name, an equal sign, and then a quote delimited string, as in:
%y = "abc"
•EViews automatically defines a set of string variables using arguments passed to the program in the Program arguments (%0 %1…) field of the Run Program dialog. The string variable %0 picks up the first string entered in the field. The string variable %1 picks up the second string. Etc.
•You may refer to a string variable in a program using its name, as in “%Y”. EViews will replace the string value with its string contents, “ABC”. In some settings, we may be interested, not in the actual string variable value, but rather in an object named “ABC”. An evaluated string is a string variable name placed between squiggly braces, as in “{%0}”, which tells EViews to use the name, names, or name fragment given by the string value.
For example, if we enter “age” in the Run Program dialog, EViews will replace “{%0}” in the program lines,
ls lnwage c {%0}
series e = resid
ls e^2 c {%0}
and then execute the following commands:
ls lnwage c age
series e = resid
ls e^2 c age
If we had entered UNION in the dialog, the regressions would have been run on UNION instead of AGE.
Program Variables
String variables live only while a program is being executed. They aren’t stored in the workfile. While they live, you can use all the same string operations on string variables as you can on an alpha series.

384—Chapter 16. Get With the Program
Hint: A string variable in a program is a single string—not one string per observation, as in an alpha series.
Hint: If you want to keep your string after the program is executed and save it in the workfile, you should use put it into a string object.
In addition to string variables, programs also allow control variables. A control variable holds a number instead of a string, and similarly lives only while the program is alive. Control variables begin with an “!” as in “!I”.
Hint: And if you want to keep your number after the program is executed and save it in the workfile, you should use put it into a scalar object.
String and control variables and string and scalar objects can be defined directly in a program.
Hint: When read aloud, the exclamation point is pronounced “bang,” as in “bang eye.”
We’ve written a slightly silly program which runs four regressions, although the real purpose is to illustrate the use of control variables. Running this program is equivalent to entering the commands:
smpl if fe=0 ls lnwage c ed smpl if fe=1 ls lnwage c ed smpl if fe=0
ls lnwage c age smpl if fe=1
ls lnwage c age