260 likes | 446 Views
Hypothesis Testing. What’s a hypothesis. A statistical hypothesis is an assumption about a population parameter. This assumption may or may not be true. Null and Alternative Hypothesis. The Null Hypothesis (H 0 ) Sample observations are resulting purely from chance
E N D
What’s a hypothesis • A statistical hypothesis is an assumption about a population parameter. • This assumption may or may not be true http://stattrek.com/Lesson5/HypothesisTesting.aspx?Tutorial=Stat
Null and Alternative Hypothesis • The Null Hypothesis (H0) • Sample observations are resulting purely from chance • H0 always contains an “equals” statement • The null hypothesis is assumed to be true • We need strong statistical evidence to reject it • The Alternative Hypothesis (Ha) • This is usually what we’re trying to prove • Everything that’s not the null hypothesis • Sample observations are influenced by some non-random cause
Null and Alternative Hypothesis • For example
Hypothesis • We want to know if a coin is fair and balance. • H0: Probability of each coin toss coming up heads = 0.5. • Ha: Probability of each coin toss coming up heads ≠ 0.5. • Suppose we test this hypothesis by flipping the coin 50 times. • What would we conclude?
Introduction • Consider the following hypotheses. • The director of a city’s transit system claims that 35% of the system’s riders consists of senior citizens. In a recent study, researchers found that only 23% of the riders were seniors. Is the director’s claim wrong? (Transit example) • A parts supplier claims that no more than 20% of the parts he delivers are defective. But a random sample of a recent delivery shows that 25% of the parts were defects. Is the suppliers claim wrong? (Parts example)
Formulating the Hypotheses • Transit example • Assertion: 35% of the riders are senior citizens • Null hypothesis: H0: π = 0.35 • The null hypothesis is identical to the transit manager’s statement since he claimed an exact value for the parameter. • Alternative hypothesis: Ha: π ≠ 0.35 • If the null is incorrect, the proportion must be something other than 0.35.
Formulating the Hypotheses • Parts example • Assertion: Not more than 20% of the parts are defective • Null hypothesis: H0: π ≤ 0.20 • Alternative hypothesis: Ha: > 0.20
Hypothesis Testing • State the hypotheses • Null • Alternate • Formulate an analysis plan • How to use the sample data • Significance level • Test method • Mean, proportion, difference between means, z-score, t-score, etc.
Hypothesis testing • Analyze sample data • Test statistic = • p-value • Interpret the result
Null and Alternative Hypothesis - Practice • A research firm claims that 62% of women age 40-49 participate in a 401(k) retirement account. • We want to test this percentage by randomly selecting a group of 300 women. • What are the null and alternative hypotheses?
Decision errors • Type I Error • A Type I error occurs when the researcher rejects a null hypothesis when it is true. • The probability of committing a Type I error = thesignificance level (α). • Type II Error • A Type II error occurs when the researcher fails to reject a null hypothesis that is false. • The probability of committing a Type II error is called Beta, and is often denoted by β. • The probability of not committing a Type II error is called the power of the test.
2-Tail Test, σ KnownExample • When a robot welder is in adjustment, its mean time to perform a task is 1.325 minutes. • Past experience tells us the standard deviation for the cycle time is 0.0396 minutes. • Using a recent random sample of 80 jobs, the mean cycle time for the welder was 1.3229 minutes. • Do we need to adjust the machine?
1-Tail Test, σ KnownPractice • Our company produces light bulbs with a mean life of 1030.0 hours and a standard deviation of 90.0 hours. • We’re approached by a salesman who says he can sell us a process that will extend the life of our bulbs. • We decide to test this product and, using a sample of 40 bulbs, we discover that the mean life for our bulbs using the new process is 1061.6 hours. • Should we invest in this new process?
Hypothesis Testing - Practice • When set properly, a machine produces nails that are 2 inches long with a standard deviation of 0.070 inches. • We took a sample of 35 nails and found that their mean length was 2.025 inches. • Using a significance level of 0.01, is the machine properly adjusted?
p-values • The p-value is the probability that we would get a test statistic as extreme as the one observed, if the null hypothesis was true. • In practice, all statistical software packages calculate a p-value and return that value as part of the data. • If p-value is ≤ our level of significance, we have evidence to reject H0
Experiment • I took a random sample (n=30) from a population with a known standard deviation (σ=1) and a known mean (μ=0)
Experiment • I then used a statistical package (Minitab®) to run a 1-sample z-test. Here are my results: Test of mu = 0 vs not = 0 The assumed standard deviation = 1 Variable N Mean StDev SE Mean 95% CI Z C1 30 -0.420281 1.113508 0.182574 ( -0.778120, -0.062442) -2.30 Variable P C1 0.021 • What happened?
Testing a Meanσ Unknown • The credit manager of a department store claims that the mean balance for the store’s charge account customers is $410. • An independent auditor selects 18 accounts at random and finds a mean balance of $511.33 and a standard deviation of $183.75. • The population of account balances is assumed to be normally distributed. • Is the credit manager correct?
Testing a mean • An inventor developed an, energy-efficient lawn mower engine. He claims that the engine will run continuously for 5 hours on one gallon of regular gasoline. • Suppose a simple random sample of 50 engines is tested. The engines run for an average of 295 minutes, with a standard deviation of 20 minutes. • We want to test this claim(α = .05)
Process • State the hypotheses • Formulate an analysis plan • Analyze sample data • Interpret results
Testing a mean • Bon Air Elementary School has 300 students. The principal of the school thinks that the average IQ of students at Bon Air is at least 110. To prove her point, she administers an IQ test to 20 randomly selected students. Among the sampled students, the average IQ is 108 with a standard deviation of 10. Based on these results, should the principal accept or reject her original hypothesis? Assume a significance level of 0.01.
Example two • State the hypotheses • Formulate an analysis plan • Analyze sample data • Interpret results
Hypothesis test: Difference between two means • Two sample t-test • The sampling method for each sample is simple random sampling • The samples are independent. • Each population is at least 20 times larger than its respective sample. • Each sample is drawn from a normal or near-normal population.
Difference between means • Within a school district, students were randomly assigned to one of two Math teachers - Mrs. Smith and Mrs. Jones. After the assignment, Mrs. Smith had 30 students, and Mrs. Jones had 25 students. • At the end of the year, each class took the same standardized test. Mrs. Smith's students had an average test score of 78, with a standard deviation of 10; and Mrs. Jones' students had an average test score of 85, with a standard deviation of 15. • Can we determine if Mrs. Smith and Mrs. Jones are equally effective teachers. Use a 0.10 level of significance. (Assume that student performance is approximately normal.)
Minitab output Two-Sample T-Test and CI Sample N Mean StDev SE Mean 1 30 78.0 10.0 1.8 2 25 85.0 15.0 3.0 Difference = mu (1) - mu (2) Estimate for difference: -7.00 90% CI for difference: (-12.91, -1.09) T-Test of difference = 0 (vs not =): T-Value = -1.99 P-Value = 0.053 DF = 40