ebook img

BASIC Microcomputing and Biostatistics: How to Program and Use Your Microcomputer for Data Analysis in the Physical and Life Science Including Medicine PDF

280 Pages·1984·11.628 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview BASIC Microcomputing and Biostatistics: How to Program and Use Your Microcomputer for Data Analysis in the Physical and Life Science Including Medicine

BASIC Microcomputing and Biostatistics BASIC Microcomputing and Biostatistics How to Program and Use Your Microcomputer for Data Analysis in the Physical and Life Sciences, Including Medicine WITH A PERMANENT liBRARY OF MANY HELPFUL PROGRAMS, CHALLENGING PROBLEMS, AND WORKED EXERCISES by Donald W. Rogers Humana Press Inc • Clifton, New Jersey To Doris M. Rogers With other men, perhaps, such things would not have been induce ments; but as for me, I am tormented with an everlasting itch for things remote. I love to sail forbidden seas, and land on barbarous coasts. -Melville Library of Congress Cataloging in Publication Data Rogers, Donald, 1932- Basic microcomputing and biostatistics. (Contemporary instrumentation and analysis) Includes bibliographies and index. 1. Life sciences-Data processing. I. Title. II. Series. QH324.2.R63 574' .028'54 81-85465 AACR2 TSBN-13: 978-1-4612-9776-5 e-TSBN-13: 978-1-4612-5300-6 DOT: 10.1007/978-1-4612-5300-6 © 1983 the HUMANA Press Inc. Crescent Manor P.O. Box 2148 Clifton, NJ 07015 All rights reserved No part of this book may be reproduced, stored in a retrieval system, or transmitted, in any form of by any means, electronic, mechanical, photo copying, microfilming, recording, or otherwise without written permission from the Publisher. iv Preface BASIC Microcomputing and Biostatistics is designed as the first practical "how to" guide to both computer programming in BASIC and the statis tical data processing techniques needed to analyze experimental, clinical, and other numerical data. It provides a small vocabulary of essential com puter statements and shows how they are used to solve problems in the bio logical, physical, and medical sciences. No mathematical background be yond algebra and an inkling of the principles of calculus is assumed. All more advanced mathematical techniques are developed from "scratch" before they are used. The computing language is BASIC, a high-level lan guage that is easy to learn and widely available using time-sharing com puter systems and personal microcomputers. The strategy of the book is to present computer programming at the outset and to use it throughout. BASIC is developed in a way reminiscent of graded readers used in human languages; the first programs are so sim ple that they can be read almost without an introduction to the language. Each program thereafter contains new vocabulary and one or more con cepts, explained in the text, not used in the previous ones. By gradual stages, the reader can progress from programs that do nothing more than count from one to ten to sophisticated programs for nonlinear curve fitting, matrix algebra, and multiple regression. There are 33 working programs and, except for the introductory ones, each performs a useful function in everyday data processing problems encountered by the experimentalist in many diverse fields. BASIC Microcomputing and Biostatistics arose as the result of a two fold need perceived by the author almost a decade ago. Students of statis tics were overwhelmed by masses of trivial calculations that were meant to illustrate statistical principles, but obscured them instead. Even routine techniques, such as constructing simple and cumulative frequency distri butions, were made complicated by the need to sort many numbers into arbitrarily sized' 'bins" while wondering what to do with the data that fall on the border separating one bin from its neighbor. On the other hand, in computer programming courses, then rare, now ubiquitous, programming principles were taught using exercises that illustrated them more or less well, depending on the textbook, but solved no problem anyone needed or wanted to solve. v vi Preface Statistics courses needed a means of handling routine number crunching so that the student might see the conceptual forest for the trees and neophyte computer programmers needed meaningful problems to solve with their newfound programming skills. Why not combine statistics and programming and teach two courses in one? I tried it; it worked. The course outline became the framework for this book and it has been filled in and modified from then until now. Taught in its entirety, this book is intended as a text for a one semester course in biostatistics, biomedical statistics, or related fields such as quantitative courses in agriculture, agronomy, ecology, botany, experi mental psychology, indeed any field in which masses of numerical data are treated. Students have finished one semester of this combined course with an understanding of statistics roughly equivalent to the level attained in the traditional one-semester statistics course, and they have mastered the fun damentals of computer programming in BASIC at about the level achieved by students in the usual one-semester course in that subject. Not the fine points, mind you, but enough to make the machine work for them, solving the quantitative problems that life scientists encounter in the laboratory or in the field. Although complete coverage of this book is at the advanced undergraduate-beginning graduate level, experience has shown that, by selective deletion, it can be modified for use in quite a broad spectrum of programming courses. By cutting out all the calculus (presenting the inte gral as merely an area and giving several equations ex cathedra) I have used the manuscript as a basis for a crash review of high-level programming for juniors who are about to embark on an assembly language course, a one-week short course for junior biologists entering an NIH research program, the computer component of an honors course in introductory chemistry, and a similar honors course for beginning biolo gists. By deleting almost all of the theory and concentrating on games and graphics, I have had considerable success using programs in this book in a two-and-a-half week orientation course. for entering freshmen at L.I. U. in the summer of 1982. All the programs in this book have been run on a DEC 20-60 time-sharing system. With a very few modifications, discussed in the text, they have also been run on a home microcomputer. These short, simple programs are ideally suited to bring the microcomputer into playas a powerful laboratory research tool. Table of Contents Preface.................................... v Chapter 1. Introduction to the Computer. . . . . . . . . 1 Computer Memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Data Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Kinds of Computers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Batch Processing and Time Sharing. . . . . . . . . . . . . . . . . . . . . 10 When Not to Use the Computer. . . . . . . . . . . . . . . . . . . . . . . . 11 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Problems. . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Bibliography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Chapter 2. Understanding Experimental Error and Averages. . . . . . . . . . . . . . . . . . . . .. 19 Significant Figures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Sources of Errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Truncation Errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Propagation of Errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Euler's Theorem and Variations. . . . . . . . . . . . . . . . . . . . . . . . 27 Geometrical Interpretation of Euler's Theorem. . . . . . . . . . . . 28 Measures of Central Tendency. . . . . . . . . . . . . . . . . . . . . . . . . 30 The Means of Means. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Bibliography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 vii viii Contents Chapter 3. Understanding Experimental Data Dispersion. . . . . . . . . . . . . . . . . . . . . . .. 47 The Average Deviation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 The Mean Deviation Independent of the Sign. . . . . . . . . . . . . 48 Population Parameters and Sample Statistics. . . . . . . . . . . . . . 49 The Standard Deviation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Relative Standard Deviation . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Grouped Data and Frequency Distributions. . . . . . . . . . . . . . . 52 Cumulative Frequency Distributions. . . . . . . . . . . . . . . . . . . . . 58 Application: Dose-Response Curve . . . . . . . . . . . . . . . . . . . . . 61 Frequency Grouping and Pictorial Representation of Continuous Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Quartiles and Percentiles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Skewness and Kurtosis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Bibliography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Chapter 4. Understanding Probability . . . . . . . . . .. 71 Simultaneous and Equally Acceptable Probabilities . . . . . . . . 72 Application: Heredity ................................ 76 The Urn Problem: Dependent Probabilities. . . . . . . . . . . . . . . 77 Conditional Probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Bayes' Theorem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Application of Bayes' Theorem: Diagnosis. . . . . . . . . . . . . . . 82 Permutations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Combinations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 The Binomial Coefficient. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Bibliography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Chapter 5. Determining Probability Distributions.. 91 Tree Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Application: Heredity ................................ 97 Modal and Mean Scores ............................ " 103 The Binomial Distribution ........................... " 107 Effect of p on the Binomial Distribution ............... " 111 Mean Occurrences for Data Groups of N ............... " 112 Application: Evaluation of a New Treatment. ........... " 114 Contents ix Glossary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 114 Problems ........................................... 115 Bibliography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 116 Chapter 6. Using the Poisson Distribution ....... 117 Application: Disintegration of Radioactive Nuclei ......... 120 Mean, Variance, and Standard Deviation for the Poisson Distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 121 Computer Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 123 Glossary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 129 Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 129 Bibliography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 130 Chapter 7. Using the Normal Distribution ........ 131 Relative Areas by Computer Graphics ................. " 134 Normalization of the Gaussian Distribution ............. " 136 The Mean, Variance, and Standard Deviation of the Gaussian Distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 138 The Standard Normal Deviate, 139 Z . . . . • . • . . • . • . • . . . . • . • .. Computer Integration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 142 Tabulated Areas Under the Normal Curve. . . . . . . . . . . . . . .. 147 The Most Common Areas and Limits on 148 Z . • . . . . . . • • . • • .. One- and Two-Tailed Tests. . . . . . . . . . . . . . . . . . . . . . . . . . .. 150 Glossary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 152 Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 152 Bibliography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 153 Chapter 8. Determining Probabilities: How to Apply the Chi Square Test and the Student's t-Test . ........................... 155 Chi Square Detection of a Biased Coin. . . . . . . . . . . . . . . . .. 158 Degrees of Freedom. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 160 The Central Limit Theorem ............ . . . . . . . . . . . . . .. 160 Situations in Which the Population Mean Is Known But Not Its Standard Deviation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 165 Determination of Confidence Limits When No Population Parameters Are Known . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 168 Confidence Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 169 The Difference Between Means . . . . . . . . . . . . . . . . . . . . . . .. 170 x Contents Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 172 Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 173 Bibliography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 174 Chapter 9. Finding Linear Functions: The Principle of Least Squares. . . . . . . . . . . . . . . . . .. 175 Linear Functions ............ . . . . . . . . . . . . . . . . . . . . . . .. 179 Least Squares Treatment of Linear Functions Passing Through the Origin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 181 The Correlation Coefficient. . . . . . . . . . . . . . . . . . . . . . . . . . .. 185 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 186 Least Squares with Two Minimization Parameters . . . . . . . .. 188 Simultaneous Equations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 194 Solution of Simultaneous Equations by Cramer's Rule. . . . .. 195 The Determinant of the Coefficients. . . . . . . . . . . . . . . . . . . .. 196 Cramer's Rule. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 199 Solution of the Normal Equations for Linear Curve Fitting by Cramer's Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 200 Glossary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 201 Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 202 Bibliography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 204 Chapter 10. Fitting Nonlinear Curves ........... 205 Boyle's Law. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 205 Exponential Decay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 209 Second-Order Reaction Kinetics. . . . . . . . . . . . . . . . . . . . . . .. 214 Enzyme-Catalyzed Reactions. . . . . . . . . . . . . . . . . . . . . . . . .. 219 Unlimited Population Growth. . . . . . . . . . . . . . . . . . . . . . . . .. 224 Limited Population Growth. . . . . . . . . . . . . . . . . . . . . . . . . . .. 227 Nearly Linear Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 230 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 235 Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 236 Bibliography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 237 Chapter 11. Solving Simultaneous Equations ..... 239 Simultaneous Equations in Matrix Form ............... " 239 Matrix Algebra. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 241 Simultaneous Equations by Matrix Inversion. . . . . . . . . . . . .. 248 Simultaneous Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 250 Contents xi Multiple Regression. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 253 Least Squares Treatment of Multiple Regression .......... 255 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 261 Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 263 Bibliography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 263 Answers to Problems . ........................ 265 Index . ..................................... 269

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.