MAL1303: STATISTICAL HYDROLOGY Hypothesis Test Dr. Shamsuddin Shahid Department of Hydraulics and Hydrology Faculty of Civil Engineering, Universiti Teknologi Malaysia Room No.: M46-332; Phone: 07-5531624; Mobile: 0182051586 Email: [email protected]11/23/2015 Shamsuddin Shahid, FKA, UTM You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
MAL1303: STATISTICAL HYDROLOGY
Hypothesis TestDr. Shamsuddin Shahid
Department of Hydraulics and HydrologyFaculty of Civil Engineering, Universiti Teknologi Malaysia
Environmental activist claimthat after introduction offertilizer based agriculturegroundwater quality of the areahas been deteriorated. Is itpossible to prove?
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
Sixteen (16) river dischargedata (randomly selected) oftwo rivers are collected. Fromthe mean of the dischargedata it is clear that River-Bhas higher dischargecompared to River-A. It ispossible to say discharge ofRiver-B is higher than River-A?
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
One important use of hypothesis tests is to evaluate andcompare groups of data. Statistical tests are the mostquantitative ways to determine whether hypotheses can besubstantiated, or whether they must be modified orrejected outright.
Hypothesis tests have at least two advantages over educatedopinion:
1. They insure that every analyst of a data set using thesame methods will arrive at the same result.
2. They present a measure of the strength of the evidence(the p-value).
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
1) Choose the appropriate test.2) Establish the null and alternate hypotheses.3) Decide on an acceptable error rate α.4) Compute the test statistic from the data.5) Compute the p-value.6) Reject the null hypothesis if p ≤ α.
Structure of Hypothesis Tests
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
There are a larger number of hypothesis tests. They are classified based on
1. The measurement scales of the data2. Distribution of the data
If the measurement scales are interval/ratio and data distribution isnormal, we use parametric hypothesis tests
If the measurement scales are not interval/ration (such as ordinal orcategorical) or event interval/ratio but not normally distribution,then we use non-parametric hypothesis tests.
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
The 'null' often refers to the common view of something, while thealternative hypothesis is what the researcher really thinks is the causeof a phenomenon. The null hypothesis is a hypothesis which theresearcher tries to disprove, reject or nullify.
The null hypothesis, denoted as H0
The alternative hypothesis, denoted as Ha
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
1) Choose the appropriate test.2) Establish the null and alternate hypotheses.3) Decide on an acceptable error rate α.4) Compute the test statistic from the data.5) Compute the p-value.6) Reject the null hypothesis if α p.
Structure of Hypothesis Tests
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
Permiability of groundwater is found to vary very widely in an area. Onehundred (n=100) permiability measurements are done in an area.Calculated mean of permiability of 100 measurements is 190. For someengineering purpose we need to know whether groundwater permiabilityin the area can have a mean value of 180 or not? We want to determine itat 95% level of confidence.
Ho: = 190 when =0.05 [Null hypothesis: mean value can be 190]
Ha: 190 when =0.05 [Alternative hypothesis: mean value can not be 190]
A Simple Example
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
Null HypothesisThe null hypothesis, denoted as H0, is expressed as follows for thet-test comparing two population means, µ1 and µ2:
H0: µ1 = µ2.
Alternative HypothesisThe alternative hypothesis, denoted as H1, is expressed as one ofthe following for the t test comparing two population means, µ1 andµ2:
H1: µ1 ≠ µ2 (two-tailed t test),
H1: µ1 < µ2 (one tailed t test),orH1: µ1 > µ2 (one-tailed t test).
Null Hypothesis
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
1. Once the t-statistic has been computed, we can compare ourestimated t value to critical t values given in a table for the tdistribution.
2. If estimated t value is greater than the critical t value entry in the ttable associated with a significance level of α (one-sided t test) orα/2 (two-sided t test) we can reject the null hypothesis.
3. Thus, we compare our t value to the t distribution table entry for:
t(α, n1 + n2 − 2) (one-sided)or
t(α/2, n1 + n2 − 2) (two-sided)
where α is the level of significance (equal to 1 – level ofconfidence), and n1 and n2 are the number of samples from eachof the two populations being compared.
Making Decision
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
Student t-test: ExampleGroundwater samples are from near aunderground mining area before thestarting mining and after mining are givenbelow. It is anticipated by many scientiststhat increasing concentration of Chemical-Xin groundwater due to the mining. Is it true?
Null Hypothesis, H0: µ1 = µ2[No change in groundwater quality]
Alternative Hypothesis, H1: µ1 ≠ µ2[Groundwater quality has changed]
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
Analysis of variance (ANOVA) is a method for testing the hypothesisthat there is no difference between two or more population means(usually at least three).
Why t-test cannot be applied?
• t-test, which is based on the standard error of the differencebetween two means, can only be used to test differencesbetween two means
• With more than two means, could compare each mean witheach other mean using t-tests. Conducting multiple t-tests canlead to error and is NOT RECOMMENDED
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
Calculating an ANOVA means that we want to calculate the Fstatistic. There are six steps to calculating the F statistic:
1. Calculation of “sum of squares” between the groups,2. Calculation of “sum of squares” within the groups,3. Determine the degrees of freedom for each.4. Calculation of “mean square between” and “mean square
within”5. Calculation of the F ratio (or F statistic)6. Making a decision
Calculating an ANOVA
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
Larger F-statistics mean more variation between the groupcompared to within the group. Larger F-statistics support thegroups are from different population.
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
Between Group Mean Square F = --------------------------------------------------
Within Group Mean Square
= 19.399 / 0.2199
= 88.2
F (0.05; 2,27) = 3.36
F(calculated)>F(critical). Therefore, we can reject null hypothesis.
Important:The F statistic doesn’t advise us about which groups are different, itonly says that mean values does or does not differ significantly bydifferent groups. In this case, it only says groundwater depth differssignificantly in different catchments.
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
When there is only one qualitative variable which denotes the groups and onlyone measurement variable (quantitative), a one-way ANOVA is carried out. Thepurpose of one-way ANOVA is to find out whether data from several groups havea common mean. That is, to determine whether the groups are actually differentin the measured characteristic.
The purpose of two-way ANOVA is to test the effectives of two independentvariables of several groups. One-way ANOVA and two-way ANOVA differ in thatthe groups in two-way ANOVA have two categories of defining characteristicsinstead of one.
Suppose sediment samples are collected from three different areas. Contents of two minerals (A & B) are measured for each sample. We want to see are the samples are different from area to area as well as from types of mineral contents.
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
• The Kruskal-Wallis test is a nonparametric (distribution free) test,which is used to compare three or more groups of sample data.
• Kruskal-Wallis Test is used when assumptions of ANOVA are not met.In ANOVA, we assume that distribution of each group should benormally distributed. In Kruskal-Wallis Test, we do not assume anyassumption about the distribution. So Kruskal-Wallis Test is adistribution free test.
• If normality assumptions are met, then the Kruskal-Wallis Test is not aspowerful as ANOVA.
• The Kruskal-Wallis Test was developed by Kruskal and Wallis jointlyand is named after them.
Kruskal-Wallis Test
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
1. Arrange the data of all samples in a single series in ascending order.2. Assign rank to them in ascending order. In the case of a repeated
value, assign ranks to them by averaging their rank position.3. Different samples are separated and summed up as R1 R2 R3, etc.4. To calculate the value of Kruskal-Wallis Test, apply the following
formula:
Where,H = Kruskal-Wallis Testn = total number of observations in all samplesRi = Rank of the sample
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
As part of research, studies were carried out to measure whether thenew method proposed by you (Method-A) can remote the Arsenic inwater more than the well-known existing method (Method-B). Atotal of 36 case studies were conducted. The obtained result is givenbelow. Do the data shown below indicate a significant difference inthe two method?
18 found Method-A is better (+ sign recorded)12 found Method-B is better (_ sign recorded)
6 cases both methods gives similar ambiguity
The analysis is based on a sample size of 18 + 12 = 30.
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
ProblemAs part of study, we want to seewhether concentration ofMineral-A is more compared toMineral-B in a place. We havecollected 14 samples and measurethe concentration of Mineral-Aand Mineral-B is the samples. Isthere any difference inconcentration of minerals in thesamples?
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
Preliminary Steps of the Test• Compute the differences between the paired observations.• Discard any differences of zero.• Rank the absolute value of the differences from lowest to
highest. Tied differences are assigned the average ranking of their positions.
• Give the ranks the sign of the original difference in the data.• Sum the signed ranks individually (“+” together and “–”
together)• Wilconxon Statistics W = minimum (“+” Rank; “-” Rank)• Compare calculated value to Wilconxon Tabulated value. • If your value less than the tabulated value Reject Null
Hypothesis
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
For example, we have sampled occurrence of some hydrologicaldisaster in every year, resulting in the data set:
Run TestRun Test
Where A denotes “No Disaster” and B denotes “Disaster” year. We areinterested in determining whether the order of the Disastruous year israndom or not. In some cases, some phenomena follows somepattern, Like below:
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
Unlike other tests there is no equation for the runs test unless thesample size of either group is greater than 30. One only needs tocount the number of runs (u), a run being a series of the samenominal value when counting from left to right.
Run TestRun Test
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
Run Test: Example (Two tailed)Run Test: Example (Two tailed)
Flood years in a place during the lasttwenty-one years (1990-2010) has beengiven in the table below. It has beenreported in different studies that climatechange has caused an increase of floodfrequency in the recent years. We wantto check whether it is true in the place ofour interest.
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)
If a one tailed runs test is used, we can determine whether the dataare either random, non-random due to clustering, or non-random dueto uniformity.
u has two critical values:If u < the lower u(critical )then the data are non-random due toclustering.If u > the upper u(Critical) then the data are non-random due touniformity.If u falls between the lower and upper uCritical then the data arerandom.
Run Test: Example (One tailed)Run Test: Example (One tailed)
11/23/2015 Shamsuddin Shahid, FKA, UTM
You created this PDF from an application that is not licensed to print to novaPDF printer (http://www.novapdf.com)