Hypothesis TestingHypothesis testing Null hypothesisPurpose Test the viabilityNull hypothesis Population parameter Reverse of what the experimenter believes
Hypothesis Testing1. State the null hypothesis, H02. State the alternative hypothesis, HA3. Choose , our significance level4. Select a statistical test, and find the observed test statistic5. Find the critical value of the test statistic ( and p value) 6. Compare the observed test statistic with the critical value, (or compare the p value with ), and decide to accept or reject H0
Types of ErrorsYou used a decision rule to make a decision, but was the decision correct?
Not Fair Coin
Type II error
Not Fair Coin
Type I error
Modified Coin ExperimentWhich coins are fair?
Cases in Hypothesis Testing Means - variance known - variance unknown
Comparison of means - unpaired, variance known - comparison of variances - unpaired, variances unknown but equal - unpaired, variances unknown and unequal - paired
Comparison of Proportion
One sample t-test
Statistical Hypothesis Test
Two-Sided Test of HypothesisThe test of hypothesis is two-sided if the null is rejected when the actual value of interest is either less than or greater than the hypothesized value.H0: 15.00HA: 15.00
Two-Sided Test of Hypothesis
One-Sided Test of HypothesisIn many situations, you are only interested in one direction. Perhaps you only want evidence that the mean is significantly lower than fifteen.For example, instead of testingH0: = 15 versus H1: 15you testH0: 15 versus H1: < 15
One-Sided Test of Hypothesis
The Critical Values of Z to memorizeTwo tailed hypothesisReject the null (H0) if z z/2, or z - z/2One tailed hypothesisIf HA is > Xbar, then reject H0 if z zIf HA is < Xbar, then reject H0 if z - z
The Z-test an exampleSuppose that you took a sample of 25 people off the street in Morgantown and found that their personal income is $24,379And you have information that the national average for personal income per capita is $31,632 in 2003.Is the Morgantown significantly different from the National Average
Sources: (1) Economagic(2) US Bureau of Economic Analysis
What to conclude?Should you conclude that West Virginia is lower than the national average? Is it significantly lower?Could it simple be a randomly bad sampleAssume that it is not a poor sampling techniqueHow do you decide?
Example (cont.)We will hypothesize that WV income is lower than the national average.H0: WVInc = USInc (Null Hypothesis)HA: WVInc < USInc (Alternate Hypothesis)
Statistician can write by :H0: $31,632HA: < $31,632
Since we know the national average ($31,632) and standard deviation (15000), we can use the z-test to make decide if WV is indeed significantly lower than the nation
Example (cont.)Using the z-test, we get
For = 5% -z = -z0.05 = -1.645
THE DECISION IS REJECT H0 SO West Virginia is lower than the national average
The t testWhen we cannot use the population standard deviation, we must employ a different statistical testThink of it this way:The sample standard deviation is biased a little low, but we know that as the sample size gets larger, it becomes closer to the true value.As a result, we need a sampling distribution that makes small sample estimates conservative, but gets closer to the normal distribution as the sample size gets larger, and the sample standard deviation more closely resembles the population standard deviation.
The t-test (cont.)The t-test is a very similar formula.
Note the two differencesusing s instead of The resultant is a value that has a t-distribution instead of a standard normal one.
The Critical Values of tTwo tailed hypothesisReject the null (H0) if t t/2(n-1), or t - t/2(n-1) Reject H0 if |t| t/2(n-1)One tailed hypothesisIf HA is > Xbar, then reject H0 if t t(n-1)If HA is < Xbar, then reject H0 if t - t(n-1)
Reject H0 if |t| t(n-1)
T-test exampleSuppose we decided to look at Oregon, but do not know the population standard deviationAnd we have a small sample anyway (N=25).
without an a priori reason to hypothesize higher or lower, use the 2-tailed testAssume Oregon has a mean of 29,340, and that we collected a sample of 169.Using the t-test, we get
Critical value = t.025(168) = 1.96 Since |-1.9684| > 1.96REJECT H0
Two sample t-test Two-Sample t-Tests
Other ExamplesIs the income of blacks lower than whites?Are teachers salaries in West Virginia and Mississippi alike?Is there any difference between the background well and the monitoring well of a landfill?
The Difference of means Test Frequently we wish to ask questions that compare two groups.Is the mean of A larger (smaller) than B?Are As different (or treated differently) than Bs?Are A and B from the same population?To answer these common types of questions we use the standard two-sample t-test
independent observationsnormally distributed data for each groupequal variances for each group.
The Difference of means Test The standard two-sample t-test is:
The equal Variance testIf the variances from the two samples are the same we may use a more powerful variation
If the variances from the two samples are the same we may use a more powerful variation
With degree of freedom:
The unequal Variance test
Which test to Use?In order to choose the appropriate two-sample t-test, we must decide if we think the variances are the same.Hence we perform a preliminary statistical test the equal variance F-test.
The Equal Variance F-testOne of the fortunate properties on statistics is that the ratio of two variances will have an F distribution.Thus with this knowledge, we can perform a simple test.
F Test for Equality of Variances
Interpretation of F-testIf we find that F > F (n1-1,n2-1) , (P(F) > .05), we conclude that the variances are unequal.
If we find that F F (n1-1,n2-1) , (P(F) .05), we conclude that the variances are unequal.
We then select the equal or unequal-variance t-test accordingly.
Test Statistics and p-ValuesF Test for equal variances:H0: 12 = 22Variance Test:F = 1.51DF = (3,3)t-Tests for equal means:H0: 1 = 2Unequal Variance t-test:T = 7.4017 DF = 5.8Equal Variance t-test:T = 7.4017 DF = 6.0
What would we conclude?
Large SampleH0 : p = p0HA : p p0 or HA: p < p0 or HA: p > p0
Test statistic :
ExampleDo you think it shoul or should not be government implementation the law of pornography and pornoaction?Let p denote the population proportion of Indonesia adults who believe it should bep < .5 minorityp > .5 majority
Continued exampleThis data is not real, just for ilustrationSuppose from 1534 adults, 812 believe it should beH0 : p = .5HA : p .5
The critical value for = 5% z.025 = 1.96The conclusion - Reject H0 majority adults agree if government implementation the law of pornography and pornoaction
Comparison two proportion
Large sampleH0 : p1 = p2HA : p1 p2
Test statistic :
= x1/n1, = x2/n2, = (x1 + x2)/(n1 + n2)
ReferenceAgresti, A. & Finlay, B. 1997. Statistical Methods for the Social Sciences 3rd Edition. Prentice Hall.Mac Gregor. 2006. Lecture 3: Review of Basic Statistics. McMaster UniversityPS 601 Notes Part II Statistical Tests SAS IncTang, A. 2004. Lecture 9 Common Statistical Test. Tufts University
*INTERNAL USE FIG. 01s04f01
***INTERNAL USE FIG. 01s04f02
*INTERNAL USE FIG. 01s04f03
*INTERNAL USE FIG. 01s04f04
*INTERNAL USE FIG. 01s04f05
*INTERNAL USE FIG. 01S04F06
*INTERNAL USE FIG. 01S04F07
*INTERNAL USE FIG. 01s05f01
*INTERNAL USE FIG. 01s05f02
*INTERNAL USE FIG. 01s05f03
*INTERNAL USE FIG. 01s04f08