Presentation is loading. Please wait.

Presentation is loading. Please wait.

7.11 Using Statistics To Make Inferences 7 Summary Single sample test of variance. Comparison of two variances. Monday, 22 June 20159:52 PM.

Similar presentations


Presentation on theme: "7.11 Using Statistics To Make Inferences 7 Summary Single sample test of variance. Comparison of two variances. Monday, 22 June 20159:52 PM."— Presentation transcript:

1 7.11 Using Statistics To Make Inferences 7 Summary Single sample test of variance. Comparison of two variances. Monday, 22 June 20159:52 PM

2 7.22 Goals To perform and interpret χ 2 and F tests. These tests are not available individually within SPSS, but embedded within more complex procedures. Practical Revert to the data from practical 5 and employ the Mann-Whitney test where you previously employed a t test. Perform a t test on reading ability data. Chi squared

3 7.33 Recall In lecture 4 we compared the mean of two samples using an appropriate t test. What assumption did we make about the variances of the two samples? It was assumed that the two sample variances were effectively equal. Fffffffffffffffffffff fffffff

4 7.44 Recall What notation do we employ for a population mean and for a sample mean? Population mean μ Sample mean Typically assessed with a t test CCCzCCCz

5 7.55 Recall What notation do we employ for a population variance and for a sample variance? Population variance σ 2 Sample variance s 2 Typically assessed with a χ 2 or F test Fffffffffffffffffffff Fffffff

6 7.66 Examination of the Variance Equality of means does not imply equality of variances. It is often important to control (minimise) the variance.

7 7.77 Examination of the Variance How do we compare a sample variance against the expected population value?

8 7.88 Single Sample Variance Test The null hypothesis is that a population standard deviation is equal to a particular value σ. Assuming that the data are normally distributed, a sample of size n is obtained from the population and a standard deviation, s, calculated. The test statistic is

9 7.99 Conclusion This statistic follows a Chi-squared distribution with ν = n - 1 degrees of freedom and significance level α,

10 7.1010 Example From past records students marks have a standard deviation of 10. A group of 20 students are taught by a new method, the standard deviation of their marks is 7.6. Is the group significantly more, or less variable? H 0 is that σ = 10 H 1 is that σ ≠ 10

11 7.1111 Conclusion n = 20 s = 7.6 σ = 10 ν = n – 1 = 19

12 7.1212 Use of Tables ν p=0.1p=0.05p=0.025p=0.01p=0.005p=0.002 1927.20430.14432.85236.19138.58241.610 ν p=0.9p=0.95p=0.975p=0.99p=0.995p=0.998 1911.65110.1178.9077.6336.8445.970 ν = 19 Here the 5% and 95% values are 30.14 and 10.12, the value is not significant at the 10% level (two tail test), the null hypothesis is accepted, there is no evidence that the new method affects the variability of the marks. For 5% (2.5% and 97.5%)the corresponding values are 32.85 and 8.91 and the conclusion is unchanged.

13 7.1313 Example The following data is obtained. 36.2 38.1 35.3 34.8 39.6 39.3 31.4 34.6 40.2 32.2 35.2 37.2 Past experiments suggest that the standard deviation is never more than 2. H 0 is that σ = 2 H 1 is that σ > 2 (a one sided test)

14 7.1414 Calculation You might find the following sums useful Σx = 434.1 and Σx 2 = 15790.71

15 7.1515 Calculation You might find the following sums useful Σx = 434.1 and Σx 2 = 15790.71 CCCCCCCcCCCCCCCc

16 7.1616 Calculation n = 12 s = 2.815 (direct calculation) σ = 2 ν = n – 1 = 11 ν p=0.1p=0.05p=0.025p=0.01p=0.005p=0.002 1117.27519.67521.92024.72526.75729.354 Since 19.68 < 21.79, the result is significant at the 5% level, this means you can be 95% confident of your result, the null hypothesis is rejected, and the variability is significantly higher.

17 7.1717 Confidence Interval A confidence interval for the variance, with confidence level 1-α is

18 7.1818 Confidence Interval For example, if n = 31 and s = 27.63, our degrees of freedom are n-1 = 30, so that if the confidence level is 95% (α = 0.05), we look up

19 7.1919 Confidence Interval For example, if n = 31 and s = 27.63, our degrees of freedom are n-1 = 30, so that if the confidence level is 95% (α = 0.05), we look up

