SERIAL PUBLICATIONS OF THE SMITHSONIAN INSTITUTION

The emphasis upon publications as a means of diffusing knowledge was expressed by the first Secretary of the Smithsonian Institution. In his formal plan for the Institution, Joseph Henry articulated a program that included the following statement: “It is proposed to publish a series of reports, giving an account of the new discoveries in science, and of the changes made from year to year in all branches of knowledge not strictly professional.” This keynote of basic research has been adhered to over the years in the issuance of thousands of titles in serial publications under the Smithsonian imprint, commencing with Smithsonian Contributions to Knowledge in 1848 and continuing with the following active series:

Smithsonian Annals of Flight

Smithsonian Contributions to Anthropology

Smithsonian Contributions to Astrophysics

Smithsonian Contributions to Botany

Smithsonian Contributions to the Earth Sciences

Smithsonian Contributions to Paleobiology

Smithsonian Contributions to Zoology

Smithsonian Studies in History and Technology

In these series, the Institution publishes original articles and monographs dealing with the research and collections of its several museums and offices and of professional colleagues at other institutions of learning. These papers report newly acquired facts, synoptic interpretations of data, or original theory in specialized fields. Each publication is distributed by mailing lists to libraries, laboratories, institutes, and interested specialists throughout the world. Individual copies may be obtained from the Smithsonian Institution Press as long as stocks are available.

S. DILLON RIPLEY
Secretary
Smithsonian Institution

SMITHSONIAN CONTRIBUTIONS TO ZOOLOGY • NUMBER 69

Biostatistical Programs in BASIC Language for Time-Shared Computers:

Coordinated with the Book “Quantitative Zoology”

James A. Peters

SMITHSONIAN INSTITUTION PRESS

CITY OF WASHINGTON

1971

A B S T R A C T

Peters, James A. Biostatistical Programs in “BASIC” Language for Time-Shared Computers: Coordinated with the Book “Quantitative Zoology.” Smithsonian Contributions to Zoology, 69: 1–00. 1971.—This series of computer programs, written in the language BASIC, is designed to facilitate use of the time-shared computer by individuals with little or no background in computers or programming. The programs are coordinated with the book “Quantitative Zoology,” by G. G. Simpson, A. Roe, and R. Lewontin, which permits the user of this publication to find the proper statistical procedures for his needs in that book and to carry out the statistical procedure indicated. The programs are identified by using the page numbers from Simpson et al.

Official publication date is handstamped in a limited number of initial copies and is recorded in the Institution’s annual report, Smithsonian Year.

UNITED STATES GOVERNMENT PRINTING OFFICE
WASHINGTON: 1971

For sale by the Superintendent of Documents, U.S. Government Printing Office Washington, D.C. 20402 - Price 50 cents (paper cover)

TO ALL SCIENTISTS ASSOCIATED WITH THE

MUSEUM OF NATURAL HISTORY

You will find enclosed a copy of a recent publication in the Smithsonian Contributions to Zoology entitled “Biostatistical Programs in BASIC Language for Time-Shared Computers: Coordinated with the Book “Quantitative Zoology.” We hope to put a copy in the hands of every scientist in the Museum of Natural History, whether he is an employee of the Smithsonian or not. If you know of anyone who did not receive it please notify James A. Peters (ext. 6171) and one will be sent.

A seminar designed to demonstrate forall interested staff the techniques used to run any of the programs in the enclosed paper will be offered early in September, 1971, when the staff has re-assembled after the summer. A teletype machine will be brought to the seminar room and the entire sequence of steps required to run a program will be followed, so that anyone attending the seminar should then be able to take advantage of the time-shared computer to run his personal data at any time he wishes.

For those already familiar with the teletype, a complete set of tapes of the programs is available. In addition, the Dialcom Company, which currently serves as our time-share contractor, has asked permission to store the entire series in their “library,” which will make the programs available to all users whether within the Smithsonian or not. When this has been completed the use of the programs will be even simpler than before. Anyone not familiar with the operation of the time-shared computer who wishes to use it prior to the seminar in September should contact J. A. Peters, as well.

When the seminar is scheduled, a series of additional programs currently available for use by Smithsonian scientists will also be demonstrated. These will include taxonomic identifications from stored matrices, printing of taxonomic diagnoses from the same matrices, automated loan records, stored files and programs to manipulate synonymies and phylogenies, computerized mailing lists, mechanical plotting of graphs, and perhaps an exhibit-oriented question answering service, as well as anything new worked out during the summer.

