06.02.2024 8. HYPOTHESIS TESTING Hypothesis Testing and the p-value Learning Objectives • Develop null and alternative hypotheses to test for a given situation. • Understand the critical regions of a graph for single- and two-tailed hypothesis tests. • Calculate a test statistic to evaluate a hypothesis. • Test the probability of an event using the p-value. • Understand Type I and Type II errors. • Calculate the power of a test. 8. HYPOTHESIS TESTING Hypothesis testing: • Educated guesses about a population based on a sample drawn from the population. ο± For example: making guesses about the difference between the hypothesized value of the mean of an overall population and that of the sample. 1 06.02.2024 8. HYPOTHESIS TESTING Developing Null and Alternative Hypotheses (the mean as example) 8. HYPOTHESIS TESTING Hypothesis testing The end result of a hypotheses testing procedure is a choice of one of the following two possible conclusions: 1. Reject π» (and therefore accept Ha), or 2. Fail to reject π» (and therefore fail to accept Ha). 2 06.02.2024 8. HYPOTHESIS TESTING For example, if we were to test the hypothesis that the seniors had a mean SAT score (Scholastic Aptitude Test) of 1100, our null hypothesis would be that the SAT score would be equal to 1100 or: π―π : π ππππ where: π» symbol for null hypothesis π population mean 1100 = value to be tested We test the null hypothesis against an alternative hypothesis 1100 π―π : π 8. HYPOTHESIS TESTING Example: We have a medicine that is being manufactured and each pill is supposed to have 14 milligrams of the active ingredient. What are our null and alternative hypotheses? Solution: π» :π 14 π» :π 14 3 06.02.2024 8. HYPOTHESIS TESTING Example: The school principal wants to test if it is true what teachers say – that high school juniors use the computer an average 3.2 hours a day. What are our null and alternative hypotheses? Solution: π» :π π» :π 3.2 3.2 8. HYPOTHESIS TESTING Deciding whether to reject the Null Hypothesis: Single and Two-Tailed Hypothesis Tests When a hypothesis is tested, a statistician must decide on how much evidence is necessary in order to reject the null hypothesis. 4 06.02.2024 8. HYPOTHESIS TESTING Statisticians first choose a level of significance or alpha πΆ level, which is an event probability below which discrepancies from the null hypothesis are deemed significant. The most frequently used levels of significance are 0.05 and 0.01. A two-tailed test example: 8. HYPOTHESIS TESTING Single-tail hypothesis The critical region for the single-tail hypothesis test is defined differently. ο± A single-tail hypothesis test is used when the direction of the results is anticipated or we are only interested in one direction of the results. 5 06.02.2024 8. HYPOTHESIS TESTING Single-tail hypothesis Using our example about SAT scores of graduating seniors, our null and alternative hypothesis could look something like: π» :π π»:π 1100 1100 ο± In this scenario, our null hypothesis states that the mean SAT scores would be lower equal to 1100 ο± The alternate hypothesis states that the SAT scores would be greater than 1100. 8. HYPOTHESIS TESTING Single-tail hypothesis The alternative hypothesis looks different. π» :π π»:π 1100 1100 • To calculate the critical regions, we must first find the critical values or the cut-offs where the critical regions start. • To find these values, we use the critical values found specified by the z-distribution. 6 06.02.2024 8. HYPOTHESIS TESTING Lower-tailed test π» :π π π»:π π Reject if π§ Upper-tailed test π§ π» :π π π»:π π Reject if π§ Two-tailed test π§ π» :π π π»:π π Reject if π§ π§ ∪π§ π§ The rejection regions defined by the decision rule for upper-, lower- and two-tailed π§ tests with α=0.05. π 1.645 8. HYPOTHESIS TESTING Calculating the Test Statistic for testing the mean Before evaluating our hypotheses by determining the critical region and calculating the test statistic, we need to first: 1. Confirm that the distribution of the mean is normal or approximatively normal (π 30?) 2. Determine the hypothesized mean ππ of the distribution 3. If we don’t have the population variance ππ , we will need to calculate the standard deviation of the sample π πππ π ππππππ π so that we can estimate the standard error of the mean πΊπ¬ π • • π π If the variance is unknown we need to use the t-distribution If the variance is unknown but the sample size is large enough (π it can be assumed that the test statistic and the mean are approximatively normal distributed 30 7 06.02.2024 8. HYPOTHESIS TESTING If the population variance is not known (but the sample size is large enough) the z π ππππ determines how different the two means are from each other. π§ π₯Μ π ππΈ π₯Μ π₯Μ π π π Example: College A has an average SAT score of 1500. From a random sample of 125 freshman psychology students we find the average SAT score to be 1450 with a standard deviation of 100. • Are these freshman psychology students representative of the overall population? 8. HYPOTHESIS TESTING Example: A farmer is trying out a planting technique that he hopes will increase the yield on his pea plants. Over the last 5 years, the average number of pods on one of his pea plants was 145 pods with a standard deviation of 100 pods. This year, after trying his new planting technique, he takes a random sample of size 144 of his plants and finds the average number of pods to be 147. He wonders whether or not this is a statistically significant increase. • What is his hypotheses and the test statistic? • What can be said about the increase? 8 06.02.2024 Example of a Two-Tailed Test As a hypothetical example from finance: Imagine that a new stockbroker, named XYZ, claims that their brokerage fees are lower than that of your current stockbroker, ABC. Data available from an independent research firm indicates that the mean and standard deviation of all ABC broker clients are $18 and $6, respectively. A sample of 100 clients of ABC is taken, and brokerage charges are calculated with the new rates of XYZ broker. If the mean of the sample is $18.75 and the sample standard deviation is $6, can any inference be made about the difference in the average brokerage bill between ABC and XYZ broker? 9 06.02.2024 8. HYPOTHESIS TESTING Testing the p-value of an event Let’s use the example about the pea farmer. What if the farmer is really hoping is that some plants have a more dramatic yield increase. • What is the probability of a plant having a much higher yield of over 144 pea pods? 10