Introduction to Hypothesis Testing Exercises and solutions Dr
- Slides: 20
Introduction to Hypothesis Testing: Exercises and solutions Dr Jenny Freeman Mathematics & Statistics Help University of Sheffield
Exercise 1: Normal probabilities X = Birthweight; Mean = 3. 4 kg, SD = 0. 57 kg What’s the probability of a baby weighing: a) More than 4. 5 kg b) More than 2. 3 kg
Exercise 1: Normal probabilities X = Birthweight; Mean = 3. 4 kg, SD = 0. 57 kg What’s the probability of a baby weighing: a) Less than or equal to 2. 3 kg b) Between 2. 3 kg & 4. 5 kg
Exercise 2 • 95% of journey times are between and minutes
Exercise 3: calculating Z scores •
Exercise 4: Hypotheses What would the null and alternative hypotheses be for these research questions? 1. Did class affect survival on board the Titanic? 2. Do students who attend MASH workshops do better in their statistics module than those who do not?
Exercise 5: Statistical significance • The significance level is usually set at 5%, this is conventional rather than fixed – for stronger proof could use a level of 1% (0. 01) • The smaller the p-value, the more confident we are with our decision to reject p-value Decision ≥ 0. 05 Do not reject 0. 01 - 0. 05 Evidence to reject 0. 001 - 0. 01 Strong evidence to reject < 0. 001 Overwhelming evidence to reject • The p-value for the test of a difference in module marks between students who do and do not attend a MASH workshop was 0. 02. What would you conclude and how confident are you with your decision?
Exercise 6: The magic 0. 05 • What’s the probability of getting a head? • What’s the probability of getting 2 heads in a row? • If we toss the coin 4 times, what is the probability of getting 4 heads?
Exercise 7: Testing your own die You all have fair die – or do you? ? ? Outcome i Observed Oi 1 2 3 4 5 6 Total Difference Oi – Ei Expected Ei (Oi -Ei)2 5 5 5 (Oi -Ei)2 Ei
Exercise 7: Testing your own die • Null: • Alternative: • Test Statistic: • P-value • Conclusion:
Exercise 1: Solution X = Birthweight; Mean = 3. 4 kg, SD = 0. 57 kg What’s the probability of a baby weighing: a) More than 4. 5 kg P(X > 4. 5)=0. 0268 b) More than 2. 3 kg P(X > 2. 3)=0. 9732
Exercise 1: Solution X = Birthweight; Mean = 3. 4 kg, SD = 0. 57 kg What’s the probability of a baby weighing: a) Less than or equal to 2. 3 kg P(X ≤ 2. 3) = 1 - P(X > 2. 3) = 1 - 0. 9732 = 0. 0268 b) Between 2. 3 kg & 4. 5 kg P(2. 3 < X < 4. 5) = P(X > 2. 3)-P(X > 4. 5) = 0. 9732 - 0. 0. 0268 = 0. 9464
Exercise 2: Solution • 95% of my journeys are between 24 and 42 minutes
Exercise 3: Solution •
Exercise 4: Solution 1. Did class affect survival on board the Titanic? Null: There is no relationship between class and survival Alternative: There is a relationship between class and survival 2. Do students who attend MASH workshops do better in their statistics module than those who do not? Null: The mean module mark for students who attend MASH workshops is the same as for students who do not attend MASH workshops Alternative: The mean module mark for students who attend MASH workshops is the higher than for students who do not attend MASH workshop
Exercise 5: Solution • The significance level is usually set at 5%, this is conventional rather than fixed – for stronger proof could use a level of 1% (0. 01) • The smaller the p-value, the more confident we are with our decision to reject p-value Decision ≥ 0. 05 Do not reject 0. 01 - 0. 05 Evidence to reject 0. 001 - 0. 01 Strong evidence to reject < 0. 001 Overwhelming evidence to reject • The p-value for the test of a difference in module marks between students who do and do not attend a MASH workshop was 0. 02. We would conclude that there is evidence to reject the null hypothesis and accept the alternative that students who attend a MASH workshop do better in their stats module than students who do not attend a workshop
Exercise 6: Solution •
Using tables for probabilities • Probabilities tabulated for distribution with mean = 3. 4, SD = 0. 57
Table: Normal curve tail probabilities (one tailed). Standard normal probability in right-hand tail
Chi squared distribution (χ2, df=5) Test Statistic 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 0 1. 0000 0. 9626 0. 8491 0. 7000 0. 5494 0. 4159 0. 3062 0. 2206 0. 1562 0. 1091 0. 0752 0. 0514 0. 0348 0. 0234 0. 0156 0. 0104 0. 0068 0. 0045 0. 0029 0. 0012 0. 1 0. 9998 0. 9541 0. 8351 0. 6846 0. 5351 0. 4038 0. 2966 0. 2133 0. 1508 0. 1051 0. 0725 0. 0494 0. 0334 0. 0225 0. 0150 0. 0099 0. 0066 0. 0043 0. 0028 0. 0012 0. 9991 0. 9449 0. 8208 0. 6692 0. 5210 0. 3920 0. 2872 0. 2062 0. 1456 0. 1013 0. 0698 0. 0476 0. 0321 0. 0216 0. 0144 0. 0095 0. 0063 0. 0041 0. 0027 0. 0018 0. 0011 0. 3 0. 9976 0. 9349 0. 8063 0. 6538 0. 5071 0. 3804 0. 2781 0. 1993 0. 1405 0. 0977 0. 0672 0. 0457 0. 0309 0. 0207 0. 0138 0. 0092 0. 0060 0. 0040 0. 0026 0. 0017 0. 0011 0. 4 0. 9953 0. 9243 0. 7915 0. 6386 0. 4934 0. 3690 0. 2692 0. 1926 0. 1355 0. 0941 0. 0647 0. 0440 0. 0297 0. 0199 0. 0133 0. 0088 0. 0058 0. 0038 0. 0025 0. 0016 0. 0011 0. 5 0. 9921 0. 9131 0. 7765 0. 6234 0. 4799 0. 3579 0. 2606 0. 1860 0. 1307 0. 0907 0. 0622 0. 0423 0. 0285 0. 0191 0. 0127 0. 0084 0. 0056 0. 0036 0. 0024 0. 0016 0. 0010 0. 6 0. 9880 0. 9012 0. 7614 0. 6083 0. 4666 0. 3471 0. 2521 0. 1797 0. 1261 0. 0874 0. 0599 0. 0407 0. 0274 0. 0184 0. 0122 0. 0081 0. 0053 0. 0035 0. 0023 0. 0015 0. 0010 0. 7 0. 9830 0. 8889 0. 7461 0. 5934 0. 4536 0. 3365 0. 2439 0. 1736 0. 1216 0. 0842 0. 0577 0. 0391 0. 0264 0. 0176 0. 0117 0. 0078 0. 0051 0. 0033 0. 0022 0. 0014 0. 0009 0. 8 0. 9770 0. 8761 0. 7308 0. 5786 0. 4408 0. 3262 0. 2359 0. 1676 0. 1173 0. 0811 0. 0555 0. 0376 0. 0253 0. 0169 0. 0113 0. 0074 0. 0049 0. 0032 0. 0021 0. 0014 0. 0009 0. 9702 0. 8628 0. 7154 0. 5639 0. 4282 0. 3161 0. 2282 0. 1618 0. 1131 0. 0781 0. 0534 0. 0362 0. 0243 0. 0163 0. 0108 0. 0071 0. 0047 0. 0031 0. 0020 0. 0013 0. 0008
- Hypothesis testing
- Introduction to software testing exercises solutions
- Finding test statistic
- Hypotheses testing
- Null hypothesis example
- Hypothesis testing mean
- Null hypothesis and alternative hypothesis examples
- Nebular hypothesis and protoplanet hypothesis venn diagram
- Null hypothesis vs alternative hypothesis
- Database design exercises and solutions
- Mean of probability distribution formula
- Database exercises and solutions
- Database design exercises and solutions
- Positive and negative testing
- Cs3250
- The language of hypothesis testing
- Inference hypothesis testing
- One way anova test
- Hypothesis testing assignment
- Critical value hypothesis testing
- Null hypothesis assumptions