An announcement of the time and place of the seminar will be made late in the summer.

Contents

Introduction

SIP1–SIP64

SIP65

SIP66–SIP67

SIP68–SIP73

SIP74

Sample Run of SIP74

SIP78–SIP95

SIP87

Sample Run of SIP87

SIP90

SIP113

Sample Run of SIP113

SIP129

Sample Run of SIP129

SIP143

Sample Run of SIP143

SIP146

Sample Run of SIP146

SIP161

Sample Run of SIP161

SIP163

Sample Run of SIP163

SIP166

Sample Run of SIP166

SIP176

Sample Run of SIP176

SIP181

Sample Run of SIP181

SIP183

Sample Run of SIP183

SIP185

SIP187

Sample Run of SIP187

SIP189–SIP190

SIP191–SIP212

SIP223

Sample Run of SIP223

SIP225

SIP226

Sample Run of SIP226

SIP229

Sample Run of SIP229

SIP232

Sample Run of SIP232

SIP233

Sample Run of SIP233

SIP234–SIP237

SIP238

Sample Run of SIP238

SIP239–SIP245

SIP246

Sample Ran of SIP246

SIP248

Sample Run of SIP248

SIP254

SIP270

Sample Run of SIP270

SIP276

Sample Run of SIP276

SIP283

Sample Run of SIP283

SIP287–SIP297

SIP300

Sample Run of SIP300

SIP306

Sample Run of SIP306

SIP309

Sample Run of SIP309

SIP312

Sample Run of SIP312

SIP313–SIP338

SIP318

Sample Ron of SIP318

SIP331

Sample Ron of SIP331

SIP339–SIP372

SIP357

Sample Run of SIP357

SIP391

Sample Run of SIP391

SIP410

Sample Run of SIP410

SIP411

Sample Run of SIP411

Index

Publication in Smithsonian Contributions to Zoology

Biostatistical Programs in BASIC Language for Time-Shared Computers:

Coordinated with the Book “Quantitative Zoology”

James A. Peters

____________

James A. Peters, Department of Vertebrate Zoology, National Museum of Natural History, Smithsonian Institution, Washington, D.C. 20560.

Introduction

This collection of computer programs is designed to make computer use easy for the individual who has no familiarity or knowledge of their internal workings and who does not particularly care to learn about them. For the computer specialist or the biologist who has learned to do his own programming, these programs are of no interest or value at all, and he might even question the value of their existence. But the absolute neophyte can, and I hope will, use this publication as a painless, easy introduction to the computer world. After he has used these programs for awhile, he will find it easy to progress a little further.

The availability of time-shared computers, which are contacted through a familiar typewriter keyboard, now makes most kinds of data manipulation both instantaneous and painless. The investigator who needs to do any kind of work with numbers does himself a serious disservice if he fails to take advantage of computers. But the first hurdle continues to be the highest because it involves the decision to start, and the act of doing so. It involves getting rid of the idea that computer use is complicated and that one cannot do the entire job by himself. It involves learning that the problem need not be large, difficult, and composed of amounts of data that could not be handled in any way other than by computer. Data for computer work can consist of only a few measurements or counts on a dozen specimens, with no more answers wanted than an average, or range, and perhaps the standard deviation. And, finally, it involves spending only fifteen minutes in learning how to use the time-shared computer.

It is my contention that the average biologist does not have to know any more about how to write a program to use the computer than he needs to know about internal gear mechanisms to run a microtome. The set of programs presented here are designed to facilitate such usage. If the reader has ever consulted the book by G. G. Simpson, A. Roe, and R. Lewontin entitled “Quantitative Zoology” (published in 1939, revised in 1960), the use of these programs should be simple. The code designation for the programs are taken directly from the pagination of this book, so that the program entitled “SIP74” will do all the calculations for which a formula is shown on SI(mpson) P(age) 74. If the user of this publication is not familiar with that particular book on biostatistics, he still can use the index to find a program that will run the type of computation he wishes to make. The basic concept behind the use of this book as the locus for organization is that the user will be able to follow the same procedure as if he were going to calculate with a pencil or with a desk calculator in deciding what formula he wishes to calculate, after which he can substitute the time-shared computer as the device for doing the calculations. In every case the entire program is printed here, including data from an example in “Quantitative Zoology” and also including the result of a run by the computer using those data, which can be directly compared with the book to be sure the program has run correctly. This test is followed by substitution of the user’s data (always in line 900 and on), as directed by the program itself, and by a run on that data for his answers.

