



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Introduction An important part of statistics is hypothesis testing – making a decision about some hypothesis (reject or accept), based on statistical methods. The four basic steps in any kind of hypothesis testing are: o Determine the null hypothesis and the alternative hypothesis. o Collect data and determine a test statistic. o Determine how unlikely the test statistic would be if the null hypothesis were true. o Make a decision based on the test statistic. These steps will become clearer when we do some example problems.
Hypotheses First, we need to clarify the difference between a null hypothesis and an alternative hypothesis : o A null hypothesis is defined as a theory that is being considered or tested. The null hypothesis has not been proven by a test, and may or may not be true. In many cases, the null hypothesis represents “nothing is happening,” hence the adjective “null.” [This is how a statistician thinks.] o An alternative hypothesis , also called a research hypothesis , is defined as the complement of the null hypothesis. The alternative hypothesis is typically the opposite of the null hypothesis, and is the theory that the researchers are trying to prove (or disprove). [This is how an engineer thinks.] A common application is in testing the relationship between two variables , as in clinical studies of drugs or lifestyles. Here are some examples: o Is there a statistically significant relationship between taking an aspirin a day and the risk of heart attack? Null hypothesis : There is no relationship between taking an aspirin a day and the risk of heart attack. Alternative hypothesis : There is a relationship between taking an aspirin a day and the risk of heart attack. o Is there a statistically significant relationship between drinking one can of beer before driving, and having a car accident? Null hypothesis : There is no relationship between drinking one can of beer before driving, and having a car accident. Alternative hypothesis : There is a relationship between drinking one can of beer before driving, and having a car accident.
Another common application is to test hypotheses about the population mean of a variable. In these types of problems, there are two parts to the null hypothesis: o The critical value of a variable under consideration (we set the null hypothesis to this value). o The type and side of the tail(s) of concern in the hypothesis test: Two-tailed test : We are concerned about values less than or greater than the critical value. Left-tailed test : We are concerned about values less than the critical value. Right-tailed test : We are concerned about values greater than the critical value. o For any of the above three types, we choose the least likely scenario as this part of the null hypothesis. Here are some examples: o Is the year-round average temperature in a room equal to 25.6o^ C?
likely scenario is that the population mean is exactly equal to the claimed value.
likely scenario. (The null hypothesis fails (is rejected) if the population mean temperature is either less than or greater than 25.6o^ C to some specified confidence level.) Some authors call this a two-sided alternative hypothesis , since we are interested in values on both sides of the claimed value (to the left of (less than) or right of (greater than) the claimed value). The test we perform in this case is called a two-sided test or a two-tailed test. o Can a strut hold a load of at least 800.0 kg without breaking?
There are two possibilities, depending on the experimental results:
hypothesis. In other words, the null hypothesis is that the actual population mean is greater than
This is a left-tailed test , based on this choice of the null hypothesis.
hypothesis. In other words, the null hypothesis is that the actual population mean is less than the
This is a right-tailed test , based on this choice of the null hypothesis. Alternative hypothesis : We choose the opposite of the null hypothesis, which is the most likely scenario based on our experimental observations. In other words,
In either case, the null hypothesis fails (is rejected) if the probability of it happening is very slim. Some authors call this a one-sided alternative hypothesis , since we are interested only in values on one side of the claimed value (either to the left or to the right of the critical value). The test we perform in this case is called a one-sided test , or a one-tailed test. The side of the alternative hypothesis is opposite that of the null hypothesis: For a left-tailed null hypothesis test , we have a right-tailed alternative hypothesis test. For a right-tailed null hypothesis test , we have a left-tailed alternative hypothesis test. The student’s t distribution is typically used for such studies of the population mean, and the test statistic is called the experimental t statistic , or simply the t statistic.
The p -value The p-value (short for probability value) is formally defined as the probability of observing a test statistic as extreme (or more extreme) as the one observed if the critical value of the null hypothesis were true. We can think of the p -value as the probability of wrongly rejecting the null hypothesis, if it is in fact true. Another way to think of it: p -value is the probability that the null hypothesis could occur by pure chance. A small p -value means that the null hypothesis is unlikely to be true – we reject the null hypothesis if the p - value is less than some level, which we choose. A large p -value means that the null hypothesis is more likely to be true – we do not reject the null hypothesis if the p -value is larger than some level, which we choose.
o If p < 0.05, we reject the null hypothesis because it has less than a 5% chance of being true. o If 0.05 < p , we cannot reject or accept the null hypothesis because it has more than a 5% chance of being true. The results are inconclusive – we should conduct more tests.
substitute 0.01 for 0.05 in the two criteria above. As will be seen when we do some example problems, we need to be very careful about factors of 2 that pop up, depending on whether the test is one-tailed or two-tailed; these factors of 2 can lead to trouble.
Types of errors in hypothesis testing There are two types of errors that can occur in hypothesis testing: o A type I error (also called an error of the first kind ) occurs when the null hypothesis is wrongly rejected. In other words, the null hypothesis is in fact true , but it is rejected erroneously. o A type II error (also called an error of the second kind ) occurs when the null hypothesis is wrongly accepted. In other words, the null hypothesis is in fact false , but it is accepted (not rejected) erroneously. In any given hypothesis test, type I and type II errors are inversely related. In other words, the smaller the risk (probability) of a type I error, the greater the risk of a type II error, and vice-versa.
The type of error of particular concern in engineering is usually determined by safety. Example : A strut is
For a two-sided test, the p -value is the sum of both shaded areas or tails on the plot. Since this is a two-sided test, we define the p -value as the probability that t > 2.9814. This represents the area under the student’s t PDF between < t < t -statistic plus the area under the student’s t PDF between t -statistic < t < (both shaded areas or tails in the plot). Fortunately, Excel has a function called TDIST(ABS( t ), df, tails) that calculates this probability, where t is the t -statistic, df is degrees of freedom, and tails is either 1 for a one-sided test or 2 for a two-sided test. We type “=TDIST(2.9814,19,2)” in a cell, and Excel returns the p -value: p -value = 0.00767. If Excel is not available, the p -value can be calculated on some hand calculators, and tables of p -value are available in statistics books. Several of these tables are also posted on the Exams tab of the website for this course.
level of c = 1 – 0.00767 = 0.9923 or about 99.2%. Final result: We are 99.2% confident that the null hypothesis should be rejected. o Note that the result of Method 2 agrees with that of Method 1, but no iteration is required. o The p -value is often listed in a report about hypothesis testing. For example, some authors would write, “We reject the manufacturer’s claim because p -value = 0.0077.” Alternately, some authors simply compare their p -value to standard levels of significance, e.g., “We reject the manufacturer’s claim because p -value < 0.05.” (95% confidence) or “We reject the manufacturer’s claim because p -value < 0.01.” (99% confidence), without actually reporting the p -value. Discussion: The 99.2% confidence level is a critical value – we reject the null hypothesis for any confidence level below this value (e.g., we are more than 95% confident that the null hypothesis is false). We could not reject the null hypothesis for any confidence level above this value (e.g., we cannot be 99.9% confident that the null hypothesis is false). Exactly the same procedure is used for one-sided tests, except that the variable “tails” in Excel’s TDIST function is set to 1 instead of 2. It turns out that the one-sided TDIST value is exactly half of the two-sided TDIST value, since the student’s t PDF is symmetric.
Example (One-Sided Hypothesis Test) : Given: The same resistors as those of the previous problem: For 20 tests ( n = 20), the sample mean resistance is x = 1.20 k, and the sample standard deviation is S = 0.30 k, as previously. In this case, however, the manufacturer claims that the population of resistors has an average resistance of at least 1.25 k. To do: To what confidence level can we accept the manufacturer’s claim? Solution: This is a one-sided test since we are concerned only that the actual population mean is greater than 1.25 k. Again we use the student’s t distribution to solve this problem: o The null hypothesis: First, the critical value is set to
hypothesis test. We thus choose the null hypothesis as
o We calculate the t -statistic: 0 /
x t S n
= –0.74536. Notice that x < 0 here, so t < 0. o A sketch of the student’s t PDF is extremely helpful here, so that we know which area(s) we are interested in; we plot f ( t ,df) for df = 19. [See plot.]
Area = /
2.9814 2.
Area = /
Area = = p
–0.
Area = 1 – p
o We type “=TDIST(0.74536,19,1)” in a cell in Excel, and Excel returns the p -value: p -value = 0.23259. Notice that we set the third argument in the function to 1 since this is a one-tailed test. o The red area on the above plot is equal to the p -value; as you can see, it is approximately one-quarter of the total area, which is consistent with the numerical value, p -value = 0.23259 or 23.259%. o This p -value represents a critical level of significance = p -value = 0.23259, corresponding to a critical confidence level of c = 1 – 0.23259 = 0.76741 or about 76.7%. o Statistically, there is about a 23.2% chance that the null hypothesis ( > 0 ) is true, even though our experiments indicate otherwise ( (^) x < 0 ). Since the null hypothesis is the same as the manufacturer’s claim in this case, We are 23.2% confident that the manufacturer’s claim is true. o Here is a simpler and somewhat “foolproof” way to interpret these probabilities: Since our experiments reveal that the sample mean x is less than 0 , we know that it is highly unlikely that the population mean would turn out to be greater than 0. Therefore, the manufacturer’s claim must have a probability less than 50%, so we pick the smaller of the two probabilities (23.3% and 76.7%) as the confidence level that the manufacturer’s claim is true. We state our final result: We are 23.2% confident that the manufacturer’s claim is true. To standard engineering confidence level (95%), we cannot accept or reject the manufacturer’s claim since 5% < 23.2%. o The bottom line from this hypothesis test: Inconclusive: We need to conduct more tests!
Example : Given: The same resistors and experiments as those of the previous problems. This time, the manufacturer claims that the population of resistors has an average resistance of at least 1.05 k. To do: To what confidence level can we accept the manufacturer’s claim? Solution: This is again a one-sided test since we are concerned only that the actual population mean is greater than 1.05 k. o The null hypothesis is stated: The critical value is set to 0 = 1.05 k. Since x = 1.20 k is greater than the critical value ( x > 0 ), this a right-tailed hypothesis test. We set the side of the null hypothesis as < 0 , which is the least likely scenario. o The alternative hypothesis is: > 0.
o The t -statistic is 0 /
x t S n
Notice that x > 0 here, so t > 0. o A sketch of the student’s t PDF is shown here. o We type “=TDIST(2.2361,19,1)” in a cell in Excel, and Excel returns the p -value: p -value = 0.. o The critical level of significance is = p -value = 0.01877, corresponding to a critical confidence level of c = 1 – 0.01877 = 0.98123 or about 98.1%. o Statistically, there is about a 1.9% chance that the null hypothesis ( < 0 ) is true, even though our experiments indicate otherwise ( x > 0 ). Since the null hypothesis is the opposite of the manufacturer’s claim in this case, We are 1.9% confident that the manufacturer’s claim is false. o Alternatively, we use the simpler “foolproof” method introduced in the previous example: Since our experiments show that the sample mean x is greater than 0 , we know that it is highly unlikely that the population mean would turn out to be less than 0. Therefore, the manufacturer’s claim must have a probability greater than 50%, so we pick the larger of the two probabilities (1.9% and 98.1%) as the confidence level that the manufacturer’s claim is true. So, we state our final result: We are 98.1% confident that the manufacturer’s claim is true. To standard engineering confidence level (95%), we accept the manufacturer’s claim, since 98.1% > 95%. o In summary, we accept the manufacturer’s claim to standard engineering confidence level only if we are confident to at least 95%, which is the case here. Our conclusion is thus: We accept the manufacturer’s claim since 98.1% > 95%. o The bottom line from this hypothesis test: We accept the manufacturer’s claim.. o [If our requirement were more strict (e.g., 99% confidence), we could not accept the claim.]
Area = = p
Area = 1 – p