If you havestrong evidence that your data do in fact come from a normal, or nearlynormal, distribution, then Bartlett's test has better performance.. Sample Output Dataplot generated the
Trang 11 Exploratory Data Analysis
Levene's test ( Levene 1960) is used to test if k samples have equal
variances Equal variances across samples is called homogeneity ofvariance Some statistical tests, for example the analysis of variance,assume that variances are equal across groups or samples The Levene testcan be used to verify that assumption
Levene's test is an alternative to the Bartlett test The Levene test is lesssensitive than the Bartlett test to departures from normality If you havestrong evidence that your data do in fact come from a normal, or nearlynormal, distribution, then Bartlett's test has better performance
Definition The Levene test is defined as:
H0:
TestStatistic:
Given a variable Y with sample of size N divided into k subgroups, where N i is the sample size of the ith subgroup,
the Levene test statistic is defined as:
where Z ij can have one of the following three definitions:
where is the mean of the ith subgroup.
Trang 2where is the 10% trimmed mean of the ith
Levene's original paper only proposed using the mean
Brown and Forsythe (1974)) extended Levene's test to useeither the median or the trimmed mean in addition to themean They performed Monte Carlo studies that indicatedthat using the trimmed mean performed best when theunderlying data followed a Cauchy distribution (i.e.,heavy-tailed) and the median performed best when theunderlying data followed a (i.e., skewed) distribution.Using the mean provided the best power for symmetric,moderate-tailed, distributions
Although the optimal choice depends on the underlyingdistribution, the definition based on the median is
recommended as the choice that provides good robustnessagainst many types of non-normal data while retaininggood power If you have knowledge of the underlyingdistribution of the data, this may indicate using one of theother choices
SignificanceLevel:
1.3.5.10 Levene Test for Equality of Variances
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35a.htm (2 of 4) [5/1/2006 9:57:20 AM]
Trang 3The Levene test rejects the hypothesis that the variances areequal if
distribution with k - 1 and N - k degrees of freedom at a
significance level of
In the above formulas for the critical regions, the Handbookfollows the convention that is the upper critical valuefrom the F distribution and is the lower criticalvalue Note that this is the opposite of some texts andsoftware programs In particular, Dataplot uses the oppositeconvention
Sample
Output
Dataplot generated the following output for Levene's test using the
GEAR.DAT data set (by default, Dataplot performs the form of the testbased on the median):
LEVENE F-TEST FOR SHIFT IN VARIATION (CASE: TEST BASED ON MEDIANS)
1 STATISTICS NUMBER OF OBSERVATIONS = 100 NUMBER OF GROUPS = 10 LEVENE F TEST STATISTIC = 1.705910
2 FOR LEVENE TEST STATISTIC
90.09152 % Point: 1.705910
3 CONCLUSION (AT THE 5% LEVEL):
THERE IS NO SHIFT IN VARIATION
THUS: HOMOGENEOUS WITH RESPECT TO VARIATION
1.3.5.10 Levene Test for Equality of Variances
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35a.htm (3 of 4) [5/1/2006 9:57:20 AM]
Trang 4The first section prints the number of observations (N), the number
of groups (k), and the value of the Levene test statistic.
2
The third section prints the conclusion for a 95% test For adifferent significance level, the appropriate conclusion can be drawnfrom the table printed in section two For example, for = 0.10, welook at the row for 90% confidence and compare the critical value1.702 to the Levene test statistic 1.7059 Since the test statistic isgreater than the critical value, we reject the null hypothesis at the
= 0.10 level
3
Output from other statistical software may look somewhat different fromthe above output
Question Levene's test can be used to answer the following question:
Is the assumption of equal variances valid?
Software The Levene test is available in some general purpose statistical software
programs, including Dataplot
1.3.5.10 Levene Test for Equality of Variances
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35a.htm (4 of 4) [5/1/2006 9:57:20 AM]
Trang 51 Exploratory Data Analysis
A fundamental task in many statistical analyses is to characterize the
location and variability of a data set A further characterization of thedata includes skewness and kurtosis
Skewness is a measure of symmetry, or more precisely, the lack ofsymmetry A distribution, or data set, is symmetric if it looks the same
to the left and right of the center point
Kurtosis is a measure of whether the data are peaked or flat relative to anormal distribution That is, data sets with high kurtosis tend to have adistinct peak near the mean, decline rather rapidly, and have heavy tails.Data sets with low kurtosis tend to have a flat top near the mean ratherthan a sharp peak A uniform distribution would be the extreme case.The histogram is an effective graphical technique for showing both theskewness and kurtosis of data set
Definition of
Skewness
For univariate data Y1, Y2, , Y N, the formula for skewness is:
where is the mean, is the standard deviation, and N is the number of
data points The skewness for a normal distribution is zero, and anysymmetric data should have a skewness near zero Negative values forthe skewness indicate data that are skewed left and positive values forthe skewness indicate data that are skewed right By skewed left, wemean that the left tail is long relative to the right tail Similarly, skewedright means that the right tail is long relative to the left tail Some
measurements have a lower bound and are skewed right For example,
in reliability studies, failure times cannot be negative
1.3.5.11 Measures of Skewness and Kurtosis
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35b.htm (1 of 4) [5/1/2006 9:57:21 AM]
Trang 6Definition of
Kurtosis
For univariate data Y1, Y2, , Y N, the formula for kurtosis is:
where is the mean, is the standard deviation, and N is the number of
Examples The following example shows histograms for 10,000 random numbers
generated from a normal, a double exponential, a Cauchy, and a Weibulldistribution
Normal
Distribution
The first histogram is a sample from a normal distribution The normaldistribution is a symmetric distribution with well-behaved tails This isindicated by the skewness of 0.03 The kurtosis of 2.96 is near theexpected value of 3 The histogram verifies the symmetry
1.3.5.11 Measures of Skewness and Kurtosis
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35b.htm (2 of 4) [5/1/2006 9:57:21 AM]
Trang 7Distribution
The third histogram is a sample from a Cauchy distribution.For better visual comparison with the other data sets, we restricted thehistogram of the Cauchy distribution to values between -10 and 10 Thefull data set for the Cauchy data in fact has a minimum of approximately-29,000 and a maximum of approximately 89,000
The Cauchy distribution is a symmetric distribution with heavy tails and
a single peak at the center of the distribution Since it is symmetric, wewould expect a skewness near zero Due to the heavier tails, we mightexpect the kurtosis to be larger than for a normal distribution In fact theskewness is 69.99 and the kurtosis is 6,693 These extremely high
values can be explained by the heavy tails Just as the mean andstandard deviation can be distorted by extreme values in the tails, so toocan the skewness and kurtosis measures
Weibull
Distribution
The fourth histogram is a sample from a Weibull distribution with shapeparameter 1.5 The Weibull distribution is a skewed distribution with theamount of skewness depending on the value of the shape parameter Thedegree of decay as we move away from the center also depends on thevalue of the shape parameter For this data set, the skewness is 1.08 andthe kurtosis is 4.46, which indicates moderate skewness and kurtosis
One approach is to apply some type of transformation to try to make thedata normal, or more nearly normal The Box-Cox transformation is auseful technique for trying to normalize a data set In particular, takingthe log or square root of a data set is often useful for data that exhibitmoderate right skewness
Another approach is to use techniques based on distributions other thanthe normal For example, in reliability studies, the exponential, Weibull,and lognormal distributions are typically used as a basis for modelingrather than using the normal distribution The probability plot
1.3.5.11 Measures of Skewness and Kurtosis
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35b.htm (3 of 4) [5/1/2006 9:57:21 AM]
Trang 8correlation coefficient plot and the probability plot are useful tools fordetermining a good distributional model for the data.
Software The skewness and kurtosis coefficients are available in most general
purpose statistical software programs, including Dataplot
1.3.5.11 Measures of Skewness and Kurtosis
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35b.htm (4 of 4) [5/1/2006 9:57:21 AM]
Trang 91 Exploratory Data Analysis
Definition Given measurements, Y1, Y2, , Y N at time X1, X2, , X N , the lag k
autocorrelation function is defined as
Although the time variable, X, is not used in the formula for
autocorrelation, the assumption is that the observations are equi-spaced.Autocorrelation is a correlation coefficient However, instead of
correlation between two different variables, the correlation is between
two values of the same variable at times X i and X i+k.When the autocorrelation is used to detect non-randomness, it isusually only the first (lag 1) autocorrelation that is of interest When theautocorrelation is used to identify an appropriate time series model, theautocorrelations are usually plotted for many lags
1.3.5.12 Autocorrelation
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35c.htm (1 of 4) [5/1/2006 9:57:45 AM]
Trang 10Sample Output Dataplot generated the following autocorrelation output using the
LEW.DAT data set:
THE LAG-ONE AUTOCORRELATION COEFFICIENT OF THE
200 OBSERVATIONS = -0.3073048E+00
THE COMPUTED VALUE OF THE CONSTANT A = -0.30730480E+00
lag autocorrelation
Trang 11Importance Randomness is one of the key assumptions in determining if a
univariate statistical process is in control If the assumptions ofconstant location and scale, randomness, and fixed distribution arereasonable, then the univariate process can be modeled as:
where E i is an error term
If the randomness assumption is not valid, then a different model needs
to be used This will typically be either a time series model or a
non-linear model (with time as the independent variable)
Related
Techniques
Autocorrelation PlotRun Sequence PlotLag Plot
Runs Test
Case Study The heat flow meter data demonstrate the use of autocorrelation in
determining if the data are from a random process
The beam deflection data demonstrate the use of autocorrelation indeveloping a non-linear sinusoidal model
Software The autocorrelation capability is available in most general purpose
statistical software programs, including Dataplot
1.3.5.12 Autocorrelation
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35c.htm (3 of 4) [5/1/2006 9:57:45 AM]
Trang 121.3.5.12 Autocorrelation
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35c.htm (4 of 4) [5/1/2006 9:57:45 AM]
Trang 131 Exploratory Data Analysis
Typical Analysis
and Test
Statistics
The first step in the runs test is to compute the sequential differences (Y i
-Y i-1) Positive values indicate an increasing value and negative valuesindicate a decreasing value A runs test should include information such asthe output shown below from Dataplot for the LEW.DAT data set Theoutput shows a table of:
runs of length exactly I for I = 1, 2, , 10
a z-score where the z-score is defined to be
where is the sample mean and s is the sample standard deviation.
5
The z-score column is compared to a standard normal table That is, at the5% significance level, a z-score with an absolute value greater than 1.96indicates non-randomness
There are several alternative formulations of the runs test in the literature Forexample, a series of coin tosses would record a series of heads and tails A
1.3.5.13 Runs Test for Detecting Non-randomness
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35d.htm (1 of 5) [5/1/2006 9:57:45 AM]
Trang 14run of length r is r consecutive heads or r consecutive tails To use the Dataplot RUNS command, you could code a sequence of the N = 10 coin
tosses HHHHTTHTHH as
1 2 3 4 3 2 3 2 3 4that is, a heads is coded as an increasing value and a tails is coded as adecreasing value
Another alternative is to code values above the median as positive and valuesbelow the median as negative There are other formulations as well All ofthem can be converted to the Dataplot formulation Just remember that itultimately reduces to 2 choices To use the Dataplot runs test, simply codeone choice as an increasing value and the other as a decreasing value as in theheads/tails example above If you are using other statistical software, youneed to check the conventions used by that program
Sample Output Dataplot generated the following runs test output using the LEW.DAT data
set:
RUNS UP
STATISTIC = NUMBER OF RUNS UP
OF LENGTH EXACTLY I
I STAT EXP(STAT) SD(STAT) Z
STATISTIC = NUMBER OF RUNS UP
OF LENGTH I OR MORE
I STAT EXP(STAT) SD(STAT) Z
1 60.0 66.5000 4.1972 -1.55
2 42.0 24.7917 2.8083 6.13
1.3.5.13 Runs Test for Detecting Non-randomness
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35d.htm (2 of 5) [5/1/2006 9:57:45 AM]
Trang 15RUNS DOWN
STATISTIC = NUMBER OF RUNS DOWN
OF LENGTH EXACTLY I
I STAT EXP(STAT) SD(STAT) Z
STATISTIC = NUMBER OF RUNS DOWN
OF LENGTH I OR MORE
1.3.5.13 Runs Test for Detecting Non-randomness
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35d.htm (3 of 5) [5/1/2006 9:57:45 AM]
Trang 16RUNS TOTAL = RUNS UP + RUNS DOWN
STATISTIC = NUMBER OF RUNS TOTAL
OF LENGTH EXACTLY I
I STAT EXP(STAT) SD(STAT) Z
STATISTIC = NUMBER OF RUNS TOTAL
OF LENGTH I OR MORE
I STAT EXP(STAT) SD(STAT) Z
LENGTH OF THE LONGEST RUN UP = 3 LENGTH OF THE LONGEST RUN DOWN = 2 LENGTH OF THE LONGEST RUN UP OR DOWN = 3
NUMBER OF POSITIVE DIFFERENCES = 104 NUMBER OF NEGATIVE DIFFERENCES = 95 NUMBER OF ZERO DIFFERENCES = 0
1.3.5.13 Runs Test for Detecting Non-randomness
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35d.htm (4 of 5) [5/1/2006 9:57:45 AM]
Trang 17Interpretation of
Sample Output
Scanning the last column labeled "Z", we note that most of the z-scores forrun lengths 1, 2, and 3 have an absolute value greater than 1.96 This is strongevidence that these data are in fact not random
Output from other statistical software may look somewhat different from theabove output
Question The runs test can be used to answer the following question:
Were these sample data generated from a random process?
●
Importance Randomness is one of the key assumptions in determining if a univariate
statistical process is in control If the assumptions of constant location andscale, randomness, and fixed distribution are reasonable, then the univariateprocess can be modeled as:
where E i is an error term
If the randomness assumption is not valid, then a different model needs to beused This will typically be either a times series model or a non-linear model(with time as the independent variable)
Related
Techniques
AutocorrelationRun Sequence PlotLag Plot
Case Study Heat flow meter data
Software Most general purpose statistical software programs, including Dataplot,
support a runs test
1.3.5.13 Runs Test for Detecting Non-randomness
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35d.htm (5 of 5) [5/1/2006 9:57:45 AM]
Trang 181 Exploratory Data Analysis
extreme value type I, and logistic distributions We do not provide the tables ofcritical values in this Handbook (see Stephens 1974, 1976, 1977, and 1979)since this test is usually applied with a statistical software program that willprint the relevant critical values
The Anderson-Darling test is an alternative to the chi-square and
Kolmogorov-Smirnov goodness-of-fit tests
Definition The Anderson-Darling test is defined as:
Ha: The data do not follow the specified distributionTest
Statistic:
The Anderson-Darling test statistic is defined as
where
F is the cumulative distribution function of the specified
distribution Note that the Y i are the ordered data.
1.3.5.14 Anderson-Darling Test
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35e.htm (1 of 5) [5/1/2006 9:57:46 AM]
Trang 19CriticalRegion:
The critical values for the Anderson-Darling test are dependent
on the specific distribution that is being tested Tabulated valuesand formulas have been published (Stephens, 1974, 1976, 1977,
1979) for a few specific distributions (normal, lognormal,exponential, Weibull, logistic, extreme value type 1) The test is
a one-sided test and the hypothesis that the distribution is of aspecific form is rejected if the test statistic, A, is greater than thecritical value
Note that for a given distribution, the Anderson-Darling statisticmay be multiplied by a constant (which usually depends on the
sample size, n) These constants are given in the various papers
by Stephens In the sample output below, this is the "adjustedAnderson-Darling" statistic This is what should be comparedagainst the critical values Also, be aware that different constants(and therefore critical values) have been published You justneed to be aware of what constant was used for a given set ofcritical values (the needed constant is typically given with thecritical values)
Sample
Output
Dataplot generated the following output for the Anderson-Darling test 1,000random numbers were generated for a normal, double exponential, Cauchy,and lognormal distribution In all four cases, the Anderson-Darling test wasapplied to test for a normal distribution When the data were generated using anormal distribution, the test statistic was small and the hypothesis was
accepted When the data were generated using the double exponential, Cauchy,and lognormal distributions, the statistics were significant, and the hypothesis
of an underlying normal distribution was rejected at significance levels of 0.10,0.05, and 0.01
The normal random numbers were stored in the variable Y1, the doubleexponential random numbers were stored in the variable Y2, the Cauchyrandom numbers were stored in the variable Y3, and the lognormal randomnumbers were stored in the variable Y4
***************************************
** anderson darling normal test y1 **
***************************************
ANDERSON-DARLING 1-SAMPLE TEST THAT THE DATA CAME FROM A NORMAL DISTRIBUTION
1 STATISTICS:
NUMBER OF OBSERVATIONS = 1000 MEAN = 0.4359940E-02
1.3.5.14 Anderson-Darling Test
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35e.htm (2 of 5) [5/1/2006 9:57:46 AM]
Trang 20STANDARD DEVIATION = 1.001816
ANDERSON-DARLING TEST STATISTIC VALUE = 0.2565918 ADJUSTED TEST STATISTIC VALUE = 0.2576117
2 CRITICAL VALUES:
90 % POINT = 0.6560000
95 % POINT = 0.7870000 97.5 % POINT = 0.9180000
99 % POINT = 1.092000
3 CONCLUSION (AT THE 5% LEVEL):
THE DATA DO COME FROM A NORMAL DISTRIBUTION.
***************************************
** anderson darling normal test y2 **
***************************************
ANDERSON-DARLING 1-SAMPLE TEST THAT THE DATA CAME FROM A NORMAL DISTRIBUTION
1 STATISTICS:
NUMBER OF OBSERVATIONS = 1000 MEAN = 0.2034888E-01 STANDARD DEVIATION = 1.321627
ANDERSON-DARLING TEST STATISTIC VALUE = 5.826050 ADJUSTED TEST STATISTIC VALUE = 5.849208
2 CRITICAL VALUES:
90 % POINT = 0.6560000
95 % POINT = 0.7870000 97.5 % POINT = 0.9180000
99 % POINT = 1.092000
3 CONCLUSION (AT THE 5% LEVEL):
THE DATA DO NOT COME FROM A NORMAL DISTRIBUTION.
***************************************
** anderson darling normal test y3 **
***************************************
ANDERSON-DARLING 1-SAMPLE TEST THAT THE DATA CAME FROM A NORMAL DISTRIBUTION
1 STATISTICS:
NUMBER OF OBSERVATIONS = 1000 MEAN = 1.503854 STANDARD DEVIATION = 35.13059
ANDERSON-DARLING TEST STATISTIC VALUE = 287.6429 ADJUSTED TEST STATISTIC VALUE = 288.7863
1.3.5.14 Anderson-Darling Test
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35e.htm (3 of 5) [5/1/2006 9:57:46 AM]
Trang 21
2 CRITICAL VALUES:
90 % POINT = 0.6560000
95 % POINT = 0.7870000 97.5 % POINT = 0.9180000
99 % POINT = 1.092000
3 CONCLUSION (AT THE 5% LEVEL):
THE DATA DO NOT COME FROM A NORMAL DISTRIBUTION.
***************************************
** anderson darling normal test y4 **
***************************************
ANDERSON-DARLING 1-SAMPLE TEST THAT THE DATA CAME FROM A NORMAL DISTRIBUTION
1 STATISTICS:
NUMBER OF OBSERVATIONS = 1000 MEAN = 1.518372 STANDARD DEVIATION = 1.719969
ANDERSON-DARLING TEST STATISTIC VALUE = 83.06335 ADJUSTED TEST STATISTIC VALUE = 83.39352
2 CRITICAL VALUES:
90 % POINT = 0.6560000
95 % POINT = 0.7870000 97.5 % POINT = 0.9180000
99 % POINT = 1.092000
3 CONCLUSION (AT THE 5% LEVEL):
THE DATA DO NOT COME FROM A NORMAL DISTRIBUTION.
Interpretation
of the Sample
Output
The output is divided into three sections
The first section prints the number of observations and estimates for the
location and scale parameters
1
The second section prints the upper critical value for theAnderson-Darling test statistic distribution corresponding to varioussignificance levels The value in the first column, the confidence level ofthe test, is equivalent to 100(1- ) We reject the null hypothesis at thatsignificance level if the value of the Anderson-Darling test statisticprinted in section one is greater than the critical value printed in the lastcolumn
2
The third section prints the conclusion for a 95% test For a differentsignificance level, the appropriate conclusion can be drawn from thetable printed in section two For example, for = 0.10, we look at therow for 90% confidence and compare the critical value 1.062 to the
3
1.3.5.14 Anderson-Darling Test
http://www.itl.nist.gov/div898/handbook/eda/section3/eda35e.htm (4 of 5) [5/1/2006 9:57:46 AM]