5
'ECONOMICS: ON-LINE AND INTERACTIVE"- SOME COMMENTS M. ABDULLAH SHIBU* The first part of this note discusses some of the advantages of using canned programs such as SAS and Minitab. Somre pack- ages (a) save time and efirt; (b) allow f i r more eflcient use of computer resources; and (c) are useful toolsfir both the beginner as well as the seasoned user. The second part compares two pro- gramming languages: BASIC in the program mode and APL in the interactive mode. Using programs written to calculate GNP and multiple regmssion coeflcients as refirence points, it argues that BASIC programs are easier to follow and edit. 1. INTRODUCTION In a recent paper, Wykoff [1989] expresses some critical views on "canned" programs, such as SAS, SPSS, etc., and advocates that students and researchers use an on-line interactive language such as APL to handle their computing needs. He deserves credit for focusing on this aspect of the on-going discussion in academia on use of computers in teaching. While some of Wykoff 's comments about "non-intellectual activity and sloppy hab- its" fostered by canned programs are valid, I shall in this note make the following points: 1. In many cases, the advantages of using the canned programs far out- weigh the disadvantages; and 2. students and researchers who like to be creative and like to know what they are doing, will find (a) the programming mode in any language, and (b) BASIC programming language easier to use and understand in order to ac- complish the tasks and goals Wykoff outlines. II. ARGUMENTS FOR CANNED PROQRAMS Why do we, both as researchers and teachers, use canned programs such as SAS, MINITAB or LOTUS 1-2-3, to cite a few examples? In this section I will try to answer this question, and show that if properly used these pro- grams have a leg up on customized programs. First of all, for someone in a hurry who needs the results of regression analysis but has no time to write a program, canned programs come in very handy. In this respect, the argument for using a canned program is analogous Assistant Professor, Department of Business Administration, Stonehill College, North Easton, MA. I wish to thank Rob Carver, Virginia Polanski and Nasreen Shibli for comments on an earlier draft. 'Ibm Goodwin made some helpful suggestions. I retain full responsibility for errors. 640 Economic Inquiry Vol. XXVIII, July 1990.640-644

“ECONOMICS: ON-LINE AND INTERACTIVE”– SOME COMMENTS

Embed Size (px)

Citation preview

Page 1: “ECONOMICS: ON-LINE AND INTERACTIVE”– SOME COMMENTS

'ECONOMICS: ON-LINE AND INTERACTIVE"- SOME COMMENTS

M. ABDULLAH SHIBU*

The first part of this note discusses some of the advantages of using canned programs such as SAS and Minitab. S o m r e pack- ages (a) save time and efirt; (b) allow f i r more eflcient use of computer resources; and (c) are useful toolsfir both the beginner as well as the seasoned user. The second part compares two pro- gramming languages: BASIC in the program mode and APL in the interactive mode. Using programs written to calculate GNP and multiple regmssion coeflcients as refirence points, it argues that BASIC programs are easier to follow and edit.

1. INTRODUCTION

In a recent paper, Wykoff [1989] expresses some critical views on "canned" programs, such as SAS, SPSS, etc., and advocates that students and researchers use an on-line interactive language such as APL to handle their computing needs. He deserves credit for focusing on this aspect of the on-going discussion in academia on use of computers in teaching. While some of Wykoff 's comments about "non-intellectual activity and sloppy hab- its" fostered by canned programs are valid, I shall in this note make the following points:

1. In many cases, the advantages of using the canned programs far out- weigh the disadvantages; and 2. students and researchers who like to be creative and like to know what

they are doing, will find (a) the programming mode in any language, and (b) BASIC programming language easier to use and understand in order to ac- complish the tasks and goals Wykoff outlines.

II. ARGUMENTS FOR CANNED PROQRAMS

Why do we, both as researchers and teachers, use canned programs such as SAS, MINITAB or LOTUS 1-2-3, to cite a few examples? In this section I will try to answer this question, and show that if properly used these pro- grams have a leg up on customized programs.

First of all, for someone in a hurry who needs the results of regression analysis but has no time to write a program, canned programs come in very handy. In this respect, the argument for using a canned program is analogous

Assistant Professor, Department of Business Administration, Stonehill College, North Easton, MA. I wish to thank Rob Carver, Virginia Polanski and Nasreen Shibli for comments on an earlier draft. 'Ibm Goodwin made some helpful suggestions. I retain full responsibility for errors.

640 Economic Inquiry Vol. XXVIII, July 1990.640-644

Page 2: “ECONOMICS: ON-LINE AND INTERACTIVE”– SOME COMMENTS

