STA 2023 E.Philias Part 4 Chapter 10: Hypothesis Testing (using a single sample) Hypothesis Testing is the statistical procedure designed to test a claim about a population parameter based on the statistical evidence contained in a representative sample of the population. Research hypothesis is a claim about a population parameter that can be tested using sample data. Statistical hypotheses are the null and alternative hypotheses. Null hypothesis ( π»0 ) is a claim (Or statement) about a population parameter that is assumed to be true until it declared false. It describes the opposite of the alternative hypothesis. The null hypothesis must contain the equality sign. Alternative hypothesis ( π»π ) describes the research hypothesis of the problem. It contains strict inequalities. Test Statistic is a formula that summarizes the statistical evidence collected against the null hypothesis (or in favor of the alternative/research hypothesis). Rejection region is the set of values of the test statistic indicating convincing evidence against Ho. Four Outcomes from Hypothesis Testing π»0 ππ π‘ππ’π π»0 is false Do not Reject π»0 Correct decision Type II error Reject π»0 Type I error Correct decision Type I error consists of rejecting the null hypothesis π»0 when π»0 is actually true. Type II error consists of failing to reject π»0 when π»0 is actually false. Alpha (πΌ) designates the probability of making a Type I error. STA 2023 E.Philias Beta (π½) designates the probability of type II error. p-value is a probability that measures the strength of our case against π»0 (that is, in favor of π»π ). The p-value of any statistical test describes the observed probability of type I error. Tails of a Test A two-tailed test has rejection regions in both tails, a left tailed test has the rejection region in the left tail, and a right-tailed test has the rejection region in the right tail of the distribution curve. Sign in the null Hypothesis π»0 Sign in the alternative Hypothesisπ»1 Rejection region Two-Tailed test = Left-Tailed Test = or ≥ Right-Tailed Test = or ≤ ≠ < > In both tails In the left tail In the right tail Steps to perform a test of Hypothesis A statistical test of hypothesis procedure has the following five steps. 1. State the null and alternative hypotheses. 2. Create the Decision rule by determining the rejection and nonrejection regions. 3. Calculate the value of the test statistic. 4. Make a decision. 5. State your conclusion STA 2023 E.Philias Testing Hypotheses Regarding the Population Mean (large sample) Step1: Determine the null and alternative hypotheses. The hypotheses can be structured in one of three ways: Two-Tailed Left-Tailed Right-Tailed π»0 : π = π0 π»0 : π = π0 π»0 : π = π0 π»1 : π ≠ π0 π»1 : π < π0 π»1 : π > π0 Note: π0 is the assumed or status quo value of the population mean. Step 2 : Create the Decision rule by determining the rejection region. The level of significance is used to determine the critical value. Step 3: Calculate the value of the test statistic z= z= Where ππ₯Μ = π √π and π π₯Μ = xΜ −π ππ₯Μ xΜ −π π π₯Μ if π is known if π is not known π √π The value of z is calculated for xΜ using the formula is also called the observed value of z. Step 4: Decision: Compare the critical value with the test statistic: Two-Tailed If z < -π§πΌ or z > π§πΌ⁄2 Left-Tailed If z < -π§πΌ reject Right-Tailed If z > π§πΌ , reject Reject the null hypothesis the null hypothesis the null hypothesis 2 Step 5: Conclusion 1) Reject π»0 in favor of π»π : The sample data provides sufficient evidence to support the research hypothesis. 2) Fail to reject π»0 : The sample data provides insufficient evidence to support the research hypothesis. STA 2023 E.Philias Rejection Regions for Common Values of πΆ Alternatives Hypothesis πΌ = .10 πΌ = .05 πΌ = .01 Lower-Tailed z< -1.28 z< -1.645 z< -2.33 Upper-Tailed z > 1.28 z > 1.645 z > 2.33 Two-Tailed z< -1.645 or z > 1.645 Z < -1.96 or z > 1.96 z< -2.575 or z > 2.575 Hypothesis Tests using the p-Value approach The p-value is the smallest significance level at which the null hypothesis is rejected. P-value is a probability that measures the strength of our case against Ho (that is, in favor of Ha). The p-value of any statistical test describes the observed probability of type I error. Step 1: Determine π»0 and π»π Step 2: Decide on a level of significance, depending on the seriousness of making a type 1 error . Μ x−π Step 3 : Compute the test statistics π§0 = π Μ π₯ Step 4: Determine the p-value. Two tails test : p-value = 2P( z > π§0 ) Right tail test : p-value = P( z > π§0 ) Left tail test : p-value = P( z < π§0 ) STA 2023 E.Philias Tests Concerning Means (Small Samples) Conditions under which the t distribution is used to make tests of hypothesis about π The t distributions is used to conduct a test of hypothesis about π if 1. The sample size is small ( n <30). 2. The population from which the sample is drawn is (approximately) normally distributed. 3. The population standard deviation π is unknown. Test Statistic The value of the test statistic t for the sample mean xΜ is computed as xΜ −π t= π Μ π₯ where π π₯Μ = π √π The value of t calculated for xΜ by using the above formula is also called the observed value of t. Hypothesis Test about a Population Proportion : Large samples The value of the test statistic z for the sample proportion, πΜ , is computed as Z= πΜ−π ππ Μ where ππΜ =√ πΜ(1−πΜ) π The value of p used in this formula is the one used in the null hypothesis. The value of z calculated for πΜ is also called the observed value of z. STA 2023 E.Philias Technology Step by Step Hypothesis Tests Regarding π (Large sample) Step 1: If necessary, enter raw data in πΏ1 . Step 2: Press STAT, highlight TESTS, and select 1 : Z-Test. Step 3: If the data are raw, highlight DATA; make sure that List1 is set toL1 and Freq is set to 1. If summary statistics are known, highlight STATS and enter the summary statistics. Following π, enter the population standard deviation. For the value of π0 , enter the value of the mean stated in the null hypothesis. Step 4: Select the direction of the alternative hypothesis. Step 5: Highlight Calculate and press ENTER. The TI-83/84 plus gives the P-value. Hypothesis Tests Regarding π (Small sample) Step 1: If necessary, enter raw data in πΏ1 . Step 2: Press STAT, highlight TESTS, and select 2: T-Test. Step 3: If the data are raw, highlight DATA; make sure that List1 is set toL1 and Freq is set to 1. If summary statistics are known, highlight STATS and enter the summary statistics. Following π, enter the population standard deviation. For the value of π0 , enter the value of the mean stated in the null hypothesis. Step 4: Select the direction of the alternative hypothesis. Step 5: Highlight Calculate and press ENTER. The TI-83/84 plus gives the P-value. STA 2023 E.Philias Hypothesis Tests regarding a Population Proportion Step 1: Press STAT, highlight TESTS, and select 5: 1-PropZTest. Step 2: For the value of π0 , enter the “status quo” value of the population proportion. Step 3: Enter the number of successes, x, and the sample size n. Step 4: Select the direction of the alternative hypothesis. Step 5: Highlight Calculate or Draw, and press ENTER. The TI-83/84 gives the P-value. STA 2023 E.Philias Comparing Two Population Means: Independent Sampling To perform inference on the difference of two population means, we must first determine whether the data come from independent or dependent sample. A sampling method is independent when the individual selected for one sample do not dictate which individuals are to be in a second sample. A sampling method is dependent when the individuals selected to be in one sample are used to determine the individuals to be in the second sample. DIFFERENCES BETWEEN MEANS (LARGE SAMPLE) Large-Sample Confidence Interval for (ππ - ππ ) (π₯ Μ Μ Μ 1 - Μ Μ Μ ) π₯2 ± π§πΌ⁄2 √ π12 π1 + π22 π2 Where π12 πππ π22 are the variances of the two populations being sampled, and π1 πππ π2 π2 π2 1 2 are the respective sample sizes. We also refer to √π1 + π2 as the standard error of the statistic (π₯ Μ Μ Μ 1 - Μ Μ Μ ). π₯2 STA 2023 E.Philias Large-Sample Test of Hypothesis for (ππ - ππ ): Independent Sampling Step 1: Determine the null and alternative hypotheses. The hypotheses are structured in one of three ways: Two-tailed Left-Tailed Right-Tailed π»0 : π1 = π2 π»0 : π1 = π2 π»0 : π1 = π2 π»π : π1 ≠ π2 π»π : π1 < π2 π»π : π1 > π2 Step 2: Select a level of significance πΌ, depending on the seriousness of making a type I error. Step 3: Compute the test statistic Z= (π₯ Μ Μ Μ 1Μ − Μ π₯Μ Μ 2Μ )− (π1 − π2 ) π2 π2 √ 1+ 2 π1 π2 ≈ (π₯ Μ Μ Μ 1Μ − Μ π₯Μ Μ 2Μ )− (π1 − π2 ) π 2 π 2 √ 1+ 2 π1 π2 , with(π1 − π2 ) =0 Step 4: Compare the critical value with the test statistic Step 5: Conclusion STA 2023 E.Philias Small-Sample Confidence Interval for (ππ − ππ ) (Independent Samples) (π₯ Μ Μ Μ 1 - Μ Μ Μ ) π₯2 ± π‘πΌ⁄2 √π π2 ( Where π π2 = (π1 −1)π 12 +(π2 −1)π 22 π1 +π2 −2 1 π1 + 1 π2 ), and π‘πΌ⁄2 is based on (π1 + π2 − 2) degrees of freedom. Here π π is the pooled sample standard deviation. Small-Sample Test of Hypothesis for (ππ − ππ ) (Independent Samples) Test statistic: t = (π₯ Μ Μ Μ 1Μ − Μ π₯Μ Μ 2Μ )−(π1 − π2 ) 1 1 √π π2 (π +π ) 1 2 , (π1 − π2 ) = 0 STA 2023 E.Philias Comparing Two Population Means: Dependent Samples Differences Between Means (Paired Data) Confidence Interval for Matched-Pairs Data (dependent Samples) A (1-πΌ)β100% confidence interval for ππ is given by Large Sample π πΜ β π§πΌ⁄2 β π ≈ πΜ β π§πΌ⁄2 β √π π π √π Small Sample πΜ β π‘πΌ⁄2 β π π √π The critical value π‘πΌ⁄2 is determined using n-1 degree of freedom. The value of πΜ and π π are the mean and standard deviation of the differenced data. Note: The interval is exact when the population is normally distributed and approximately correct for nonnormal populations, provided that n is large. Paired Difference Test of Hypothesis for ππ = (ππ − ππ ) =0 (Dependent Samples) Large sample πΜ πΜ √π π π √π Test statistic : z = ππ ≈ Small Sample: πΜ Test statistic: t = π π √π STA 2023 E.Philias Sampling Distribution of the Difference between two proportions (Large sample) Suppose a simple random sample of size π1 is taken from a population where π₯1 of the individual s have a specified characteristic, and a simple random sample of size π2 is independently taken from a different population where π₯2 of the individuals have a π₯ π₯ specified characteristic. The sampling distribution of π Μ1 - π Μ, Μ1 =π1 and π Μ2 =π2 ,is 2 where π 1 2 approximately normal. With mean ππΜ1 Μ2 − π =π1 − π2, and standard deviation ππΜ1 Μ2 − π =√ Μ Μ(1−π π 1 1) π1 + Μ Μ(1−π π 2 2) π2 Large-Sample A (1- πΆ)β100% confidence interval for (ππ − ππ ) Μ1 - π (π Μ) β π§πΌ⁄2 √ 2 Μ Μ(1−π π 1 1) π1 + Μ Μ(1−π π 2 2) π2 Large-sample Test of Hypothesis about (ππ − ππ ) The z-statistic Z = Μ1 − π Μ)−(π (π 2 1 −π2 ) 1 1 is used to test the null hypothesis that π»0 : (π1 − √πΜ (1 − πΜ)(π +π ) 1 2 π2 ) = 0 (or, equivalently π»0 : π1 = π2) the best estimate of π1 = π2 =p is πΜ = The best point estimate for p is called the pooled estimate of p, denoted by πΜ . π₯1 +π₯2 π1 +π2