The use of the work “Quantitative Zoology,” by G. G. Simpson, A. Roe, and R. Lewontin (New York: 1960, revised edition) as the basis for this series of programs, and the reproduction of any material contained therein, has been by permission of Harcourt, Brace and World, Inc., New York.

I visualize these programs as being used in three ways. The most effective way would be for the user to store the entire series in the memory of the computer (“on disc”) so that he could simply identify from the book what statistical values he wanted to calculate and then call for the program by using the page number. The first few lines (the “REMS,” or remarks) of each program are devoted to instructions on its use, and the user may list these to see what procedures he should follow. His data are then fed in from a tape, and the program is run. If usage by a group is fairly high this would be the best method to use, but if usage is cyclic or erratic the second method probably would be better.

The second way to use these programs would be to have paper tapes of the entire series stored beside the teletype. The user selects the program he needs for the statistical values wanted, feeds it into the computer, and uses it for as long as he has need for it, after which it is removed from the disc storage until the next use. This saves the costs of disc storage but increases the amount of contact time.

The third way to use the programs is directly from the listings presented here. I have tried to provide enough information to permit use even if Simpson’s book were not available and the user had to put the program in directly from this booklet. Care must be taken in this case to copy exactly, because slight errors can result in great delays in trying to find them or in totally erroneous answers. Such users should always run the program on the data included here, to see if it is running correctly.

Program lines 14 through 19 have been left vacant throughout these programs so the user can put identification data in them. Anything inserted in these lines with a “PRINT” statement will be put at the head of a sheet of calculated results and will provide a permanent record of the data source. As an example, one might type (on a single line) the following: 15 PRINT “FEMALE PAPILIO, MONTGOMERY COUNTY, WING LENGTH.” Everything within the quotation marks would then be printed out with the results.

No attempt is made here to teach the preliminary steps for making contact with the time-shared computer. The techniques and commands change from one contractor to the next, and they generally are taught by the contractor at the beginning of service. Any previous user of a system can show the beginner how to make the first contact.

It will be noted that occasionally there are pages (in Simpson et al.) on which formulae are printed that do not appear here as a numbered program. This is a consequence of the fact that it often is simpler to program a series of operations or formulae as a single unit. The following material is organized to permit the user to find out from the centered headings (all of which refer to pages in Simpson et al.) where material from any page not directly programmed can be found.

SIP1–SIP64

The information contained in these pages, while in many cases amenable to handling, organization, and printing by the computer, generally is such that it is not worth the time or the expense involved in computer use. The techniques described here are used throughout the remainder of the text, and, where appropriate, programs using them have been written. In such cases, the programs often can be used to perform the simple operations required in this section, if the user wishes.

SIP65

The equation presented on this page is included in program SIP74.

SIP66–SIP67

Program SIP74 provides for grouped data as well as for individual values. It will call for an answer from the user as to whether his data is grouped or not. If classes are used as in example 26 on page 67, the class midpoint is to be used as the “X” value in SIP74.

SIP68–SIP73

Program SIP74 will calculate the mean of means, as discussed on these pages. Method 1 sums a series of means and divides the sum by the number of means. If this method is desired, the values of the individual means are entered in line 900, and the ungrouped data routine is chosen when the computer asks for a selection. Method 2 involves multiplying each mean by the size of its sample and then dividing the sum of those values by the sum of the sample sizes. In this method, the user first enters the mean of a sample (“X” value), then the size of the sample (“Y” value), and continue to the end of the samples. The grouped data routine is chosen when the computer offers a selection. If needed by the user, the Median, page 70, can be found in SIP143. The Mode is left for the individual user to tabulate since a computer program scarcely facilitates this operation.

SIP74

Sample Run of SIP74

SIP78–SIP95