SHIBLI: ON-LINE & INTERACTIVE--COMMENTS 641

to that for using a calculator. I can add, multiply or divide numbers in my mind (and am occasionally forced to do so when I misplace my calculator); however, I do not think that doing so on a regular basis is intellectually all that challenging. It is also inefficient, given the opportunity cost of my time. Nobody would possibly argue that using a calculator forces me into passivity.

Oftentimes, I do write my own programs for regression, time series or input-output analysis. However, once I have written a program and tested it, I use it like a pre-written or canned program-i.e. use it over and over again with different sets of data. However, this does not result in any more passivity than that resulting from using rules rather than the First Principles in calcu- lating derivatives in calculus, for example. The time and energy I save from using a software package goes into analyzing and interpreting the results and ensuring correct data entry.

Secondly, while an interactive language may allow you to do a few things, canned program have routines that would be hard to duplicate using an in- teractive language. For example, data sorting and merging, scatter diagrams, stem-and-leaf displays, box-plots, histograms, normal curves, and a whole bunch of other statistical analyses are made easier using a package. If I am teaching a course in economics or statistics and have time for only a few keystrokes, I would go with a canned software like LOTUS 1-2-3 or Minitab.

Thirdly, "canned" programs are not as inflexible as made out in Wykoff's paper. If a package does not have a routine to perform a certain statistical analysis, it is often not too hard to create macros for this purpose. For ex- ample, Minitab will not do moving averages, exponential smoothing or re- sidual plots. But simple programs can be written within Minitab to do these tasks. Admittedly, the average student in an economics or statistics course will not probably be able to write these programs. However, the structures of the programs are simple enough for them to see how these work, given a little help from the instructor.

Any tool can be misused and its goals frustrated unless it is handled properly. This is true for computers, multiple-choice tests, statistical tools or even on-line interactive programs. The pitfalls of using canned programs are known, and have been discussed, among others, by Shibli [1989]. It is the responsibility of the instructor to explain to the students how to make the best use of a statistical package, and how not to use it.' Teachers have to demonstrate through examples how to get the most out of packages, what are the pitfalls, etc. I, for one, always discourage students from turning in their printouts and recommend that they copy the results on to their papers.

1. In his reply, Wykoff [this issue] states that he is "distressed" that some colleagues submit 'highly technical but intellectually vacuous papers" and blames canned programs for this state of affairs. The causality between canned programs and vacuous papers is not at all clear to me. Rather, in light of my discussions in this paragraph, it appears that we ought to look elsewhere for the culprit; one possible area could be our graduate curricula-especially the econometrics programs (see McCloskey [1985, 1881).

Page 3: “ECONOMICS: ON-LINE AND INTERACTIVE”– SOME COMMENTS

642 ECONOMIC INQUIRY

This forces them to be familiar with the output and to know what they are looking for.

Finally, it is true that use of computers may often give the feel of a black-box. For example when you try X=INV(Y) in BASIC to invert Y matrix, you do not see how the inversion is done and have to take its cor- rectness as an article of faith. Similarly, many of the procedures in any canned program are blackboxy. This is the price one has to pay for the convenience. However, use of interactive on-line language is no less black- boxy. Take the example of the two functions in APL cited by Wykoff, the domino B and the +.X, for inversion and matrix multiplication, respectively. The user really does not see how these mathematical operations are carried out by the machine, but has to rely on the documentation from the software provider. These features are no different from a canned program. In fact, all higher level languages have pre-defined functions written in machine or some other language, and these modules are canned programs which one uses for efficiency.

111. PROGRAMMING VERSUS INTERACTIVE MODE

In this section, I shall argue first of all, that if one chooses to invest the time in learning a programming language for econometric work, one is better off using a clearly articulated language like BASIC or PASCAL in the pro- gramming mode, i.e. by writing a program and saving it. Secondly, even if one insists on using APL, one’s choice should be the programming mode in this language rather than the interactive mode, as Wykoff recommends. Let me illustrate these points by taking matrix operations in APL and BASIC.

