Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Introduction to Hypothesis Testing for One Population Mean Research Question Is the average body temperature of healthy adults different from 98.6°F? Introduction to Hypothesis Testing 98.2 98.5 98.3 98.1 98.3 98.7 98.1 98.4 98.2 98.4 98.3 98.2 HT - 1 Statistical Hypothesis x 98.31 s 0.17 HT - 2 Statistical Hypothesis Alternative hypothesis (HA): [or H1 or Ha] Null hypothesis (H0): Hypothesis of no difference or no relation, often has =, , or notation when testing value of parameters. Example: H0: = 98.6°F or H0: Average body temperature is 98.6 HT - 3 Usually corresponds to research hypothesis and opposite to null hypothesis, often has >, < or notation in testing mean. Example: HA: 98.6°F or HA: Average body temperature is not 98.6°F HT - 4 Hypotheses Statements Example • A researcher is interested in finding out whether average life time of male is higher than 77 years. One Sample Z-Test for Mean (Large sample test) H0: = 77 ( or 77 ) HA: > 77 [Right-tailed test] One-Sided Test HT - 5 HT - 6 Hypothesis Testing - 1 Introduction to Hypothesis Testing for One Population Mean I. Hypothesis Evidence What will be the key statistic (evidence) to use for testing the hypothesis about population mean? One wishes to test whether the average body temperature for healthy adults is less than 98.6°F. Sample mean: H0: = 98.6°F v.s. HA: < 98.6°F x A random sample of 36 subjects is chosen and the sample mean is 98.46°F and sample standard deviation is 0.3°F. This is a one-sided test, left-side test. HT - 7 HT - 8 Sampling Distribution II. Test Statistic x 0 x 0 z s sx -2.8 0 n 98.46 98.6 0.14 2.8 0.3 0.05 36 This implies that the statistic is 2.8 standard deviations away from the mean 98.6 in H0 , and is to the left of 98.6 (or less than 98.6) If H0: = 98.6°F is true, sampling distribution of mean → Normal with mean = 98.6 .3 standard deviation = = 0.05. 36 x 0.05 X 98.6 HT - 9 Level of Significance III. Decision Rule Critical value approach: Compare the test statistic with the critical values defined by significance level , usually = 0.05. We reject the null hypothesis, if the test statistic z < –z = –z0.05 = –1.64. Level of significance for the test () A probability level selected by the researcher at the beginning of the analysis that defines unlikely values of sample statistic if null hypothesis is true. Total tail area = c.v. = critical value HT - 10 Rejection region Left-sided Test c.v. 0 HT - 11 Not a common approach! =0.05 –1.64 –2.8 Z 0 Critical values HT - 12 Hypothesis Testing - 2 Introduction to Hypothesis Testing for One Population Mean p-value III. Decision Rule p-value The probability of obtaining a test statistic that is as extreme or more extreme than actual sample statistic value given null hypothesis is true. It is a probability that indicates the extremeness of evidence against H0. The smaller the p-value, the stronger the evidence in supporting HA and rejecting H0 . HT - 13 IV. Draw conclusion p-value approach: Compare the probability of the evidence or more extreme evidence to occur when null hypothesis is true. If this probability is less than the level of significance of the test, , then we reject the null hypothesis. p-value = P(z 2.8) = .003 = .05 Left tail area .003 Left-sided Test Z 0 –2.8 HT - 14 Decision Rule Since from either critical value approach z = 2.8 < z= 1.64 or p-value approach p-value = .003 < = .05 , we reject null hypothesis. Therefore we conclude that there is sufficient evidence to support the alternative hypothesis that the average body temperature is less than 98.6°F. p-value approach: Compute p-value, if HA : 0 , p-value = 2·P( Z | z |) if HA : > 0 , p-value = P( Z z ) if HA : < 0 , p-value = P( Z z ) reject H0 if p-value < HT - 15 HT - 16 Steps in Hypothesis Testing Errors in Hypothesis Testing 1. State hypotheses: H0 and HA. 2. Choose a proper test statistic, collect data, checking the assumption and compute the value of the statistic. 3. Make decision rule based on level of significance(). 4. Draw conclusion. (Reject null hypothesis if p-value < .) Possible statistical errors: • Type I error: The null hypothesis is true, but we reject it. • Type II error: The null hypothesis is false, but we don’t reject it. HT - 17 “” is the probability of committing Type I Error. 0 Z HT - 18 Hypothesis Testing - 3 Introduction to Hypothesis Testing for One Population Mean Can we see data and then make hypothesis? 1. Choose a test statistic, collect data, checking the assumption and compute the value of the statistic. 2. State hypotheses: H0 and HA. 3. Make decision rule based on level of significance(). 4. Draw conclusion. One Sample t-Test for Mean t x 0 s n HT - 19 One-sample Test with Unknown Variance 2 I. State Hypothesis In practice, population variance is unknown most of the time. The sample standard deviation s2 is used instead for 2. If the random sample of size n is from a normal distributed population and if the null hypothesis is true, the test statistic (standardized sample mean) will have a t-distribution with degrees of freedom n1. x Test Statistic : t 0 One-side test example: If one wish to test whether the body temperature is less than 98.6 or not. H0: = 98.6 v.s. HA: < 98.6 (Left-sided Test) s n HT - 21 II. Test Statistic HT - 22 III. Decision Rule If we have a random sample of size 16 from a normal population that has a mean of 98.46°F, and a sample standard deviation 0.2. The test statistic will be a t-test statistic and the value will be: (standardized score of sample mean) Test Statistic : t HT - 20 x 0 98.46 98.6 0.14 2.8 s 0.2 0.05 n 16 Under null hypothesis, this t-statistic has a tdistribution with degrees of freedom n – 1, that is, 15 = 16 1. HT - 23 Critical Value Approach: To test the hypothesis at level 0.05, the critical value is –t = –t0.05 = –1.753. Rejection Region –1.753 –2.8 0 t Descion Rule: Reject null hypothesis if t < –1.753 HT - 24 Hypothesis Testing - 4 Introduction to Hypothesis Testing for One Population Mean III. Decision Rule Decision Rule: Reject null hypothesis if p-value < . HT - 25 p-value Calculation HT - 26 IV. Conclusion p-value corresponding the test statistic: For t test, unless computer program is used, pvalue can only be approximated with a range because of the limitation of t-table. p-value = P(T<2.8) P(T<-2.8) =<? P(T<2.602) = 0.01 Since the area to the left of –2.602 is .01, the area to the left of –2.8 is definitely less than 0.01. Area to the left of –2.602 is 0.01 Decision Rule: If t < 1.753, we reject the null hypothesis, or if p-value < 0.05, we reject the null hypothesis. Conclusion: Since t = 2.8 < 1.753, or say p-value < 0.01 < 0.05, we reject the null hypothesis. There is sufficient evidence to support the research hypothesis that the average body temperature is less than 98.6°F. t Smaller than 0.01 –2.8 –2.602 HT - 27 What if we wish to test whether the average body temperature is different from 98.6°F using t-test with the same data? The p-value is equal to twice the p-value of the left-sided test which will be less than .02. HT - 28 Decision Rule p-value approach: Compute p-value, if HA : 0 , p-value = 2·P( T | t |) if HA : > 0 , p-value = P( T t ) if HA : < 0 , p-value = P( T t ) reject H0 if p-value < –2.8 0 2.8 HT - 29 HT - 30 Hypothesis Testing - 5 Introduction to Hypothesis Testing for One Population Mean When do we use this t-test for testing the mean of a population? Remarks • If the sample size is relatively large (>30) both z and t tests can be used for testing hypothesis. • “t-test” is robust against normality. • If the sample size is small and the sample is from a very skewed or other non-normal distribution, we can use nonparametric alternatives Signed-Rank Test. • Many commercial packages only provide t-test since standard deviation of the population is often unknown. • A random sample from normally distributed population with unknown variance. or • When sample size is relatively large the tscore is approximately equal to z-score therefore t-test will be almost the same as ztest. HT - 31 Sampling Distribution Average Weight for Female Ten Year Children In US S.E. = Info. from a random sample: x = 80 lb, s = 18.05 lb. Is average weight greater than 78 lb at = 0.05 level? H0 : Mean is 78 lb Ha: Mean is greater than 78 lb HT - 32 18.05 5.71 10 n = 10 X 78 80 t S.E. = 80 78 S .E. 18.05 0.90 400 n = 400 X HT - 33 Practical Significance? 78 80 HT - 34 Type I & Type II Error • Type I Error: reject the null hypothesis when it is true. The probability of a Type I Error is denoted by . • Type II Error: accept the null hypothesis when it is false and the alternative hypothesis is true. The probability of a Type II Error is denoted by . Power and Sample Size in Testing One Mean 35 1 – : Power of the test 36 Hypothesis Testing - 6 Introduction to Hypothesis Testing for One Population Mean Power of the Test Null hypothesis The power of the statistical test is the ability of the study as designed to distinguish between the hypothesized value and some specific alternative value. That is, the power is the probability of rejecting the null hypothesis if the null hypothesis is false. Decision True False Reject H0 Type I Error Correct Decision 1 Correct Decision 1 Type II Error Do not reject H0 Power = P(reject H0 | H0 is false) Power = 1 The power is usually calculated given a simple alternative hypothesis: Ha: = 211 mg/100ml Power = P(reject H0 | Ha is true) 37 For a two-sided test, the formula is Formula: The estimated sample size for a onesided test with level of significance and a power of 1 to detect a difference of a – 0 is, ( z z ) n a 0 ( z / 2 z ) n a 0 2 (z z ) n /2 2 2 39 Example: 40 ( z / 2 z ) n a 0 For testing hypothesis that H0: = 0 = 70 v.s. (Two-sided Test) 2 Or, if is the effect size, in terms of number of standard deviations, to be detected, the sample size would be Or, if is the effect size, in terms of number of standard deviations, to be detected, the sample size ( z z ) n 38 Ha: 70 = .05 1 = .90 = .10 with a level of significance of = .05. Find the sample size so that one can have a power of 1 = .90 to reject the null hypothesis if the actual mean is 5 unit different from 0. The standard deviation, , is approximately equal 15. 2 z/2 = z.025 = 1.96 z = z.1 = 1.28 (1.96 1.28) 15 n 94.48 95 5 2 The sample size needed is 95. 41 42 Hypothesis Testing - 7