Sie sind auf Seite 1von 2

Computer Session 1 for Econ107

YU Jun

How to use Notepad to create and edit an ASCII file

Notepad is a basic text editor that you can use to create simple documents. The most common use
for Notepad is to view or edit text (.txt) files. Now lets try to create a new file called mydata1.txt
with two variables, X and Y, where X=1,2,3,4,5 and Y=2,3,5,6,9.
1. Open Notepad by click on Start/All Programs/Accessories/Notepad.
2. Type x, press Tab, and then type y, so that there is enough space between xand y.
Press Enter.
3. Type 1, press Tab, and then type 2. Press Enter.
4. Type 2, press Tab, and then type 3. Press Enter.
5. Type 3, press Tab, and then type 5. Press Enter.
6. Type 4, press Tab, and then type 6. Press Enter.
7. Type 5, press Tab, and then type 9. Press Enter.
8. Click on File/Save as. Click on Desktop and type mydata1. The data that we just typed in
are now stored into a file called mydata1.txt.

How to use Excel to create and edit a data file

Excel is a program in the Microsoft Office Suite that creates spreadsheets. A spreadsheet is the
computer equivalent of a paper ledger sheet. It consists of a grid made from columns and rows. It
is an environment that can make number manipulation easy and somewhat painless.

One of the most common uses for Excel is to view or edit .xls files. Now lets try to create a new
file called mydata1.xls with two variables, X and Y, where X=1,2,3,4,5 and Y=2,3,5,6,9. Suppose
these two series are annual observations from 1961 to 1965.
1. Open Excel by click on Start/All Programs/Microsoft Excel.
2. Type OBS in row 1 and column 1, x in row 1 and column 2 and y in row 1 and
column 3.
3. Type 1961 in row 2 and column 1, 1 in row 2 and column 2 and 2 in row 2 and
column 3.
4. Type 1962 in row 3 and column 1, 2 in row 3 and column 2 and 3 in row 3 and
column 3.
5. Type 1963 in row 4 and column 1, 3 in row 4 and column 2 and 5 in row 4 and
column 3.
6. Type 1964 in row 5 and column 1, 4 in row 5 and column 2 and 6 in row 5 and
column 3.
7. Type 1965 in row 6 and column 1, 5 in row 6 and column 2 and 9 in row 6 and
column 3.
8. Click on File/Save as. Click on Desktop and type mydata1. The data that we just typed
in are now stored into a file called mydata1.xls.

1
How to use Eviews

Empirical application on EViews:

We will learn how to load data into Eviews. Click on Start/Run and type \\gps02\eviews4 if you
wish to use Eviews4 or \\gps02\eviews5 if you wish to use Eview5. Right click on Eviews4.exe
or Eviews5.exe and then click on Send To/Desktop (create shortcut). A shortcut for Eviews is
created.

Loading a .txt file

1. Double click on Eviews4.exe or Eviews5.exe to open Eviews. Choose File/New/Workfile.


To set work frequency, select the Undated or irregular (or Integer data for Eviews5) option
with a start-date of 1 and an end-date of 5 and click on OK
2. Now read in the data. To do this use Procs/Import/Read Text-Lotus-Excel and double
click on the file mydata1.txt
3. In the large empty box name the series we will work with, x y, and click on OK
4. The data should be checked by double clicking on x or y and choosing View/Line Graph to
make sure there are no obvious problems
5. To view these two series, click on x. And then press ctrl key and hold it, at the same time
click on y. Right click and select Open as Group. You can see a pairwise comparison of them.
Choose View/Graph/Scatter/Simple Scatter to plot the scatter diagram.
6. Close everything (you may choose to save the Eviews workfile into, say, myworkfile1, before
you quite Eviews).

Loading an .xls file

7. Double click on Eviews4.exe or Eviews5.exe to open Eviews. Choose File/New/Workfile. In


To set frequency, select the Annual option with a start-date of 1961 and an end-date of 1965
and click on OK
8. Now read in the data. To do this use Procs/Import/Read Text-Lotus-Excel and double
click on the file mydata1.xls (Do make sure the file you try to load is not opened by Excel).
9. In the large empty box name the series we will work with, x y, and click on OK
10. The data should be checked by double clicking on x or y and choosing View/Line Graph to
make sure there are no obvious problems
11. To view these two series, click on x. And then press ctrl key and hold it, at the same time
click on y. Right click and select Open as Group. You can see a pairwise comparison of them.
Choose View/Graph/Scatter/Simple Scatter to plot the scatter diagram.
12. Close everything (you may choose to save the Eviews workfile into, say, myworkfile1, before
you quite Eviews).

We will walk you through Chapter 1 of Johnson, A Guide to Using Eviews with Using
Econometrics.

Das könnte Ihnen auch gefallen