Anda di halaman 1dari 28

Nonparametric Tests

Reference Material

NONPARAMETRIC TESTS


Parametric implies that the distribution is assumed for the population.


Very often, we assume that the data are a sample from a normal
distribution. E.g.: t, F tests etc..
Nonparametric implies that there is no assumption of a specific
distribution for the population.
The advantage of a parametric test is the power of a parametric test is
higher than the nonparametric test.
The advantage of nonparametric test is test results are more robust
against violation of the assumptions.

Reference Material

WILCOXON SIGNED RANK TEST




This is a test of median or calculate the corresponding point estimate


and confidence interval.

H0 : Median = Hypothesized median

H1 : Median Hypothesized median

Reference Material

WILCOXON SIGNED RANK TEST FROM MINITAB

Open MINITAB Worksheet.

Enter the data in one column.

Choose STAT > NONPARAMETRICS > 1-SAMPLE


WILCOXON

In test median, enter the hypothesized median.

Enter OK.

If, P-value < 0.05; Reject the Null Hypothesis and


conclude that the median is not equal to hypothesized
median.

Reference Material

KRUSKAL-WALLIS TEST


No assumptions regarding the population probability distributions to


compare k populations.

H0 : All the k population medians are equal

H1 : The medians are not equal


k

12 n i R i - R
Test Statistic, H =

i =1

N ( N + 1)
where, ni = number of observations in group i
N = Total sample size

R i = Average of ranks in group i


R = Average of all the ranks
Reference Material

KRUSKAL-WALLIS TEST FROM MINITAB

Open MINITAB Worksheet.

Enter the data in one column and its corresponding level


of the factor in another column

Choose STAT > NONPARAMETRICS > KRUSKALWALLIS

In response, enter the data column.

In factor, enter the level of the factor column.

Enter OK.

If, P-value < 0.05; Reject the Null Hypothesis and


conclude that the medians are not equal.

Reference Material

A vs. B Analysis


The A vs. B analysis is a way to compare two


processes even if the processes provide no numbers
(non-parametric statistics).
One must evaluate which of two results is better. That
is, one must be able to create a ranking order.
We take a sample with two results each from processes
A and B. We arrange the results from good to poor.
good

poor
Reference Material

A2
A1
B1
B2

Hypotheses
We want to compare processes A and B.
Our hypotheses are:

Ho: A = B
Ha: A B
How large is the risk, if we obtain the

Sequence

Reference Material

A
A
B
B

for each of the two


results from A and B?
(what is the probability of obtaining
a result like this randomly?)

- Risk


There are a total of 6 combinations for arranging 2 results from A


and B:

good

poor

A
A
B
B

A
B
A
B

A
B
B
A

B
B
A
A

The probability of randomly obtaining the


combination to the left, assuming
Ho is correct is 1/6 17 %.
But that is our risk.

B
A
B
A

B
A
A
B

A
A
B
B

Reference Material

- Risk


For three results per process, there are 20 different


combinations:
AAAAAAAAAABBBBBBBBBB
AAAABBBBBBAAAAAABBBB
ABBBAAABBBAAABBBAAAB
BABBABBAABABBAABAABA
BBABBABABABABABAABAA
BBBABBABAABBABAABAAA

The probability of randomly obtaining the


combination to the right is 1/20, assuming
Ho is correct.
Our risk is therefore 5%.

Reference Material

A
A
A
B
B
B

Overlapping Results
We take 5 results each from processes A and B.
In practice, we frequently obtain overlaps.
A
A
A 4
A
B
B
A
B
3
B
B
Reference Material

We count how many As and Bs are in


sequence at the beginning and at the end.
In this case 4 + 3 = 7
risk < 5 %, if we assert that A B

Decision-Making Rule
The 6 9 12 Rule is the decision-making rule.
If the number of A samples is equal to or no more than 20 %
greater than the number of B samples, then A is better than B
with a statistical alpha risk of:
5 %
1 %
0,1 %

if the total values in sequence are


if the total values in sequence are
if the total values in sequence are

6
9
12

The sample size should be approx. 10 per process.

Reference Material

Sample Size Selection


Black Belt Training

Reference Material

IN WHICH CASE THE CONFIDENCE


INTERVAL WILL BE NARROWER
CASE 1

CASE 2

C o n fid e n c e L e ve l

95%

95%

A verage

100

100

S a m p le S ize

10

1000

C o n fid e n ce In ter v a l

9 6 - 1 04

9 8 .5 - 10 1

IT WILL BE NARROWER IN CASE 2

WHY?
Reference Material

14

CONFIDENCE INTERVAL & SAMPLE SIZE


Larger Sample Size :
More confidence that the next value will be nearer to 100, hence
narrower confidence interval.
Smaller Sample Size :
Lesser confidence that the next value will be nearer to 100,
broader confidence interval.

hence

1
Hence, Sample Size
ConfidenceInterval
Reference Material

15

SAMPLE SIZE SELECTION




To understand how to calculate sample sizes we need to understand


two things :

1. Test sensitivity
2. Risks


We shall see both these before we go on to sample size selection

Reference Material

16