20 7.2020 Confidence Interval Recall n = 31 and s = 27.63

21 7.2121 Confidence Interval So we can be 95% certain that σ lies in the interval [22.08, 36.93] (on taking the square root).

22 7.2222 Aside Consider Boys and Girls and the desire to predict gender based on some simple test. Assume that 50% of births are Boys so that Prob(Boy) = Prob(Girl) = ½. A simple, inexpensive, non-invasive gender testing procedure indicates that it is "perfect" for boys, Prob(Test Boy|Boy) = 1, implying Prob(Test Girl|Boy) = 0. Unfortunately, this simple gender testing procedure for girls is a "coin toss," Prob(Test Girl|Girl) = Prob(Test Boy|Girl) = ½. By evaluating Prob(Boy|Test Boy) and Prob(Girl|Test Girl) assess which is the most likely.

23 7.2323 Aside Consider Boys and Girls and the desire to predict gender based on some simple test. Assume that 50% of births are Boys so that Prob(Boy) = Prob(Girl) = ½. A simple, inexpensive, non-invasive gender testing procedure indicates that it is "perfect" for boys, Prob(Test Boy|Boy) = 1, implying Prob(Test Girl|Boy) = 0. Unfortunately, this simple gender testing procedure for girls is a "coin toss," Prob(Test Girl|Girl) = Prob(Test Boy|Girl) = ½. By evaluating Prob(Boy|Test Boy) and Prob(Girl|Test Girl) assess which is the most likely.

24 7.2424 Aside Consider Boys and Girls and the desire to predict gender based on some simple test. Assume that 50% of births are Boys so that Prob(Boy) = Prob(Girl) = ½. A simple, inexpensive, non-invasive gender testing procedure indicates that it is "perfect" for boys, Prob(Test Boy|Boy) = 1, implying Prob(Test Girl|Boy) = 0. Unfortunately, this simple gender testing procedure for girls is a "coin toss," Prob(Test Girl|Girl) = Prob(Test Boy|Girl) = ½. By evaluating Prob(Boy|Test Boy) and Prob(Girl|Test Girl) assess which is the most likely. What approach is appropriate (simplest)?

25 7.2525 Solution CCCCCCCCCCCCCCCCCCCCCCCCCC What is the grand total of the probabilities? C Cc

26 7.2626 Prob(girl|test says girl) CCCCCCCCCCCCCcCCCCCCCCCCCCCc Test says girl CCCCCCCCCCCCCCcCCCCCCCCCCCCCCc

27 7.2727 Prob(boy|test says boy) CCCCCCCCCCCCCCCCCCCCCCCCCC Test says boy

28 7.2828 Solution The tree diagram or application of Bayes theorem yields what seems to be a strange inversion, Prob(Boy|Test Boy) = ⅔ and Prob(Girl|Test Girl) = 1. That is, somehow, "perfection" switched from Boy to Girl. The test itself was perfect in "confirming" that a Boy was a Boy and has a 50% error rate in confirming that a Girl was a Girl. CCCCCCCCCCCcCCCCCCCCCCCc

29 7.2929 Alternate Approach What if we tested 100 boys and 100 girls? Complete the following table.

30 7.3030 Alternate Approach Test says boy Test says girl Boy100 Girl100 200 Complete the table Prob(Test Boy|Boy) = 1 Prob(Test Girl|Girl) = Prob(Test Boy|Girl) = ½.

31 7.3131 Alternate Approach Test says boy Test says girl Boy1000 Girl50 100 15050200 CCCCCCCCCCCCcCCCCCCCCCCCCc

32 7.3232 Prob(girl|test says girl) Test says boy Test says girl Boy1000 Girl50 100 15050200 Prob(Girl|Test says girl) = 50/50 =1 CCCCCCCCCCCCCcCCCCCCCCCCCCCc

33 7.3333 Prob(boy|test says boy) Test says boy Test says girl Boy1000 Girl50 100 15050200 Prob(boy|test says boy)=100/150= ⅔ CCCCCCCCCCCCCcCCCCCCCCCCCCCc

34 7.3434 Conclusion The previous result follows. Of course! More of this next week.

35 7.3535 Comparison of Two Sample Variances We know that a t test may be used to compare two sample means. We now compare two sample variances, assuming that the data are normally distributed.

