Hypothesis Testing for Differences in Two Dependent Samples
This content covers hypothesis testing for differences in two dependent samples, focusing on the paired t-test procedure. It includes examples, test rules, assumptions, and steps involved in conducting the test.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Hypothesis Testing 2 population means
Objectives Two population means testing Differences in 2 dependent samples Differences in 2 independent samples
Test rule for the difference of 2 dependent samples This procedure is used when the 2 samples are dependent It is known as the Paired t-test but we ll always use the 1-sample t-test in this course It reduces to the 1-sample t-test by taking the differences of the pairs Assumptions The population of the differences is normal
When are the populations dependent? These are often referred to as matched pairs Ways in which pairing can occur When subjects in one group are matched with a similar subject in the second group. When subjects serve as their own control by receiving both of two different treatments. When, in before and after studies, the same subjects are measured twice.
Hypothesis Testing - Steps 1. Decide which test to use & verify assumptions 2. State the null and the alternative hypotheses and nominate the level of significance 3. Obtain the test statistic and the p-value 4. Formulate and apply a decision rule 5. State the conclusion
Example 1 differences in 2 dependent samples In a small clinical trial to assess the value of a new tranquilizer on psychoneurotic patients, each patient was given a week s treatment with a drug and a week s treatment with a placebo, in random order. At the end of each week the patient had to complete a questionnaire, on the basis of which they were given an anxiety score with possible value from 0 to 30 high scores corresponding to high states of anxiety Test the hypothesis, at the 0.05 level, that the new drug reduces anxiety.
Example 1 differences in 2 dependent samples The anxiety scores recorded for 10 patients receiving a new drug and a placebo in random order Patient 1 2 3 4 5 6 7 8 9 10 Drug 19 11 14 17 23 11 15 19 11 8 Placebo 22 18 17 19 22 12 14 11 19 7
Example 1 differences in 2 dependent samples Boxplot of Drug, Placebo Drug Placebo 5 10 15 20 25 Anxiety Score
Example 1 Decide which test to use & verify assumptions Use the Which Test? decision tree We have 2 dependent samples which will be reduced to a single sample of the differences We are interested in the whether the new drug reduces anxiety. ie Anxiety level using drug is less than anxiety level using placebo drug < placebo drug placebo < 0 mean of differences < 0 Get Minitab to calculate the Differences We would choose a one-sample test Is the data normally distributed use Minitab to check The population standard deviation is unknown so we must use the 1-sample t test
Example 1 Decide which test to use & verify assumptions Normality check As the p-value from the normal plot is 0.411 which is greater than 0.05 we can assume that the data is taken from a normally distributed population. Normal Probability Plot of Differences 99 Mean StDev N AD P-Value 0.411 -1.3 4.547 95 10 90 0.343 80 70 60 Percent 50 40 30 20 10 5 1 -15 -10 -5 0 5 10
Example 1 State the null and the alternative hypotheses and nominate the level of significance Now we can state the hypothesis H0: differences= 0 H1: differences< 0 = 0.05
Example 1 Obtain the test statistic & the p-value Paired T-Test and CI: Drug, Placebo Paired T for Drug - Placebo N Mean StDev SE Mean Drug 10 14.80 4.69 1.48 Placebo 10 16.10 4.95 1.57 Difference 10 -1.30 4.55 1.44 95% upper bound for mean difference: 1.34 T-Test of mean difference = 0 (vs < 0): T-Value = -0.90 P-Value = 0.195 One-Sample T: Differences Identical output Test of mu = 0 vs < 0 95% Upper Variable N Mean StDev SE Mean Bound T P Differences 10 -1.30 4.55 1.44 1.34 -0.90 0.195
Example 1 mean of differences in 2 dependent samples Formulate & apply decision rule Since = 0.05 we do not reject H0 if p-value > 0.05 (no rejection region) we reject H0 if p-value < 0.05 (rejection region) p = 0.195 > 0.05 Therefore, we fail to reject the null hypothesis Conclusion At the 0.05 level, there is not sufficient evidence that the new drug reduces anxiety, on average.
General steps mean of differences in 2 dependent samples Decide which test to use: 1-sample t-test of differences Identify how the differences will be calculated Verify assumptions The two populations are dependent The population of Differences is normal Set up the hypotheses and significance level H0: differences = 0 H1: differences 0 or > 0 or < 0 = ? 1-sample t-test in Minitab to obtain p-value Formulate & apply the decision rule State the conclusion
Test Rule for the Difference of Two Independent Means This procedure is used when the 2 samples are independent It is called 2-sample t-test Assumptions Two populations are independent Two populations are normally distributed
When are the populations independent? A 2-sample problem can arise from a randomized comparative experiment that randomly divides the subjects into 2 groups and exposes each group to different treatment There is no matching of the units in the 2 samples The 2 samples may be of different sizes Each group is considered to be a sample from a distinct population The responses in each group are independent of those in the other group
Example 2 differences in 2 independent means Researchers studied the effect of adding a houseplant fertiliser to radish sprouts. They randomly selected some seeds to act as controls and some were placed in planters to which the fertiliser was added. Other conditions were held constant between the two groups. The heights in cm for plants in the two groups two weeks after germination were given. We want to test the hypothesis that the fertiliser has an effect on the average growth of the sprouts. That is Is the mean height of the fertilised radish sprouts different from the mean height of the unfertilised (control) radish plants
Example 2 differences in 2 independent means Boxplot of Control, Fertilised Control Fertilised 1.0 1.5 2.0 2.5 Height (cm) 3.0 3.5 4.0 4.5
Example 2 verify assumption of normality Probability Plot of Control, Fertilised Normal Control 0 1 2 3 4 Mean StDev N AD P-Value 2.582 0.6544 Control Fertilised 99 99 28 95 95 0.428 0.290 90 90 80 80 70 60 50 40 30 70 60 50 40 30 Percent Fertilised Mean StDev N AD P-Value 2.039 0.7208 20 20 28 10 10 0.483 0.211 5 5 1 1 1 2 3 4
Example 2 Decide which test to use & verify assumptions 2-sample t test Assumptions Independent yes they were randomly assigned Check for normality From the normality plot control p-value = 0.290 > 0.05 fertilised p-value = 0.211 > 0.05 Both can be assumed to be taken from normal populations
Example 2 State the hypotheses & nominate the level of significance The Hypotheses: : H = control 0 fertilised control H : 1 fertilised We can also translate these into = control H : 0 0 fertilised control H : 0 1 fertilised Let = 0.05
Example 2 Obtain the test statistic & the p-value Two-Sample T-Test and CI: Control, Fertilised Two-sample T for Control vs Fertilised Order in which samples are entered is important in 1-sided tests N Mean StDev SE Mean Control 28 2.582 0.654 0.12 Fertilised 28 2.039 0.721 0.14 Difference = mu (Control) - mu (Fertilised) Estimate for difference: 0.543 95% CI for difference: (0.174, 0.912) T-Test of difference = 0 (vs not =): T-Value = 2.95 P-Value = 0.005 DF = 53
Example 2 differences in 2 independent means Formulate & apply decision rule Since = 0.05 we do not reject H0 if p-value > 0.05 (no rejection region) we reject H0 if p-value < 0.05 (rejection region) p = 0.005 < 0.05 Therefore, we reject the null hypothesis Conclusion At the 0.05 level, there is sufficient evidence that the mean height of the fertilised radish sprouts is different from the mean height of the unfertilised (control) radish plants
Example 2 differences in 2 independent means What if, instead, we want to test the hypothesis that the fertiliser improves the average growth of the radish sprouts. That is Is the mean height of the fertilised radish sprouts greater than the mean height of the unfertilised (control) radish plants
Example 2 State the hypotheses & nominate the level of significance The Hypotheses: : H = control 0 fertilised control H : 1 fertilised We can also translate these into = control H : 0 0 fertilised control H : 0 1 fertilised Let = 0.05
Example 2 Obtain the test statistic & the p-value Two-Sample T-Test and CI: Fertilised, Control Two-sample T for Fertilised vs Control Order in which samples are entered is important in 1-sided tests N Mean StDev SE Mean Fertilised 28 2.039 0.721 0.14 Control 28 2.582 0.654 0.12 Difference = mu (Fertilised) - mu (Control) Estimate for difference: -0.543 95% lower bound for difference: -0.851 T-Test of difference = 0 (vs >): T-Value = -2.95 P-Value = 0.998 DF = 53
Example 2 differences in 2 independent means Formulate & apply decision rule Since = 0.05 we do not reject H0 if p-value > 0.05 (no rejection region) we reject H0 if p-value < 0.05 (rejection region) p = 0.998 > 0.05 Therefore, we do not reject the null hypothesis Conclusion At the 0.05 level, there is not sufficient evidence that the mean height of the fertilised radish sprouts is greater than the mean height of the unfertilised (control) radish plants
General steps - differences in 2 independent means Decide which test to use: 2-sample t test Assumptions verify! The two populations are independent The two populations are normal Set up the hypotheses and significance level H0: 1 = 2 or 1 - 2 = 0 H1: 1 2 or 1 - 2 0 or < 0 or > 0 = 0.05 Use 2-sample t-test in Minitab to obtain p-value Formulate & apply the decision rule State the conclusion
Example 3 40 persons from the Honolulu Heart Study (in mmHg) Non-smokers 138 128 112 128 134 104 152 134 132 130 118 108 108 128 134 162 98 144 118 118 Smokers 102 190 122 116 116 136 118 134 178 162 120 138 126 176 104 140 102 142 146 112 We want to know if there is any difference in the mean systolic blood pressure between smokers & non-smokers
Example 3 Non-smokers Smokers 100 110 120 130 Systolic blood pressure (mmHg) 140 150 160 170 180 190
Example 3 Normal Probability Plots 100 150 200 Non-smokers Smokers Non-smokers 99 99 Mean StDev N AD P-Value 0.639 126.4 16.22 20 95 95 0.270 90 90 Smokers 80 80 Mean StDev N AD P-Value 0.126 134 25.78 70 60 50 40 30 70 60 50 40 30 Percent 20 0.562 20 20 10 10 5 5 1 1 100 120 140 160
Example 3 Two-Sample T-Test and CI: Non-smokers, Smokers Two-sample T for Non-smokers vs Smokers N Mean StDev SE Mean Non-smokers 20 126.4 16.2 3.6 Smokers 20 134.0 25.8 5.8 Difference = mu (Non-smokers) - mu (Smokers) Estimate for difference: -7.60 95% CI for difference: (-21.47, 6.27) T-Test of difference = 0 (vs not =): T-Value = -1.12 P-Value = 0.273 DF = 32
Lecture exercise 1 A study was conducted to investigate the effectiveness of hypnotism in reducing pain. Results for randomly selected subjects are given in the table. The values are before and after hypnosis; the measurements are in centimetres on a pain scale. Use a 0.05 significance level to test the claim that the sensory measurements are lower after hypnotism. Subject A B C D E F G H Before 6.6 6.5 9.0 10.3 11.3 8.1 6.3 11.6 After 6.8 2.4 7.4 8.5 8.1 6.1 3.4 2.0
Lecture exercise 1 Before After 2 4 6 8 10 12 Pain Scale
Lecture exercise 1 Normal Probability Plot 99 Mean StDev N AD P-Value 0.054 3.125 2.911 8 95 0.655 90 80 70 60 50 40 Percent 30 20 10 5 1 -5.0 -2.5 0.0 2.5 5.0 7.5 10.0 Differences
Lecture exercise 1 One-Sample T: Differences Test of mu = 0 vs > 0 95% Lower Variable N Mean StDev SE Mean Bound T P Differences 8 3.13 2.91 1.03 1.17 3.04 0.009
Lecture exercise 2 The numbers of calories contained in -cup servings of randomly selected flavours of ice-cream from two national brands are listed here. At the 0.05 level of significance, is there sufficient evidence to conclude that the variance in the number of calories differs between the two brands?
Lecture exercise 2 The numbers of calories contained in -cup servings of randomly selected flavours of ice- cream from two national brands are listed here. At the 0.05 level of significance, is there sufficient evidence to conclude that the variance in the number of calories differs between the two brands? Brand A 330 Brand B 280 310 300 270 250 310 290 300 310 350 370 380 300 300 310
Lecture exercise 2 Brand A Brand B 250 275 300 325 350 375 Calories
Lecture exercise 2 Normal Probability Plots 200 250 300 350 400 Brand A Brand B Brand A 99 99 Mean StDev N AD P-Value 0.503 318.8 33.99 8 95 95 0.300 90 90 Brand B 80 80 Mean StDev N AD P-Value 0.183 301.3 33.99 70 60 50 40 30 70 60 50 40 30 Percent 8 0.463 20 20 10 10 5 5 1 1 250 300 350 400
Lecture exercise 3 Hours Sun-Thur Hours Fri-Sat Students in a statistics class were asked to report the number of hours they slept on weeknights and on weekends. At = 0.10, is there sufficient evidence that here is a difference in the mean number of hours slept? Student 1 8.0 4.0 2 5.5 7.0 3 7.5 10.5 4 8.0 12.0 5 7.0 11.0 6 6.0 9.0 7 6.0 6.0 8 8.0 9.0
Lecture exercise 3 Sun-Thurs Fri-Sat 3 4 5 6 7 8 9 10 11 12 Hours
Lecture exercise 4 A small pilot study has been developed to test the effect of a new drug on restenosis (closing of the arteries) after angioplasty. Sixteen subjects were randomly assigned into two groups of eight. One group was assigned to treatment with the new drug and the other group was given a placebo. The measurement made is the degree of stenosis at six months after angioplasty, measured as a % of the diameter of the vessel. The following is the data collected from the trial. New drug group 44 50 63 35 45 29 54 52 Placebo group 76 55 37 65 59 30 45 42