All of the material contained in Chapter 6 is incorporated in and calculated by SIP87, which also produces results of the equations on pages 166–167 (the standard errors of the median, the first or third quartiles, the mean deviation, the coefficient of variation, and the standard deviation). All of these are based on the same set of data. The early formulae in this chapter are devoted to hand calculation of the equations, and scientists need not spend the amount of time necessary for this when it is so simple today to run the data through a computer. No program is provided for the data manipulation shown on page 95.

SIP87

Sample Run of SIP87

SIP90

The calculation of the coefficient of variation has been incorporated in SIP87, since it is based on the same set of data and usually is desired at the same time as the other standard calculations.

SIP113

Sample Run of SIP113

SIP129

Sample Run of SIP129

SIP143

Sample Run of SIP143

SIP146

Sample Run of SIP146

SIP161

Sample Run of SIP161

SIP163

Sample Run of SIP163

SIP166

Sample Run of SIP166

SIP176

Sample Run of SIP176

SIP181

Sample Run of SIP181

SIP183

Sample Run of SIP183

SIP185

The calculation of the ratio between sample variances (“F”) is included in SIP176, since it is based on the same set of data. Instructions will be found in that program to permit calculation of both Student’s t and “F,” or either one without the other, as the user wishes.

SIP187

Sample Run of SIP187

SIP189–SIP190

Yates’s correction for continuity is included in SIP187. The user is asked if he wishes to make a correction because of sample size during the run of that program; a “yes” answer will run Yates’s correction on the data.

SIP191–SIP212

The material in these pages is covered for the most part by SIP176. Since the amount of data does not affect the computer operation unless it is extremely large, the simpler formula for Student’s t on SIP194 is not needed.

SIP223

Sample Run of SIP223

SIP225

The variance of the estimate is included in SIP223, and it will be included in the output of any run of that program (see above).

SIP226

Sample Run of SIP226

SIP229

Sample Run of SIP229

SIP232

Sample Run of SIP232

SIP233

Sample Run of SIP233

SIP234–SIP237

Most of the material in these pages is calculated in SIP233, although not all of it is printed out. If the user wishes, a series of “PRINT” statements following his final data line will give the following values from the program:

A “PRINT” statement for any one of these would look like this:

925 PRINT “X BAR SUB 1 (MEAN OF FIRST GROUP) =”, J

The Student’s t called for in this section (and in SIP233) must always be looked up in the table on page 422, using the known degrees of freedom (printed out by SIP233) and the confidence limits the user wishes to establish. This value cannot be calculated by the program; it must be typed as input by the user when it is called for by program (see above).

SIP238

Sample Run of SIP238

SIP239–SIP245

The calculation of the correlation coefficient (“r”) is included in program SIP223, which utilizes the same set of data needed for the calculation of this value. It will be printed out along with the other results when that program is run. The transformation of “r” into Fisher’s “z” value also is included in SIP223, as is the test of the significance of z, as shown in Example 74, page 245.

SIP246

Sample Ran of SIP246

SIP248

Sample Run of SIP248

SIP254

No program has been prepared for the formula on page 254. While it is feasible, such a program would be long and cumbersome, and to calculate the “C” value it would appear simpler to use the method as shown in the example on page 255.

SIP270

Sample Run of SIP270

SIP276

Sample Run of SIP276

SIP283

Sample Run of SIP283

SIP287–SIP297

The programs for the calculations on these pages have not been written, primarily because the authors have given no example that would permit the verification of any program prepared. If any user of this manual has actually calculated and verified an analysis of variance for a three-factor design and if he will submit the data and answers to the author, a program can be prepared. The same can be done for the random models, if a user needs them.

SIP300

Sample Run of SIP300

SIP306

Sample Run of SIP306

SIP309

Sample Run of SIP309

SIP312

Sample Run of SIP312

SIP313–SIP338

The tests shown in these pages, including the small sample correction (p. 322) and the list of expected values are in program SIP318. Data organized as on page 330 must be run in program SIP331.

SIP318

Sample Ron of SIP318

SIP331

Sample Ron of SIP331

SIP339–SIP372

Most of the material in this chapter is not amenable to time-shared computer use, although plotters that can be attached to computers, including time-shared machines, are available. No attempt is made here to program for plotting. An X, Y plot program usually is standard in library programs of time-share companies. One operation discussed in this chapter is easily performed by the computer, however, and advantage should be taken of it in graphs using log or semilog plots. SIP357 will convert all given values into logs, either natural logs or logs to the base 10.