36 7.3636 Two Sample Variance Test Note that the tables only give upper tail significance levels, so the larger sample variance must be placed in the numerator. From tables Significant if

37 7.3737 Two Sample Variance Test The tables only give upper tail significance levels. What if the lower tail is required? So, swap the degrees of freedom and reciprocate.

38 7.3838 Two Sample Variance Test To illustrate, swapping the degrees of freedom and reciprocating. ν1ν1 5 ν2ν2 4 α 0.025F crit 9.36 ν1ν1 4 ν2ν2 5 α 0.025F crit 7.39 ν1ν1 5 ν2ν2 4 α 0.975F crit 0.14(reciprocal7.39) Calculator

39 7.3939 Two Sample Variance Test

40 7.4040 Example Two samples are taken to check for equality of their variances. sample 1 - 16 observations with standard deviation 8.4 sample 2 - 20 observations with standard deviation 5.2.

41 7.4141 Hypothesis H 0 is that Note So n 1 = 16 n 2 = 20 And ν 1 = n 1 – 1 = 15 ν 2 = n 2 – 1 = 19 sample 1 - 16 observations with standard deviation 8.4 sample 2 - 20 observations with standard deviation 5.2

42 7.4242 Tables ν1ν2ν1ν2 111213141516171819204060100 192.342.312.282.262.232.22 2.182.172.162.031.981.94 ν1ν2ν1ν2 111213141516171819204060100 192.772.722.682.652.622.59 2.552.532.512.332.272.22

43 7.4343 Conclusion At 90% the upper cut off is 2.23 (2.23 < 2.61). The result is significant at the 10% level, this means you can be 90% confident of your result, reject H 0, the variances are probably inconsistent. But further work is probably required.

44 7.4444 Example In a clinical test the following scores were obtained for “normal” and “diseased” patients. Normal 10.3 11.8 12.6 8.6 9.2 10.1 10.2 7.4 Diseased 10.1 12.7 14.3 13.6 9.8 15.0 11.2 11.4 Is there a significant difference between the mean test scores for the two groups? A t test was performed previously, see lecture 4 example 1. This assumed “equality” of the variances!

45 7.4545 Previously H 0 is that μ 1 = μ 2 H 1 is that μ 1 ≠ μ 2 under a two tail test Because s 1 and s 2 are similar we assumed that σ 1 = σ 2 (chapter 4). Was this justified?

46 7.4646 Conclusion H 0 is that ν1ν2ν1ν2 12345678910 75.594.744.354.123.973.873.793.733.683.64 There would appear to be no significant difference and the original assumption was justified.

47 7.4747 Confidence Interval The confidence interval for the ratio of the two variances is Note the change in the degrees of freedom for the two choices of F. In fact one gives the upper tail and one the lower. It is not necessary that.

48 7.4848 Confidence Interval It is not necessary that. The two bounds are always and.

49 7.4949 α = 0.05 Confidence Interval For example if First value from table

50 7.5050 α = 0.05 Confidence Interval For example if Second value from table

51 7.5151 α = 0.05 Confidence Interval For example if Switching the roles of the groups gives bounds 4.342 and 300.356, the reciprocal of the values reported above.

52 7.5252 What if I have lost my statistical tables? Most tabulated statistical values may be obtained from Excel Excel Statistical Calculator

53 7.5353 Next Week Bring your calculators next week

54 7.5454 Read Read Howitt and Cramer 181-186 Read Davis and Smith pages 434-448

55 7.5555 Solution To The First Assignment The individual solutions to the first assignment should now be available on the module web page. Please access the “SPSS Verification” which employs the syntax window. You will find this particularly useful at Stage III.

56 7.5656 Practical 7 This material is available from the module web page. http://www.staff.ncl.ac.uk/mike.cox Module Web Page

57 7.5757 Practical 7 This material for the practical is available. Instructions for the practical Practical 7 Material for the practical Practical 7

58 7.5858 Whoops! Last week, a formatting error led to us inadvertently suggesting that there was a one in 1,019 chance of the world ending before this edition. That should have read, er, one in 10 19 rather less likely. Sorry. Feel free to remove the crash helmet. Independent 13/09/08

59 7.5959 Whoops! Yeah... that's not the quadratic formula.


Download ppt "7.11 Using Statistics To Make Inferences 7 Summary Single sample test of variance. Comparison of two variances. Monday, 22 June 20159:52 PM."

Similar presentations


Ads by Google