Statistics Parametric and Z square tests due in 48 hours

profileaifarooq786
fwdnonparametrictests.zip

2013_BSTAT_Topic_6_Non-Parametric-Tests.doc

Business Statistics Topic 6 Non-Parametric Tests

Business Statistics

6. Non-Parametric Tests

6.1 Introduction

So far we have covered parametric tests. Parametric tests assume a certain distribution and the test relates to a parameter (e.g. the mean) of the distribution. The null hypothesis states a value for a single mean or proportion or specifies equality of two or more means or proportions.

Non-parametric tests do not make specific assumptions about the *distribution of the variable ( Distribution-free tests.

Some tests can be used for nominal or ordinal data.

Same stages:

1. Hypotheses

2. Test Statistic

3. Comparison

4. Conclusion

*However when comparing two or more populations there is an implicit assumption that the distribution of the variables are the same shape or approximately the same.

Hypotheses about populations do not generally refer to the mean, but are less specific, for example the null hypothesis might say “the levels of achievement are the same” or “the populations are identical”.

If we reject a null hypothesis that “the populations are identical” this could mean they have different shapes altogether or different means or variances.

Of course if we knew that the distributions were the same shape then by rejecting the null hypothesis we would imply that the means were different.

Many of the non-parametric tests use ranks in place of the original data, so 20 numbers with an irregular distribution are replaced with the numbers 1…20.

Two populations with very different distributions could appear similar because the ranks balance out, then we would NOT reject the null although the populations were Not the same.

This will become more apparent as we look at specific tests.

6.2 Runs Test for Randomness

The data set for a runs test consists of a sequence of items each of which is one out of two types.

e.g.: Some are males (M) and some are females (F)

Some are heads (H) and some are tails (T)

If the items are scattered randomly there should be neither too many nor too few runs of one item.

e.g.: MMMMMFFFFF (___ runs)

HHTTTTTTTT (___ runs)

MFMFMFMFMF (___ runs)

Do not look random.

The test statistic is based on the numbers, n1 and n2 of items of each category and R, the number of runs.

Example 1

Consider stock exchange data for certain days over a period of 20 days:

Day:

2

3

5

6

7

8

10

12

13

14

16

17

18

19

20

Change:

+

+

-

+

+

-

-

-

-

-

+

-

-

-

+

+ indicates index up; - indicates index down compared to previous day.

H0 : Ups & Downs are random

H1 : Ups & Downs are NOT random

Number of + is n1 = __

Number of – is n2 = __

Number of runs is R = __

Example 2

If n1 and n2 are both ≤ 20 the Runs Test Table should be used. However the table given (Swed and Eisenhart, 1943)* shows critical values of R only for α=0.05. For larger values of n1 and n2, R follows an approximate Normal Distribution so the formula can be used to obtain a z value. In the following try both the table and the formula and compare the result:

Consider a group of students:

M F F F M F M M M M F F M F F F M M M

H0 : male and female students are in random order

H1 : male & female students are not in random order

Number of males is n1 = ___

Number of females is n2 = ___

Number of runs is R = ___

Critical values (from table):

Therefore: _______________ H0 at 5% level.

Compare with test using the formula:

image1.wmf

(

)

(

)

(

)

1

2

2

1

2

2

1

2

2

1

2

1

2

1

2

1

2

1

2

1

-

+

+

-

-

÷

÷

ø

ö

ç

ç

è

æ

+

+

-

=

n

n

n

n

n

n

n

n

n

n

n

n

n

n

R

z

Calculate n1 + n2 and n1n2 first as these occur several times in the formula.

This will be a two-tailed test as either too many runs or too few runs are evidence to reject randomness.

*Reference

Swed,F.S and Eisenhart, C. (1943). Tables for testing randomness of grouping in a sequence of alternatives. Annals of Mathematical Statistics, 14, 83-86.

6.3 The Mann-Whitney U Test

This is the Non-parametric counterpart of the unpaired t-test, for experiments with two independent random samples.

These are ranked as a single sequence and a test for equality is carried out by comparing the sums, T, of the ranks from the two samples.

Example 3

Two branches of a well known supermarket chain collected data on the number of cheques returned covering 12 randomly selected months for branch A and 15 randomly selected months for branch B. From the data does branch A have a greater number of returned cheques?

Branch A

Branch B

42

22

65

17

38

35

55

19

71

8

60

24

47

42

59

14

68

28

57

17

76

10

42

15

20

45

50

H0: Both Branches have the same number of returned cheques (or B has more).

H1: Branch A has a higher number of returned cheques than Branch B.

One-tailed test

Use 5% level of significance.

Rank into single sequence (lowest=1 etc.):

Branch A

Branch B

Returned cheques

Rank

Returned cheques

Rank

42

22

65

17

38

35

55

19

71

8

60

24

47

42

59

14

68

28

57

17

76

10

42

15

20

45

50

Rank Totals:

Where numbers have the same value the rank is averaged, for example 17 occurs twice sharing 5th and 6th place. They are each given rank 5.5.

n1 = ______, sum of A ranks is T1 = ________

n2 = ______, sum of B ranks is T2 = ________

image2.wmf

(

)

1

1

1

2

1

1

2

1

T

n

n

n

n

U

-

+

+

=

=

image3.wmf

(

)

2

2

2

2

1

2

2

1

T

n

n

n

n

U

-

+

+

=

=

Compare smaller of the U values (U__ = ___) with value in the table (___)

As ___ ___ ____ _____________ H0.

SPSS:

You will need the numbers of Returned cheques in one column and Branch in another column. However Branch needs to be converted to a numeric variable.

This can be done by creating a new variable BranchNum with values 1 for A and 2 for B, etc. This can be done by T ransform- A utomatic Recode or by typing in the values directly.

Use A nalyse- N onparametric Tests – L egacy Dialogs – 2 Independent samples. Check that Mann-Whitney U is checked (this is the default).

Move Returned Cheques to the Test variable list and make Branch the Grouping variable.

Excel:

There is no in-built routine. Ranks can be calculated using the RANK.AVG function, for example:

=RANK.AVG(A3,$A$2:$B$16,1)

Here A3 is the number to be ranked, $A$2:$B$16 is the table of data and 1 indicates rank from the lowest.

6.4 The Wilcoxon Signed Rank Test

This is the non-parametric counterpart of the paired t-test.

Example 4

16 students were asked to rate two learning packages and to give marks out of 30. Is there a difference between the two packages?

 

Student

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

Marks

Package A

20

24

28

24

20

29

19

27

20

30

18

28

26

24

25

21

Package B

16

26

18

17

20

21

23

22

23

20

18

21

17

26

25

24

H0: The two populations are identical

H1: The two populations are NOT identical

Rank absolute values of differences i.e. ignore sign (lowest=1) but write the rank in the Positive Rank column if the Difference is >0 and in the Negative Rank column of the Difference is <0. Differences of zero are ignored.

Student

Package A

Package B

Difference in marks

Positive Rank

Negative Rank

1

20

16

2

24

26

3

28

18

4

24

17

5

20

20

6

29

21

7

19

23

8

27

22

9

20

23

10

30

20

11

18

18

12

28

21

13

26

17

14

24

26

15

25

25

16

21

24

Totals

Compare the smaller (_____) with the table for n = ____ and a 2-sided 5% level test (____)_________, therefore ___________ H0

SPSS: Use A nalyse- N onparametric Tests – L egacy Dialogs – 2 Re l ated Samples. The marks for A and B should be in two separate columns.

6.5 The Kruskal-Wallis Test

One-way analysis of variance can be used to test the null hypothesis that several population means are equal. This rests on the assumptions that the sampled populations are normally distributed with equal variances. If either assumption is false use the Kruskal-Wallis test.

Requires assumption that samples are independent and uses ranks rather than data values.

Test statistic is:

image4.wmf

(

)

(

)

å

+

-

+

=

1

3

1

12

2

n

n

R

n

n

H

j

j

where nj is the number of items in sample j

n is the total number of items

Rj is the sum of ranks in sample j

Use percentage points on chi-squared distribution for k – 1 degrees of freedom, where k is the number of samples.

Example 5

A farmer wants to know if 3 different types of fertilizer have different affects on yield. The 3 types of fertilizer were each used on 4 one-acre plots of land. Each of the 12 plots were as similar as possible.

Fertilizer 1

Fertilizer 2

Fertilizer 3

Yield

Rank

Yield

Rank

Yield

Rank

45

42

53

40

44

56

41

43

54

46

47

55

Rank Totals:

H0: The three populations are identical

H1: The three populations are NOT identical

n1 = 4 n2 = 4 n3 = 4

R1 = ____ R2 = ____ R3 = __

image5.wmf

=

=

=

H

degrees of freedom, ν = k – 1 = 3 – 1 = 2

5%; critical value = _______

_______________ so ________ H0

SPSS: You will need the numbers for Yield in one column and Fertilizer in another column. However Fertilizer needs to be converted to a numeric variable.

This can be done by creating a new variable BranchNum with values 1 for A and 2 for B, etc. This can be done by T ransform- A utomatic Recode or by typing in the values directly.

Use A nalyse- N onparametric Tests – L egacy Dialogs – K Independent Samples.

Exercises

1. A car company has developed four prototypes for its new family hatchback car. Five test drivers drove each car and their performance was marked by the same independent observer. Using Kruskal-Wallis, test at the 5% significance level the null hypothesis that there is no difference in the performance of the four proto type hatchback cars.

Car A

Car B

Car C

Car D

78

62

80

85

75

63

77

80

80

72

88

88

72

68

80

82

76

64

83

87

2. 19 candidates for the Chemistry degree at a well known university were assessed by one of the two admission tutors, Dr Atom and Dr Bunsen. The marks are shown in the table below:

Marks (%)

Dr Atom

60

75

80

65

70

80

80

85

85

65

Dr Bunsen

60

55

60

65

75

80

80

75

70

Carry out a Mann-Whitney U test at the 5% significance level to determine if there is any evidence that the tutors have a different standard.

3. A market survey was carried out on 36 shoppers who had a carton of milk in their trolley. F denotes that the carton contained full fat milk and S denotes that the carton contained either skimmed or semi-skimmed milk. The observations are shown below. Is the sequence random? (Use 5% significance level).

FSSSFSFFS SSFSFFFSS SFSSFFFFS SSFSFFSSS

Use both the formula and the table. Compare the results.

4. The skill scores for a random sample of 10 workers for a specific task undertaken in September 2005 were as follows:

58 38 83 61 69 68 70 62 39 72

After attending a training course in October 2005 the workers were reassessed. Their scores (given in the same order as above were):

46 53 85 79 75 67 66 69 46 81

Does this suggest that the training course has been beneficial?

5. A market researcher undertook a survey into the shopping habits of visitors to a large out-of-town shopping centre. She was asked to randomly select 44 shoppers. Her manager questioned the randomness of the selection process. The following sequence was obtained (M = male, F = female), listed in the order they were selected for the sample.

MMFFFFFMFFMMMMMMFFFFMMFMMFFMFFFFFMMMMMFFMFMM

What do you conclude concerning the randomness of the selection process?

6. Two machines are used to put breakfast cereal into packets which are intended to contain 750 grams. Samples of 10 packets from each machine were found to contain the following quantities in grams:

Machine 1:

748.7

751.3

752.1

747.8

753.2

749.2

748.1

754.5

752.3

750.1

Machine 2:

748.3

747.2

746.7

746.3

746.1

747.5

751.5

749.2

750.4

751.1

It is required to test whether the two machines are filling packets to the same mean weight.

(i) Carry out an unpaired pooled variance t-test at the 5% level of significance of the null hypothesis that the two machines are filling packets to the same mean weight.

(ii) Use a one-way Analysis of Variance test at the 5% level of significance to test the null hypothesis that the two machines are filling packets to the same mean weight, and highlight the points of relationship with the unpaired t-test as described in your answer to part (i) above.

(iii) Carry out the Mann-Whitney test at the 5% level of significance of the null hypothesis that the two machines are filling packets to the same weight.

(iii) Carry out the Kruskal-Wallis test at the 5% level of significance of the null hypothesis that the two machines are filling packets to the same weight, and compare your conclusion to the conclusions drawn in your answers to parts (i), (ii) and (iii).

7. A company has to choose between two possible training schemes for machine operatives. To help in making this choice it is decided to randomly allocate one year’s intake of operatives between the two schemes. Following their training the performances of the recruits have now been measured, using a standard text which produces scores that can be assumed to be normally distributed.

The scores obtained were as follows:

Scheme 1

77

73

82

96

68

84

78

81

90

Scheme 2

73

77

81

76

73

69

83

84

Carry out a Mann Whitney hypothesis test at the 5% level of significance to determine whether trainees using scheme 1 achieve a higher test score than trainees using scheme 2.

8. Below is data from the US National Highway Traffic Safety Administration. Use the Wilcoxon signed rank test to compare the chest injury rating for the drivers and passengers.

Chest injury rating

Car

Driver

Passenger

1

42

35

2

42

35

3

34

45

4

34

45

5

45

45

6

40

42

7

42

46

8

43

58

9

45

43

10

36

37

11

36

37

12

43

58

13

40

42

14

43

58

15

37

41

16

37

41

17

44

57

18

42

42

9. The following data was obtained from the Journal of Genetic Psychology.

It shows the attitude of 13 male students towards their parents.

1 = Awful, 2 = Poor, 3 = Average, 4 = Good, 5 = Great.

The researchers want to compare their attitude towards their fathers and mothers. State the hypotheses and perform an appropriate test.

Student

1

2

3

4

5

6

7

8

9

10

11

12

13

Attitude

Father

2

5

4

4

3

5

4

2

4

5

4

5

3

towards

Mother

3

5

3

5

4

4

5

4

5

4

5

4

3

2

_1381141932.unknown

_1381142027.unknown

_1443849464.unknown

_1195897336.unknown

_1160398985.unknown

BSTAT-calculations-2013-Week6-NonParametric-v2.xlsx

W6 Ex1

Consider 20 days of stock exchange data:
Day: 2 3 5 6 7 8 10 12 13 14 16 17 18 19 20
Change: + + - + + - - - - - + - - - +
As n1 & n2 ≤ 10 use tables.
- occurs 6 times =n1
+ occurs 9 times =n2
Total 15 (NOT 20)
Runs 7 =R
From Runs table
For α= 0.05
Critical Value (Upper) 4 <7 Do NOT Reject H0 2-tailed 5% level
Critical Value (Lower) 13 >7
(Calculation using formula also shown for comparison)
n1= 6
n2= 9
n1+n2= 15
R= 7
n1n2= 54
2n1n2/(n1+n2) 7.2
2n1n2*(2n1n2-n1-n2) 10044
(n1+n2)2*(n1+n2-1) 3150
Numerator -1.2
Denominator 1.7856571419
z= -0.672021505 1.96
p-value 0.5015700059 0.0249978951

W6 Ex2

If n1 and n2 are not both < 10:
Consider a group of students:
M F F F M F M M M M F F M F F F M M M
H0 : male and female students are in random order
H1 : male & female students are not in random order
M occurs 10 times =n1
F occurs 9 times =n2
Total 19
Runs 9 =R
From Runs table
For α= 0.05
Critical Value (Upper) 5 <9 Do NOT Reject H0 2-tailed 5% level
Critical Value (Lower) 16 >9
(Calculation using formula also shown for comparison)
n1= 10
n2= 9
n1+n2= 19
R= 9
n1n2= 90
2n1n2/(n1+n2) 9.4736842105
2n1n2(2n1n2-n1-n2) 28980
(n1+n2)2(n1+n2-1) 6498
Numerator -1.4736842105
Denominator 2.1118318577
z= -0.6978227008
Critical value -1.96 from z table
(2-tailed, 5% level)
p-value 0.4852880806

W6 Ex 3 Mann-Whitney

Branch A Branch B Rank A Rank B
42 22 15 9
65 17 24 5.5
38 35 13 12
55 19 20 7
71 8 26 1
60 24 23 10
47 42 18 15
59 14 22 3
68 28 25 11
57 17 21 5.5
76 10 27 2
42 15 15 4
20 8
45 17 check sums of ranks:
50 19 27 378 378 sum 1 to 27
n1= n2= SUM= T1 T2
12 15 249 129
180 78 -249 9
180 120 -129 171
Lowest U 9
At 5% level critical value = 56 from table 56 (One-tailed)
9 < 56 so reject H0 etc

W6 Ex4

Student Marks Package A Marks Package B Difference Absolute Positive Negative Signed rank
1 20 16 4 4 5.5 5.5 5.5
2 24 26 -2 2 1.5 1.5 -1.5
3 28 18 10 10 12.5 12.5 12.5
4 24 17 7 7 8.5 8.5 8.5
5 20 20 0 0 zero
6 29 21 8 8 10 10 10
7 19 23 -4 4 5.5 5.5 -5.5
8 27 22 5 5 7 7 7
9 20 23 -3 3 3.5 3.5 -3.5
10 30 20 10 10 12.5 12.5 12.5
11 18 18 0 0 zero
12 28 21 7 7 8.5 8.5 8.5
13 26 17 9 9 11 11 11
14 24 26 -2 2 1.5 1.5 -1.5
15 25 25 0 0 zero
16 21 24 -3 3 3.5 3.5 -3.5
lowest
91 75.5 15.5 15.5 60 =sum of signed ranks
(as in Anderson)
From table
n= 13 exclude zeroes
Level 0.05 Critical value
Two tailed 17 15.5 Reject H0

W6 Ex5

Ranks
Fertilizer 1 Fertilizer 2 Fertilizer 3 F1 F2 F3
Yield Rank Yield Rank Yield Rank
45 6 42 3 53 9 45 42 53 6 3 9
40 1 44 5 56 12 40 44 56 1 5 12
41 2 43 4 54 10 41 43 54 2 4 10
46 7 47 8 55 11 46 47 55 7 8 11
Total
sums 16 20 42
nt= 12 R^2/nj 64 100 441 605
k= 3 605
12/n(n+1) 0.0769230769
H= 0.0769230769 * 605 - 39
H= 7.5384615385
Chi-squared with 2 degrees of freedom
Critical values:
0.05 5.9914645471 <<SIGNIFICANT at 5% level
0.025 7.3777589082 <<SIGNIFICANT at 2.5% level
0.02 7.8240460109 NOT at 2% level
p-value 0.0230698025

W6 Ex6

Chest injury rating Rank(from lowest)
Car Driver Passenger Difference Abs Positive Negative
1 42 35 7 7 9.5 9.5
2 42 35 7 7 9.5 9.5
3 34 45 -11 11 11.5 11.5
4 34 45 -11 11 11.5 11.5
5 45 45 0
6 40 42 -2 2 4 4
7 42 46 -4 4 7 7
8 43 58 -15 15 15 15
9 45 43 2 2 4 4
10 36 37 -1 1 1.5 1.5
11 36 37 -1 1 1.5 1.5
12 43 58 -15 15 15 15
13 40 42 -2 2 4 4
14 43 58 -15 15 15 15
15 37 41 -4 4 7 7
16 37 41 -4 4 7 7
17 44 57 -13 13 13 13
18 42 42 0
n= 16 136 23 113
2 tailed
α= 0.05 0.02 0.01
Critical value 30 24 19
Test statistic 23 23 23
Reject Ho Reject Ho Do NOT Reject
Significant at 5% level AND 2%

W6 Ex7

Wilcoxon approach - questionable?? Rank(from lowest)
Student Attitude towards Father Attitude towards Mother Difference Abs Positive Negative
1 2 3 -1 1 5.5 5.5
2 5 5 0
3 4 3 1 1 5.5 5.5
4 4 5 -1 1 5.5 5.5
5 3 4 -1 1 5.5 5.5
6 5 4 1 1 5.5 5.5
7 4 5 -1 1 5.5 5.5
8 2 4 -2 2 11 11
9 4 5 -1 1 5.5 5.5
10 5 4 1 1 5.5 5.5
11 4 5 -1 1 5.5 5.5
12 5 4 1 1 5.5 5.5
13 3 3 0
n= 11 66 22 44
2 tailed
α= 0.1 0.05 0.02 0.01
Critical value 14 11 7 5
Test statistic 22 22 22 22
Do NOT Reject Do NOT Reject Do NOT Reject Do NOT Reject
NOT Significant at 10%
See next worksheet for different approach!

W6 Ex7(Kruskal-Wallis approach)

Student Attitude towards Father Attitude towards Mother Different approach - Kruskal-Wallis
1 2 3 1.5 5
2 5 5 22 22
3 4 3 12.5 5
4 4 5 12.5 22
5 3 4 5 12.5
6 5 4 22 12.5
7 4 5 12.5 22
8 2 4 1.5 12.5
9 4 5 12.5 22
10 5 4 22 12.5
11 4 5 12.5 22
12 5 4 22 12.5
13 3 3 5 5
sums 163.5 187.5 351
nj= 13 13
R^2/nj 2056.3269230769 2704.3269230769
k= 2
n= 26
H= 0.0170940171 * 4760.6538461539 - 81
H= 0.3786982249
Chi-squared with 1 degrees of freedom
Critical values:
0.05 3.841 <<NOT Signficant at 5% level
0.1 2.706 <<NOT Signficant at 10% level

W6 Ex7(Mann-Whitney approach)

Student Attitude towards Father Attitude towards Mother Rank A Rank B Different approach - Kruskal-Wallis
1 2 3 1.5 5
2 5 5 22 22
3 4 3 12.5 5
4 4 5 12.5 22
5 3 4 5 12.5
6 5 4 22 12.5
7 4 5 12.5 22
8 2 4 1.5 12.5
9 4 5 12.5 22
10 5 4 22 12.5
11 4 5 12.5 22
12 5 4 22 12.5
13 3 3 5 5
n1= n2= SUM= T1 T2
13 13 163.5 187.5 351 351
169 91 163.5
169 91 187.5
U1 U2
96.5 72.5
Smaller U= 72.5
Critical V= 46
α= 0.05
Do NOT reject

W6 Q1

Scores Ranks
Car A Car B Car C Car D Car A Car B Car C Car D
78 62 80 85 10 1 12.5 17
75 63 77 80 7 2 9 12.5
80 72 88 88 12.5 5.5 19.5 19.5
72 68 80 82 5.5 4 12.5 15
76 64 83 87 8 3 16 18
Total
Sums 43 15.5 69.5 82
nj= 5 5 5 5 n= 20
R2/nj= 369.8 48.05 966.05 1344.8 2728.7
12/n(n+1)= 0.0285714286
H= 0.0285714286 * 2728.7 - 63
H= 14.9628571429
k= 4
ν= 3
Chi-squared with 3 degrees of freedom
Critical values:
0.05 7.8147279033 Reject at 5% level
0.025 9.3484036045 Reject at 2.5% level
0.01 11.3448667301 Reject at 1% level
0.001 16.2662361962 Do NOT Reject
p-value 0.0018486668

W6 Q2

Dr Atom 60 75 80 65 70 80 80 85 85 65
Dr Bunsen 60 55 60 65 75 80 80 75 70
Dr Atom Dr Bunsen Ranks A Ranks B
60 60 3 3
75 55 11 1
80 60 15 3
65 65 6 6
70 75 8.5 11
80 80 15 15
80 80 15 15
85 75 18.5 11
85 70 18.5 8.5
65 6
n1= n2= SUM= T1 T2 T
10 9 116.5 73.5 73.5
90 55 -116.5 28.5
90 45 -73.5 61.5
Lowest U 28.5
At 5% level critical value = from table 21 (Two-tailed)
(use 0.025 in table) Do NOT reject H0

W6 Q3

FSSSFSFFS SSFSFFFSS SFSSFFFFS SSFSFFSSS
-0.7777777778 -0.7777777778 top
F occurs 16 times n1= 16
S occurs 20 times n2= 20 386560 8.5220458554 2.9192543321 bottom
F+S 36 45360
Runs 18 R= 18
z= -0.2664302898 -0.2664302898
critical value
-1.96
(z table)
Do NOT Reject

W6 Q4

Before 58 38 83 61 69 68 70 62 39 72
After 46 53 85 79 75 67 66 69 46 81
Rank(from lowest)
Student Before After Difference Abs Positive Negative
1 58 46 -12 12 8 8
2 38 53 15 15 9 9
3 83 85 2 2 2 2
4 61 79 18 18 10 10
5 69 75 6 6 4 4
6 68 67 -1 1 1 1
7 70 66 -4 4 3 3
8 62 69 7 7 5.5 5.5
9 39 46 7 7 5.5 5.5
10 72 81 9 9 7 7
n= 10 55 43 12
1 tailed
α= 0.05 0.025 0.01 0.005
Critical value 11 8 5 3
Test statistic 12 12 12 12
Do NOT Reject Do NOT Reject Do NOT Reject
NOT Significant at 5%
NOT Beneficial

W6 Q5

MMFFFFFMFFMMMMMMFFFFMMFMMFFMFFFFFMMMMMFF
-6.95 -6.95 top
F occurs 21 times n1= 21
M occurs 19 times n2= 19 604884 9.6936538462 3.1134633202 bottom
F+S 40 62400
Runs 14 R= 14
z= -2.2322408473 -2.2322408473
critical value= -1.96
at 5% level
(z table)
Reject H0 at 5% level

W6 Q6(i)

Machine 1: 748.7 751.3 752.1 747.8 753.2 749.2 748.1 754.5 752.3 750.1
Machine 2: 748.3 747.2 746.7 746.3 746.1 747.5 751.5 749.2 750.4 751.1
squares
Machine 1: Machine 2:
748.7 748.3 560551.69 559952.89
751.3 747.2 564451.69 558307.84
752.1 746.7 565654.41 557560.89
747.8 746.3 559204.84 556963.69
753.2 746.1 567310.24 556665.21
749.2 747.5 561300.64 558756.25
748.1 751.5 559653.61 564752.25
754.5 749.2 569270.25 561300.64
752.3 750.4 565955.29 563100.16
750.1 751.1 562650.01 564151.21
Total 7507.3 7484.3 5636002.67 5601511.03
Σx1 = 7507.3
Σx2 = 7484.3
Σx12 = 5636002.67
Σx22 = 5601511.03
= 750.73
= 748.43
top 83.7219999991
botton 18
= 4.6512222222
n1= 10
n2= 10
ν= 18
t= 2.3847 5.686677337
α= 5% critical value= 2.1009220402 4.4138734192
α/2= 2.50% REJECT
2 tailed
p-value= 0.0283023346

W6 Q6(ii)

Machine 1: 748.7 751.3 752.1 747.8 753.2 749.2 748.1 754.5 752.3 750.1
Machine 2: 748.3 747.2 746.7 746.3 746.1 747.5 751.5 749.2 750.4 751.1
squares
Machine 1: Machine 2:
748.7 748.3 560551.69 559952.89
751.3 747.2 564451.69 558307.84
752.1 746.7 565654.41 557560.89
747.8 746.3 559204.84 556963.69
753.2 746.1 567310.24 556665.21
749.2 747.5 561300.64 558756.25
748.1 751.5 559653.61 564752.25
754.5 749.2 569270.25 561300.64
752.3 750.4 565955.29 563100.16
750.1 751.1 562650.01 564151.21
Total 7507.3 7484.3 5636002.67 5601511.03
j= 1 2 overall Sums of squares
Σxj 7507.3 7484.3 Σx 14991.6 5636002.67 5601511.03 Total= 11237513.7
nj= 10 10 n= 20 20
mean xj 750.73 748.43 mean x 749.58
(mean xj)2 563595.5329 560147.4649 (mean x)2 561870.1764
nj*mean xj2 5635955.329 5601474.649 n*mean x2 11237403.528 11237429.978
Σx2= 11237513.7 Sum of squares
= 11237403.528
SST= 110.1719999965
0
= 11237429.978
n*mean2= 11237403.528
SSA= 26.4499999974
SSE=SST-SSA= 83.7219999991
Source of Variation Sum of squares Degrees of freedom Mean Square Variance Ratio
Among groups SSA k - 1 MSA = SSA/(k – 1) VR = MSA/MSE
Error SSE n - k MSE = SSE/(n- k)
Total SST n - 1
Source of Variation Sum of squares Degrees of freedom Mean Square Variance Ratio
Among groups 26.4499999974 1 26.4499999974 5.6866773364
Error 83.7219999991 18 4.6512222222
Total 110.1719999965 19
n= 20
k= 2
α= 5%
F= 5.6866773364
Critical value= 4.41387
Reject
p-value= 0.0283023346

W6 Q6(iii)

Machine 1: 748.7 751.3 752.1 747.8 753.2 749.2 748.1 754.5 752.3 750.1
Machine 2: 748.3 747.2 746.7 746.3 746.1 747.5 751.5 749.2 750.4 751.1
Ranks
Machine 1: Machine 2: Machine 1: Machine 2: Different approach - Kruskal-Wallis
748.7 748.3 9 8
751.3 747.2 15 4
752.1 746.7 17 3
747.8 746.3 6 2
753.2 746.1 19 1
749.2 747.5 10.5 5
748.1 751.5 7 16
754.5 749.2 20 10.5
752.3 750.4 18 13
750.1 751.1 12 14
sums 133.5 76.5 351
nj= 10 10
R^2/nj 1782.225 585.225
k= 2
n= 20
H= 0.0285714286 * 2367.45 - 63
H= 4.6414285714
Chi-squared with 1 degrees of freedom
Critical values:
0.05 3.841 <<Reject at 5% level
0.025 5.024 <<Do NOT Reject at 2.5% level

W6 Q7

Scheme 1 77 73 82 96 68 84 78 81 90
Scheme 2 73 77 81 76 73 69 83 84
Scheme 1 Scheme 2 Ranks A Ranks B
77 73 7.5 4
73 77 4 7.5
82 81 12 10.5
96 76 17 6
68 73 1 4
84 69 14.5 2
78 83 9 13
81 84 10.5 14.5
90 16
n1= n2= SUM= T1 T2 T
9 8 91.5 61.5 61.5
72 45 -91.5 25.5
72 36 -61.5 46.5
Lowest U 25.5
At 5% level critical value = from table 19 (One-tailed)
Do NOT reject H0

(

)

(

)

(

)

(

)

(

)

67202

.

0

188571

.

3

2

.

1

3150

10044

2

.

1

3150

15

108

108

1

15

108

7

14

15

9

6

9

6

2

9

6

2

1

15

9

6

2

7

1

2

2

1

2

2

2

1

2

2

1

2

1

2

1

2

1

2

1

2

1

-

=

-

=

-

=

-

´

÷

ø

ö

ç

è

æ

+

-

=

´

-

-

´

´

´

´

´

÷

ø

ö

ç

è

æ

+

´

´

-

=

-

+

+

-

-

÷

÷

ø

ö

ç

ç

è

æ

+

+

-

=

n

n

n

n

n

n

n

n

n

n

n

n

n

n

R

z

 

  

   

67202.0

188571.3

2.1

3150

10044

2.1

3150

15108108

1

15

108

7

1415

96962962

1

15

962

7

1

22

1

2

2

21

2

21

212121

21

21















nnnn

nnnnnn

nn

nn

R

z

(

)

(

)

(

)

(

)

69782

.

0

459834

.

4

47368

.

1

18

19

9

10

9

10

2

9

10

2

1

19

9

10

2

9

1

2

2

1

2

2

2

1

2

2

1

2

1

2

1

2

1

2

1

2

1

-

=

-

=

´

-

-

´

´

´

´

÷

ø

ö

ç

è

æ

+

´

´

-

=

-

+

+

-

-

÷

÷

ø

ö

ç

ç

è

æ

+

+

-

=

n

n

n

n

n

n

n

n

n

n

n

n

n

n

R

z

 

  

 

69782.0

459834.4

47368.1

1819

91091029102

1

19

9102

9

1

22

1

2

2

21

2

21

212121

21

21











nnnn

nnnnnn

nn

nn

R

z

(

)

=

-

+

+

=

1

1

1

2

1

1

2

1

T

n

n

n

n

U

 





1

11

211

2

1

T

nn

nnU

(

)

=

-

+

+

=

2

2

2

2

1

2

2

1

T

n

n

n

n

U

 





2

22

212

2

1

T

nn

nnU

(

)

(

)

å

+

-

+

=

1

3

1

12

2

n

n

R

n

n

H

j

j

(

)

=

-

+

+

=

A

A

T

n

n

n

n

U

2

1

1

1

2

1

 





AA

T

nn

nnU

2

1

11

21

(

)

B

B

T

n

n

n

n

U

-

+

+

=

2

1

2

2

2

1

(

)

(

)

(

)

(

)

26643

.

0

522046

.

8

77778

.

0

35

36

20

16

20

16

2

20

16

2

1

36

20

16

2

18

1

2

2

1

2

2

2

1

2

2

1

2

1

2

1

2

1

2

1

2

1

-

=

-

=

-

-

÷

ø

ö

ç

è

æ

+

-

=

-

+

+

-

-

÷

÷

ø

ö

ç

ç

è

æ

+

+

-

=

x

x

x

x

x

x

x

n

n

n

n

n

n

n

n

n

n

n

n

n

n

R

z

 

  

 

26643.0

522046.8

77778.0

3536

20162016220162

1

36

20162

18

1

22

1

2

2

21

2

21

212121

21

21











x

xxxx

xx

nnnn

nnnnnn

nn

nn

R

z

(

)

(

)

(

)

(

)

23224

.

2

693654

.

9

95

.

6

39

39

40

19

21

19

21

2

19

21

2

1

40

19

21

2

7

1

2

2

1

2

2

2

1

2

2

1

2

1

2

1

2

1

2

1

2

1

-

=

-

=

-

-

÷

ø

ö

ç

è

æ

+

-

=

-

+

+

-

-

÷

÷

ø

ö

ç

ç

è

æ

+

+

-

=

x

x

x

x

x

x

x

n

n

n

n

n

n

n

n

n

n

n

n

n

n

R

z

 

  

 

23224.2

693654.9

95.6

39

3940

19211921219212

1

40

19212

7

1

22

1

2

2

21

2

21

212121

21

21











x

xxxx

xx

nnnn

nnnnnn

nn

nn

R

z

2

ˆ

s

2

ˆ

2

2

1

2

2

2

2

2

2

1

1

2

1

-

+

-

+

-

å

å

n

n

x

n

x

x

n

x

2

21

2

22

2

2

2

11

2

1





 

nn

xnxxnx

(

)

(

)

÷

÷

ø

ö

ç

ç

è

æ

+

-

=

-

+

-

+

-

=

-

+

-

+

-

=

å

å

2

1

2

2

1

2

1

2

2

2

2

2

2

1

1

2

1

2

1

2

2

2

2

1

1

2

1

1

ˆ

2

2

ˆ

1

ˆ

1

ˆ

n

n

x

x

t

n

n

x

n

x

x

n

x

n

n

n

n

s

s

s

s











 

21

2

21

21

2

22

2

2

2

11

2

1

21

2

22

2

11

2

11

ˆ

22

ˆ

1

ˆ

1

ˆ

nn

xx

t

nn

xnxxnx

nn

nn



1

x

1

x

2

x

2

x

2

x

n

2

xn

å

2

j

j

x

n

2

jj

xn

å

-

=

2

2

x

n

x

SST

å

-

=

2

2

x

n

x

n

SSA

j

j



2

2

xnxnSSA

jj

2

x

n

2

xn

COMPANIES.XLSX

Exercises-Topic-6-Non-Parametric.doc

Business Statistics Topic 6

Topic 6 Exercises – Non-Parametric Tests

Where datasets from Anderson (2010) Chapter 19 are mentioned these will be available on Moodle. Some files from earlier chapters are also used. These are on Moodle for previous weeks.

Use Excel or SPSS as appropriate

1. Use file Companies, investigate the following:

Is there any evidence of differences between the companies traded on the five different stock exchanges (indicated by country) in respect of: market value, 12-month price change or any of the other quantities shown?

Conduct a similar exercise to compare companies in the General Retail and Banking sectors

Consider some of the exercises for Topic 4 and 5. Recalculate using the equivalent non-parametric tests.

2. Fifteen applicants for a post were divided at random into two groups containing 8 and 7 persons. The two groups were interviewed by two different human resource managers. The two interviewers gave marks 1 to 10 for each of the applicants. Is there any evidence from the marks below that the interviewers have different standards? Carry out an appropriate non-parametric test, choosing suitable significance levels. Compare the result with that obtained use a parametric test (see Topic 4, Q5).

Interviewer

Marks

A

8

7

6

9

7

5

8

9

B

7

4

6

8

5

6

7

3. A sleeping pill and a placebo were tested in turn on 10 patients at a hospital and gave the results shown below. The number of hours sleep is normally distributed. The order in which the sleeping pill and placebo were given to patients was randomized.

Patient

1

2

3

4

5

6

7

8

9

10

Sleeping pill

10.6

7.5

9.0

5.4

6.1

10.2

7.1

9.7

8.5

7.9

Placebo

8.6

7.3

9.4

5.1

5.4

9.0

6.5

7.9

8.7

6.9

Carry out an appropriate non-parametric test, to determine whether the drug is effective. Compare the result with that obtained using a parametric test (see Topic 4, Q6).

Where datasets from Anderson (2010) Chapter 10 are mentioned these will be available on Moodle for week 4.

4. Carry out appropriate non-parametric statistical tests on any of the datasets from Anderson et. al (2010) Chapter 10 using either Excel or SPSS. State any assumptions you make. Compare the result with that obtained using a parametric test (see Topic 4, Q7).

Where datasets from Anderson (2010) Chapter 13 are mentioned these will be available on Moodle for week 5.

For the following questions use a non-parametric statistical test and compare with the results obtained using ANOVA in the Topic 5 exercises:

5. Use file AirTraf.

The table shows the stress levels of six air traffic controllers using three different systems.

(a) Determine whether there is any significant difference between the three systems.

(b) Determine whether there is any significant difference between the six controllers.

6. Use file Chemietech.

The table shows the numbers of work units produced per week by three random sample each of five employees. Each sample uses a different method.

Determine whether there is any significant difference between the three methods.

7. Use file Exer25.

The table shows a measure of the performance for random samples of three different processes.

Determine whether there is any significant difference between the performances of the three processes.

8. Use file Medical1.

The table shows a measure of the performance of the health system for three countries using a random sample of twenty observations for each.

Determine whether there is any significant difference between the performances of the three countries.

9. Use file NCP.

The table shows examinations score for 18 employees, six taken at random from each of three branches of a company.

Determine whether there is any significant difference between the performances of employees at the three branches.

10. Use file Paint.

The table shows a measure of the drying times of four brands of paint, using a random sample of five observations for each.

Determine whether there is any significant difference between the drying times of the four brands.

11. Use file Plant.

The table shows details of independent random samples of average hourly output for three manufacturing plants. Determine whether average outputs differ significantly between plants and if so determine which are significantly higher or lower.

12. Use file Ships.

Eight cruise ships are randomly selected in each of three classes (by size). A survey of passengers is carried out on each ship giving a rating on a scale up to 100. Test for any significant difference in the ratings between the three size classifications.

The classifications are:

Small: <500 passengers

Medium: 500 to <1500 passengers

Large: 1500 or more passengers

13. Use file Stress.

The table shows stress ratings for samples of 15 individuals in each of three professions. This was done using a self-assessment with 20 items, each with responses 1-5, the higher value indicating more stress. The totals of these responses were added. Test for any significant difference in job stress between the three professions.

Reference

Anderson D R, Sweeney D J, Williams T A, Freeman J & Shoesmith E, Statistics for Business and Economics, 2nd Edition, Cengage Learning EMEA 2010

3