SIP357

Sample Run of SIP357

SIP391

Sample Run of SIP391

SIP410

Sample Run of SIP410

SIP411

Sample Run of SIP411

Index

Allometry, coefficient of, 43

constant of, 43

deviations from simple, 44

Alpha-coefficient of allometry, 43

Alpha-intercept, 20

Analysis of variance, 29

in regression, 30

hierarchical, 43

one-factor design, 29

two-factor design, 32

Arithmetic mean, 4

confidence limits of, 12

standard errors of, 12

Average, see Mean

Bartlett’s “best-fit” line, 23

Base “e” logs, 42

Base ten logs, 42

“best-fit” line, Bartlett’s, 23

Capture-mark-recapture method, 6

Central tendency, measures of, 3

Chi square test, in comparison of two samples, 17

in confidence limits of variance, 11

in contingency tables, 39

in goodness of fit for frequency data, 36

in Poisson distribution, 37

in small samples, 17

in standardized normal deviate, 41

in Yate’s continuity correction, 17

Coefficient, of allometry, 43

of correlation, 19

of kurtosis, 9

of skewness, 8

of variation, 5

Comparison of samples, 13, 15, 16, 17

Confidence limits, of actual value in prediction in regression, 26

of coefficient of variation, 12

of intercept, 20, 31

of mean, 12

of mean deviation, 12

of mean value for prediction in regression, 26

of median, 12

of quartiles, 12

of slope, 21, 31

of standard deviation, 12

of variance, 10, 12

Contingency tables, 39

small sample correction for, 39

Continuity correction, Yates’s, 17, 18

Correction factor, Yatest’s continuity, 17

Correlation, partial, 27

Correlation coefficient(s), 19

significance of difference between two, 27

transformation to z value, 19, 27

Degrees of freedom, in association tests, 40

in F tests, 15

in goodness-of-fit tests, 38

in Student’s t tests, 15, 16

Dependent variable, prediction of, 22

Deviation, standard, 5

Deviations from simple allometry, 44

Dispersion, measures of, 4

Distribution, Poisson, 6, 37, 38

“F” ratio, 29

in analysis of variance in regression, 33

in hierarchical analysis of variance, 34

in one-factor design analysis of variance, 29

in two-factor design analysis of variance, 32

F value, 13

Geometric mean, 4

Geometric rate of increase in growth curve, 42

Goodness-of-fit for frequency data, 36

Growth curve, 43

geometric rate of increase in, 42

Harmonic mean, 4

Hierarchical analysis of variance, 34

Homogeneity tests, 39

Intercept, 20

confidence limits of, 20

in Bartlett’s “best-fit” line, 23

Kurtosis, coefficient of, 9

Limits, confidence, see Confidence limits

Logarithms, natural, 42

Logarithm values, 42

to base “e,” 42

to bate ten, 42

Mean, arithmetic, see Arithmetic mean

geometric, 4

harmonic, 4

of means, 3

quadratic, 4

Mean deviation, confidence limits of, 12

standard error of, 12

Mean square, 32

Measures of central tendency, 3

Measures of dispersion, 4

Median, 3

confidence limits of, 12

standard error of, 12

precise estimate of, 9

Mode, 3

Natural logarithms, 42

Normal deviate, standardized, 27

Normal distribution, measures of dispersion in, 6

variance ratio test of, 51

One-factor design analysis of variance, 29

Paired regressions, Student’s t in, 22

Paired samples, 15

