Chapter 14. Statistical Description of Data .com or call 14.0 Introduction 彩 Cambridge NUMERICAL RECIPES IN In this chapter and the next,the concept of data enters the discussion more prominently than before. server Data consist ofnumbers,of course.But these numbers are fed into the computer, compu not produced by it.These are numbers to be treated with considerable respect,neither Press to be tampered with,nor subjected to a numerical process whose character you do C:THE ART OF not completely understand.You are well advised to acquire a reverence for data that 号 is rather different from the "sporty"attitude that is sometimes allowable,or even commendable,in other numerical tasks. The analysis of data inevitably involves some trafficking with the field of SCIENTIFIC statistics,that gray area which is not quite a branch of mathematics-and just as surely not quite a branch of science.In the following sections,you will repeatedly encounter the following paradigm: apply some formula to the data to compute"a statistic" 含数 6 compute where the value of that statistic falls in a probability distribution that is computed on the basis of some"null hypothesis" r Numerical 92y if it falls in a very unlikely spot,way out on a tail of the distribution, conclude that the null hypothesis is false for your data set Recipes If a statistic falls in a reasonable part of the distribution,you must not make the mistake of concluding that the null hypothesis is "verified"or "proved."That is the curse of statistics,that it can never prove things,only disprove them!At best, you can substantiate a hypothesis by ruling out,statistically,a whole long list of (outside ecipes competing hypotheses,every one that has ever been proposed.After a while your North Software. adversaries and competitors will give up trying to think of alternative hypotheses, or else they will grow old and die,and then your hypothesis will become accepted. Sounds crazy,we know,but that's how science works! America) visit website In this book we make a somewhat arbitrary distinction between data analysis machine procedures that are model-independent and those that are model-dependent.In the former category,we include so-called descriptive statistics that characterize a data set in general terms:its mean,variance,and so on.We also include statistical tests that seek to establish the“sameness”or“differentness'”of two or more data sets,.or that seek to establish and measure a degree of correlation between two data sets These subjects are discussed in this chapter. 609
Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machinereadable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). Chapter 14. Statistical Description of Data 14.0 Introduction In this chapter and the next, the concept of data enters the discussion more prominently than before. Data consist of numbers, of course. But these numbers are fed into the computer, not produced by it. These are numbers to be treated with considerable respect, neither to be tampered with, nor subjected to a numerical process whose character you do not completely understand. You are well advised to acquire a reverence for data that is rather different from the “sporty” attitude that is sometimes allowable, or even commendable, in other numerical tasks. The analysis of data inevitably involves some trafficking with the field of statistics, that gray area which is not quite a branch of mathematics — and just as surely not quite a branch of science. In the following sections, you will repeatedly encounter the following paradigm: • apply some formula to the data to compute “a statistic” • compute where the value of that statistic falls in a probability distribution that is computed on the basis of some “null hypothesis” • if it falls in a very unlikely spot, way out on a tail of the distribution, conclude that the null hypothesis is false for your data set If a statistic falls in a reasonable part of the distribution, you must not make the mistake of concluding that the null hypothesis is “verified” or “proved.” That is the curse of statistics, that it can never prove things, only disprove them! At best, you can substantiate a hypothesis by ruling out, statistically, a whole long list of competing hypotheses, every one that has ever been proposed. After a while your adversaries and competitors will give up trying to think of alternative hypotheses, or else they will grow old and die, and then your hypothesis will become accepted. Sounds crazy, we know, but that’s how science works! In this book we make a somewhat arbitrary distinction between data analysis procedures that are model-independent and those that are model-dependent. In the former category, we include so-called descriptive statistics that characterize a data set in general terms: its mean, variance, and so on. We also include statistical tests that seek to establish the “sameness” or “differentness” of two or more data sets, or that seek to establish and measure a degree of correlation between two data sets. These subjects are discussed in this chapter. 609
610 Chapter 14.Statistical Description of Data In the other category.model-dependent statistics,we lump the whole subject of fitting data to a theory,parameter estimation,least-squares fits,and so on.Those subjects are introduced in Chapter 15. Section 14.1 deals with so-called measures of central tendency,the moments of a distribution.the median and mode.In $14.2 we learn to test whether different data sets are drawn from distributions with different values of these measures of central tendency.This leads naturally,in $14.3,to the more general question of whether two distributions can be shown to be(significantly)different. In $14.4-$14.7,we deal with measures of association for two distributions. We want to determine whether two variables are "correlated"or "dependent"on one another.If they are,we want to characterize the degree of correlation in some simple ways.The distinction between parametric and nonparametric(rank) methods is emphasized. Section 14.8 introduces the concept of data smoothing,and discusses the M质 particular case of Savitzky-Golay smoothing filters This chapter draws mathematically on the material on special functions that was presented in Chapter 6,especially $6.1-86.4.You may wish,at this point,to review those sections. 9 CITED REFERENCES AND FURTHER READING: Bevington,P.R.1969,Data Reduction and Error Analysis for the Physical Sciences (New York: McGraw-Hill). Stuart,A,and Ord,J.K.1987,Kendall's Advanced Theory of Statistics,5th ed.(London:Griffin and Co.)[previous eds.published as Kendall,M.,and Stuart,A.,The Advanced Theory 、iA的 of Statistics]. Norusis,M.J.1982,SPSS Introductory Guide:Basic Statistics and Operations:and 1985,SPSS- IENTIFIC X Advanced Statistics Guide (New York:McGraw-Hill). 61 Dunn,O.J.,and Clark,V.A.1974,Applied Statistics:Analysis of Variance and Regression (New York:Wiley). (ISBN 14.1 Moments of a Distribution:Mean, Numerical Recipes 10.621 Variance,Skewness,and So Forth 43108 When a set of values has a sufficiently strong central tendency,that is,a tendency (outside to cluster around some particular value,then it may be useful to characterize the Software. set by a few numbers that are related to its moments,the sums of integer powers North of the values. Best known is the mean of the values x1,...,N, N (14.1.1) 71 which estimates the value around which central clustering occurs.Note the use of an overbar to denote the mean;angle brackets are an equally common notation,e.g., ()You should be aware that the mean is not the only available estimator of this
610 Chapter 14. Statistical Description of Data Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machinereadable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). In the other category, model-dependent statistics, we lump the whole subject of fitting data to a theory, parameter estimation, least-squares fits, and so on. Those subjects are introduced in Chapter 15. Section 14.1 deals with so-called measures of central tendency, the moments of a distribution, the median and mode. In §14.2 we learn to test whether different data sets are drawn from distributions with different values of these measures of central tendency. This leads naturally, in §14.3, to the more general question of whether two distributions can be shown to be (significantly) different. In §14.4–§14.7, we deal with measures of association for two distributions. We want to determine whether two variables are “correlated” or “dependent” on one another. If they are, we want to characterize the degree of correlation in some simple ways. The distinction between parametric and nonparametric (rank) methods is emphasized. Section 14.8 introduces the concept of data smoothing, and discusses the particular case of Savitzky-Golay smoothing filters. This chapter draws mathematically on the material on special functions that was presented in Chapter 6, especially §6.1–§6.4. You may wish, at this point, to review those sections. CITED REFERENCES AND FURTHER READING: Bevington, P.R. 1969, Data Reduction and Error Analysis for the Physical Sciences (New York: McGraw-Hill). Stuart, A., and Ord, J.K. 1987, Kendall’s Advanced Theory of Statistics, 5th ed. (London: Griffin and Co.) [previous eds. published as Kendall, M., and Stuart, A., The Advanced Theory of Statistics]. Norusis, M.J. 1982, SPSS Introductory Guide: Basic Statistics and Operations; and 1985, SPSSX Advanced Statistics Guide (New York: McGraw-Hill). Dunn, O.J., and Clark, V.A. 1974, Applied Statistics: Analysis of Variance and Regression (New York: Wiley). 14.1 Moments of a Distribution: Mean, Variance, Skewness, and So Forth When a set of values has a sufficiently strong central tendency, that is, a tendency to cluster around some particular value, then it may be useful to characterize the set by a few numbers that are related to its moments, the sums of integer powers of the values. Best known is the mean of the values x1,...,xN , x = 1 N N j=1 xj (14.1.1) which estimates the value around which central clustering occurs. Note the use of an overbar to denote the mean; angle brackets are an equally common notation, e.g., x. You should be aware that the mean is not the only available estimator of this