For matrix operations, the user has to read in the array first. Unfortunately, the logic of the APL syntax to read an array may not be transparent to the beginner and is error-prone. The program or keystrokes to read the Q matrix in Wykoff [1989, 5501, as well as the corresponding module in BASIC is given below:

BASIC Version APL Version

110 DATA 850,175,210,45 175 210 45 880 190 205 20 120 DATA 880,190,205,20 200 MAT READ Q(3,4)

100 DATA 800,150,200,40 Q<-3 4p 800 150 200 40 850

Secondly, from this example one can also see that while APL takes less space, that is not necessarily an advantage: it must also be easily understood. For example, for someone writing a long program with a lot of data values or for someone working on a team project, the important goals are

1. the logic of the program should be easy to follow; 2. the lines of code must be clearly laid out; and

Page 4: “ECONOMICS: ON-LINE AND INTERACTIVE”– SOME COMMENTS

SHIBLl: ON-LINE & INTERACTIVE--COMMENTS 643

3. the program must be documented with comments for others to use and understand, as well as to make changes.

Thus, brevity of the code is of secondary importance to good articulation, and these features of a good program are similar to those emphasized in good writing. Referring to the APL version above, one notes that the order of the three keystrokes, 3 4p, could easily be mixed up unless one is very careful. Similarly the role of p (rho) is not very easy to see. The reader may wish to compare the full BASIC program for GNP calculation below with the cor- responding APL program. Again, if one looks at the regression program in BASIC (see below), one cannot but conclude that the programming mode allows one to write a program that is much better spelt out and easier to understand; the program logic and algorithm are also easier to follow than the APL version (Wykoff [1989, 552-541).

BASIC Programs Program to Calculate GNP 100 DATA 800,150,200,40 110 DATA 850,175,210,45 120 DATA 880,190,205,20 130 DATA 1, 2, 1.2 140 DATA 3, 4, 4.3 150 DATA 0.5, 0.7, 0.01 160 DATA 0.2, 0.1, 0.4 170 REM MATRICES DECLARED 180 DIM Q(3,4),P(4,3).GNP(3,3) 190 MAT READ Q(3,4) 200 PRINT\PRINT "QUANTITY" 210 MAT PRINT Q(3,4), 220 MAT READ P(4,3) 230 PRINT\PRINT "PRICE 240 MAT PRINT P(4,3), 250 PRINT\PRINT "GNP" 260 MAT GNP=Q*P ! GNP

CALCULATED 270 MAT PRINT GNP(3,3), 280 END

Program for Simple Regression 100 DATA 1,5

: (DATA STATEMENTS) 260 MAT READ C(8,2) 270 MAT READ Y(8.1) 290 MAT X=TRN(C) 310 REM WE CALCULATE [X'X] 320 MAT XPRIMEX=X*C 330 REM CALCULATE THE INVERSE 340 MAT XINV=INV(XPRIMEX) 345 REM XlNV IS THE INVERSE 350 REM FOLLOWING IS [X'Y] 360 MAT XPRIMEY=X*Y 370 PRINT "THE COEFFICIENT MATRIX 380 MAT COEFF=XINV*XPRIMEY 390 MAT PRINT COEFF, 400 END

Even a seasoned programmer often has difficulty in understanding some- one else's program, unless some basic rules are followed. Wykoff ascribes this difficulty to the user's "ignorance" [Wykoff, this issue]. However, a programming language is different from French or English-many program- ming languages do not have a uniform standard. In this respect, Yarmish writes, "...the logic of a solution developed by one programmer in his or her individual style may not necessarily be understood by others who have dif- ferent modes of approach to problem solution" [ 1989, 291.

Page 5: “ECONOMICS: ON-LINE AND INTERACTIVE”– SOME COMMENTS

644 ECONOMIC INQUIRY

The choice between using the interactive or the programming mode is often influenced by one's ability to write a line of code without making mistakes. Even the most experienced programmer makes errors. However, the ability to insert comments in a program, and the facility with which one can debug in program mode, as opposed to the interactive mode, improves the understanding and skills of a beginner as well as a seasoned programmer. In an interactive mode, whether in BASIC or APL, comments have no place since the program is volatile and is not saved for repeated applications. No one will deny that for a typical student, using a programming language

is a hassle. In addition, APL-type codes presuppose a level of dexterity with the language that the average economics or business major is unlikely to attain without taking a course or mini-course in APL. My point is, if someone has the time to learn a computer language, I do not see why she should choose an interactive language, or operate only in the interactive mode. If she does not have the time, then a canned program is definitely a better choice.

REFERENCES

McCloskey, Donald N. 'Economical Writing." Economic Inquiry, April 1985, 187-222. Shibli, M. Abdullah. "Use of Computers for Undergraduate Courses in Statistics for Business

and Economics." Paper presented at the 64th Annual Conference of Western Economic Association, June 18-22, 1989 (forthcoming in Computer Mucation)

Wykoff, Frank C. "Economics: On-line and Interactive." Economic Inquiry, July 1989, 547-54.

-. "Economic: On-line and Interactive-Reply." This Issue. Yarmish. Rina. 'Enhancing the Basic Language: Implications of the New ANSI Standard."

Academic Computing, March 1989, 28-9, 41-3.