Student’s ( in, 27

Partial correlation, 27

Poisson distribution, 6

chi square calculation in, 38

variance ratio test, 38

Population, estimated size of, 6

Prediction, confidence limits in, 26

from regression equation, 22

Probabilities, in Poisson distribution, 6

Quadratic mean, 4

Quartiles, confidence limits of, 12

standard errors of, 12

“r” value, 19

Ratio between sample variances, 16

Rectilinearity, test for, 32

Regression, 19

analysis of variance in, 30

Regression coefficient, of dependent variable, 42

significance of, 32

Regression equation, 20

Richards and Kavanaugh test, 44

Sample variances, ratio between, 18

Skewness, coefficient of, 8

Slope, 20

confidence limits of, 20

in Bartlett’s “best-fit” line, 23

Small sample correction for contingency tables, 40

Standard deviation, 5

confidence limits of, 12

standard error of, 12

Standard error, of coefficient of variation, 12

of mean, 12

of mean deviation, 12

of median, 12

of quartiles, 12

of standard deviation, 12

Standardized normal deviate, 27, 41

calculation from known chi square values, 41

Student’s t, 13, 15

for two samples, 13

for paired samples, 15

for regressions, 22

Transformed correlation coefficient (“z”), 19, 27

Two-factor design analysis of variance, 32

Variance, 5

of estimate, in regression, 19

Variation, coefficient of, 5, 12

Yates’s continuity correction, 17, 18

‘Z’ value, 19

Publication in Smithsonian Contributions to Zoology

Manuscripts for serial publications are accepted by the Smithsonian Institution Press, subject to substantive review, only through departments of the various Smithsonian museums. Non-Smithsonian authors should address inquiries to the appropriate department. If submission is invited, the following format requirements of the Press will govern the preparation of copy. (An instruction sheet for the preparation of illustrations is available from the Press on request.)

Copy must be typewritten, double-spaced, on one side of standard white bond paper, with 1½" top and left margins, submitted in ribbon copy with a carbon or duplicate, and accompanied by the original artwork. Duplicate copies of all material, including illustrations, should be retained by the author. There may be several paragraphs to a page, but each page should begin with a new paragraph. Number consecutively all pages, including title page, abstract, text, literature cited, legends, and tables. The minimum length is 30 pages of typescript and illustrations.

The title should be complete and clear for easy indexing by abstracting services. Taxonomic titles will carry a final line indicating the higher categories to which the taxon is referable: “(Hymenoptera: Sphecidae).” Include an abstract as an introductory part of the text. Identify the author on the first page of text with an unnumbered footnote that includes his professional mailing address. A table of contents is optional. An index, if required, may be supplied by the author when he returns page proof.

Two headings are used: (1) text heads (boldface in print) for major sections and chapters and (2) paragraph sideheads (caps and small caps in print) for subdivisions. Further headings may be worked out with the editor.

In taxonomic keys, number only the first item of each couplet; if there is only one couplet, omit the number. For easy reference, number also the taxa and their corresponding headings throughout the text; do not incorporate page references in the key.

In synonymy, use the short form (taxon, author, date, page) with a full reference at the end of the paper under “Literature Cited.” Begin each taxon at the left margin with subsequent lines indented about three spaces. Within a taxon, use a period-dash (.—) to separate each reference. Enclose with square brackets any annotation in or at the end of the taxon. For references within the text, use the author-date system: “(Jones, 1910)” or “Jones (1910).” If the reference is expanded, abbreviate the data: “Jones (1910, p. 122, pl. 20: fig. 1).”

Simple tabulations in the text (e.g., columns of data) may carry headings or not, but they should not contain rules. Formal tables must be submitted as pages separate from the text, and each table, no matter how large, should be pasted up as a single sheet of copy.

For measurements and weights, use the metric system instead of (or in addition to) the English system.

Illustrations (line drawings, maps, photographs, shaded drawings) can be intermixed throughout the printed text. They will be termed Figures and should be numbered consecutively; however, if a group of figures is treated as a single figure, the individual components should be indicated by lowercase italic letters on the illustration, in the legend, and in text references: “Figure 9b.” If illustrations (usually tone photographs) are printed separately from the text as full pages on a different stock of paper, they will be termed Plates, and individual components should be lettered (Plate 9b) but may be numbered (Plate 9: figure 2). Never combine the numbering system of text illustrations with that of plate illustrations. Submit all legends on pages separate from the text and not attached to the artwork.

In the bibliography (usually called “Literature Cited”), spell out book, journal, and article titles, using initial caps with all words except minor terms such as “and, of, the.” (For capitalization of titles in foreign languages, follow the national practice of each language.) Underscore (for italics) book and journal titles. Use the colon-parentheses system for volume, number, and page citations: “10(2):5–9.” Spell out such words as “figures” and “plates” (or “pages” when used alone).

For free copies of his own paper, a Smithsonian author should indicate his requirements on “Form 36” (submitted to the Press with the manuscript). A non-Smithsonian author will receive 50 free copies; order forms for quantities above this amount with instructions for payment will be supplied when page proof is forwarded.