EXAMPLE
The machine is set at 100 mm at time t = 1. As the time
progresses there is a gradual shift of mean to 100.1 & 102
mm. The standard deviation throughout is constant at 1 mm.
At TIME = 1
Average = 100
SD = 1

At TIME = 2

At TIME = 3

Average = 100.1 Average = 102


SD = 1

SD = 1

n number of pieces at t = 2 & 3 are compared with t = 1 to


detect if any shift has occurred.

Reference Material

17

EXAMPLE
100

100.1

SHIFT (
) = 0.1 mm

Comparison of T= 1 & 2

100

102

SHIFT (
) = 2 mm

Comparison of T= 1 & 3

In which case would we easily detect the shift?


Obviously CASE 2 (Comparison of T = 1 & 3). WHY?
In case 1, the area of overlap is higher and hence larger
proportion of readings would lie in common area and hence it
would be difficult to judge whether the mean has shifted or not.
Reference Material

18

ANOTHER EXAMPLE
 The machine is set at 100 mm at time t = 1. As the time
progresses there is a gradual shift of mean to 100.5 mm.
 Case 1 : Mean shifts from 100 to 100.5 and SD is 1 mm
 Case 2 : Mean shifts from 100 to 100.5 and SD is 0.1 mm
At TIME = 1

At TIME = 2

Average = 100

Average = 100.5

CASE 1: SD = 1 mm
CASE 2: SD = 0.1 mm

n number of pieces are taken in both the cases and compares


at t = 1 with t = 2 to detect if any shift has occurred.
Reference Material

19

ANOTHER EXAMPLE
100

100

100.5

Case 1

SHIFT ( ) = 0.5 mm

100.5

Case 2

SHIFT ( ) = 0.5 mm

In which case would we easily detect the shift?


Obviously CASE 2
WHY?
The area of overlap is more in case 1 and hence though a point
may belong to the new population you may believe it to be
belonging to the old population. In case 2 the same shift can
easily be detected due to the smaller overlap.
Reference Material

20

TEST SENSITIVITY
Hence, lower the standard deviation it is easier to
detect the shift, and more the shift it is easier to
detect it.
The shift per standard deviation is called test
sensitivity.
Test sensitivity = (
/
)
Higher the test sensitivity (
/
), the more
confidence in making a right judgement of change.
Reference Material

21

CONFIDENCE LEVELS / RISKS


A man is accused of murder. The various possibilities are...
INNOCENT
GUILTY
ACQUITTED

PUNISHED

OK

Error
(Type I Error)

Error
(Type II Error)
OK

When risk Materializes, the ensuing error is called Error


When risk materializes, the ensuing error is called Error
Reference Material

22

CONFIDENCE LEVELS / RISKS


An easy way to remember is...
Amitabh Bachan
Acquitted

Jailed

Shakti Kapoor

AN EASIER WAY TO REMEMBER...


ERROR
OK

ERROR

OK

= P {Type I error} = P [ Reject H0 / H0 is true]


= P {Type II error} = P [ Fail to reject H0 / H0 is false]
Reference Material

23

CONFIDENCE LEVELS / RISKS


CASE

ERROR

Good lot rejected

Bad supplier registered.

Oversize piston accepted

Right person not rewarded

The general procedure is, directly control or choose


risk.
The
risk is generally a function of sample size and is
controlled indirectly.
The larger the sample size, the smaller is the
risk.

Power of the test = 1- = P [ Reject H0 / H0 is true]


Reference Material

24

CALCULATION OF SAMPLE SIZE


The questions to which one must have the answers before
calculation of sample size are..


What is the shift

What is the standard deviation ()

Hence, what is the test sensitivity = (/)

What is the risk acceptable (normally 0.05 or 5%)

What is the risk acceptable (normally 0.1 or 10%)

Reference Material

()

25

CALCULATION OF SAMPLE SIZE




For Estimating to within an error with probability (1-), the required


sample size is found from the equation


Z/2
=
n


(or)

n =

Z2/2 2

For Estimating p to within an error with probability (1-), the required


sample size is found from the equation

Z/2

Reference Material

p (1 - p)
=
n

or

n =

Z2/2 p (1 - p)

2
26

EXAMPLE-SAMPLE SIZE CALCULATION


A flashbulb manufacturer was making an inference about
the fraction defective in a shipment. Suppose the
manufacturer wants to estimate the true fraction p within
1% with 90% confidence. The p value is near to 0.05.
We want the error of estimation to be less than = 1% = 0.01.
With 90% probability, we must have = 1-0.90 = 0.10.
Hence, Z/2 = Z0.05 = 1.645

n =

Reference Material

Z2/2 p (1 - p)

(1.645)2 0.05 (1 - 0.05)


=
= 1286
2
( 0.01 )

27

SAMPLE SIZE SELECTION FROM MINITAB


Open MINITAB Worksheet.
Choose STAT > POWER AND SAMPLE SIZE > 1SAMPLE Z
In differences, enter the error of estimation.
In power values, enter the required power of the test
(1-).
In sigma, enter the process standard deviation.
Click on options, enter the significance level, .
Enter OK.
Reference Material

28

Anda mungkin juga menyukai