You are on page 1of 192

Non-Parametric Tests for One Sample

Location Problem
Simulation Study

Anirban Ray, Mriganka Aulia

27 March 2018

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Introduction

Under parametric set-up, tests are done in one sample location


problems usually for population mean

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Introduction

Under parametric set-up, tests are done in one sample location


problems usually for population mean
On the contrary, tests are done for population quantiles in
non-parametric set-up

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Introduction

Under parametric set-up, tests are done in one sample location


problems usually for population mean
On the contrary, tests are done for population quantiles in
non-parametric set-up
Advantageous, as these are more robust in nature

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Objective

In this project, we will consider the following two tests:

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Objective

In this project, we will consider the following two tests:

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Objective

In this project, we will consider the following two tests:


1. Sign Test

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Objective

In this project, we will consider the following two tests:


1. Sign Test

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Objective

In this project, we will consider the following two tests:


1. Sign Test
2. Wilcoxon Signed Rank Test

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Objective

In this project, we will consider the following two tests:


1. Sign Test
2. Wilcoxon Signed Rank Test

We will verify some of the properties by simulation study,


namely:

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Objective

In this project, we will consider the following two tests:


1. Sign Test
2. Wilcoxon Signed Rank Test

We will verify some of the properties by simulation study,


namely:

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Objective

In this project, we will consider the following two tests:


1. Sign Test
2. Wilcoxon Signed Rank Test

We will verify some of the properties by simulation study,


namely:
Distribution Free under Null Hypothesis

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Objective

In this project, we will consider the following two tests:


1. Sign Test
2. Wilcoxon Signed Rank Test

We will verify some of the properties by simulation study,


namely:
Distribution Free under Null Hypothesis

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Objective

In this project, we will consider the following two tests:


1. Sign Test
2. Wilcoxon Signed Rank Test

We will verify some of the properties by simulation study,


namely:
Distribution Free under Null Hypothesis
Asymptotic Normality for Large Samples

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Objective

In this project, we will consider the following two tests:


1. Sign Test
2. Wilcoxon Signed Rank Test

We will verify some of the properties by simulation study,


namely:
Distribution Free under Null Hypothesis
Asymptotic Normality for Large Samples

Then, we will estimate the power curves

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Objective

In this project, we will consider the following two tests:


1. Sign Test
2. Wilcoxon Signed Rank Test

We will verify some of the properties by simulation study,


namely:
Distribution Free under Null Hypothesis
Asymptotic Normality for Large Samples

Then, we will estimate the power curves


Finally, we will compare these simulated power curves with that
of corresponding parametric test

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Assumptions

(X1 , X2 , . . . , Xn ) is a random sample from a location family


with distribution function F (x − θ)

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Assumptions

(X1 , X2 , . . . , Xn ) is a random sample from a location family


with distribution function F (x − θ)
F ∈ Ω0 = {F : F is absolutely continuous, F (0) = 21 }

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Testing Problem

We wish test whether the population median is some specified


constant θ0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Testing Problem

We wish test whether the population median is some specified


constant θ0
Alternatively, one can test H0 : ξp = ξp0 , where ξp is the p th
population quantile

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Testing Problem

We wish test whether the population median is some specified


constant θ0
Alternatively, one can test H0 : ξp = ξp0 , where ξp is the p th
population quantile
In this project, we will always consider the test for median

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Testing Problem

We wish test whether the population median is some specified


constant θ0
Alternatively, one can test H0 : ξp = ξp0 , where ξp is the p th
population quantile
In this project, we will always consider the test for median
Tests for quantiles can be constructed by slight modification

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Testing Problem

We wish test whether the population median is some specified


constant θ0
Alternatively, one can test H0 : ξp = ξp0 , where ξp is the p th
population quantile
In this project, we will always consider the test for median
Tests for quantiles can be constructed by slight modification
Null Hypothesis H0 : θ = θ0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Testing Problem

We wish test whether the population median is some specified


constant θ0
Alternatively, one can test H0 : ξp = ξp0 , where ξp is the p th
population quantile
In this project, we will always consider the test for median
Tests for quantiles can be constructed by slight modification
Null Hypothesis H0 : θ = θ0
Alternative Hypotheses

H1 : θ > θ 0
H2 : θ < θ 0
H3 : θ 6= θ0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Test Statistic

Let Yi = Xi − θ0 , i = 1(1)n

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Test Statistic

Let Yi = Xi − θ0 , i = 1(1)n
Define S = ni=1 I(Yi ≥ 0)
P

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Test Statistic

Let Yi = Xi − θ0 , i = 1(1)n
Define S = ni=1 I(Yi ≥ 0)
P

S is the Sign Statistic

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Testing Rule

Under H1 , more observations will tend to be greater than θ0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Testing Rule

Under H1 , more observations will tend to be greater than θ0


So, we reject H0 in favour of H1 for large values of S

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Testing Rule

Under H1 , more observations will tend to be greater than θ0


So, we reject H0 in favour of H1 for large values of S
On the other hand, observations will tend to be lesser than θ0
under H2

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Testing Rule

Under H1 , more observations will tend to be greater than θ0


So, we reject H0 in favour of H1 for large values of S
On the other hand, observations will tend to be lesser than θ0
under H2
So, we reject H0 in favour of H2 for small values of S

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Testing Rule

Under H1 , more observations will tend to be greater than θ0


So, we reject H0 in favour of H1 for large values of S
On the other hand, observations will tend to be lesser than θ0
under H2
So, we reject H0 in favour of H2 for small values of S
Combining these two cases, we reject H0 in favour of H3 if S is
too large or too small

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Null Distribution

Under H0 , S is the sum of n i.i.d. Ber ( 12 ) random variables

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Null Distribution

Under H0 , S is the sum of n i.i.d. Ber ( 12 ) random variables


Thus, S ∼ Bin(n, 12 ), under H0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Null Distribution

Under H0 , S is the sum of n i.i.d. Ber ( 12 ) random variables


Thus, S ∼ Bin(n, 12 ), under H0
For small sample sizes, cut-off points of Binomial distribution
are used to determine the critical region

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Null Distribution

Under H0 , S is the sum of n i.i.d. Ber ( 12 ) random variables


Thus, S ∼ Bin(n, 12 ), under H0
For small sample sizes, cut-off points of Binomial distribution
are used to determine the critical region
If n is large, one can use cut-off points of Normal distribution

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Implementation

In some of the latter sections, we will use SignTest function


from DescTools package

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Verification of Distribution Free Property of Sign
Test Statistic under the Null Hypothesis

We have already stated that S has a Binomial distribution free


of θ under H0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Verification of Distribution Free Property of Sign
Test Statistic under the Null Hypothesis

We have already stated that S has a Binomial distribution free


of θ under H0
Thus, S is a distribution free statistic under H0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Verification of Distribution Free Property of Sign
Test Statistic under the Null Hypothesis

We have already stated that S has a Binomial distribution free


of θ under H0
Thus, S is a distribution free statistic under H0
We wish to verify this by means of simulation study

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Graphical
Verification

To verify, we draw large number (say, R) of samples of fixed


sample size (say, k) from different continuous distributions (say,
Beta, Gamma, Log Normal and Normal)

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Graphical
Verification

To verify, we draw large number (say, R) of samples of fixed


sample size (say, k) from different continuous distributions (say,
Beta, Gamma, Log Normal and Normal)
We compute the test statistic for all the samples

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Graphical
Verification

To verify, we draw large number (say, R) of samples of fixed


sample size (say, k) from different continuous distributions (say,
Beta, Gamma, Log Normal and Normal)
We compute the test statistic for all the samples
We can expect that the frequency distribution of these R Sign
statistics for each distribution will be more or less same

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Graphical
Verification

To verify, we draw large number (say, R) of samples of fixed


sample size (say, k) from different continuous distributions (say,
Beta, Gamma, Log Normal and Normal)
We compute the test statistic for all the samples
We can expect that the frequency distribution of these R Sign
statistics for each distribution will be more or less same
So, the sample quantiles must be in parity with each other

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Graphical
Verification

To verify, we draw large number (say, R) of samples of fixed


sample size (say, k) from different continuous distributions (say,
Beta, Gamma, Log Normal and Normal)
We compute the test statistic for all the samples
We can expect that the frequency distribution of these R Sign
statistics for each distribution will be more or less same
So, the sample quantiles must be in parity with each other
Therefore, Quantile - Quantile plot should be close to the 45◦
line

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Graphical
Verification

To verify, we draw large number (say, R) of samples of fixed


sample size (say, k) from different continuous distributions (say,
Beta, Gamma, Log Normal and Normal)
We compute the test statistic for all the samples
We can expect that the frequency distribution of these R Sign
statistics for each distribution will be more or less same
So, the sample quantiles must be in parity with each other
Therefore, Quantile - Quantile plot should be close to the 45◦
line
We verify this claim for different choices of k

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 1
5
Q−Q Plots for Sign Statistics for Sample Size 5

5
4

4
Log Normal Sample Quantiles
Gamma Sample Quantiles

Normal Sample Quantiles


3

3
2

2
1

1
0

0
0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5

Beta Sample Quantiles Gamma Sample Quantiles Log Normal Sample Quantiles

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 2
10
Q−Q Plots for Sign Statistics for Sample Size 10

10

10
8

8
Log Normal Sample Quantiles
Gamma Sample Quantiles

Normal Sample Quantiles


6

6
4

4
2

2
0

0
0 2 4 6 8 10 0 2 4 6 8 10 0 2 4 6 8 10

Beta Sample Quantiles Gamma Sample Quantiles Log Normal Sample Quantiles

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 3
14
Q−Q Plots for Sign Statistics for Sample Size 15

14

14
12

12

12
10

10

10
Log Normal Sample Quantiles
Gamma Sample Quantiles

Normal Sample Quantiles


8

8
6

6
4

4
2

2
2 4 6 8 10 12 14 2 4 6 8 10 12 14 2 4 6 8 10 12 14

Beta Sample Quantiles Gamma Sample Quantiles Log Normal Sample Quantiles

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 4
15
Q−Q Plots for Sign Statistics for Sample Size 20

15
15
Log Normal Sample Quantiles
Gamma Sample Quantiles

Normal Sample Quantiles


10

10
10

5
5

5 10 15 5 10 15 5 10 15

Beta Sample Quantiles Gamma Sample Quantiles Log Normal Sample Quantiles

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Analytical
Verification

We expect the samples to come from same distribution

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Analytical
Verification

We expect the samples to come from same distribution


So, we can perform Pearson’s Goodness of Fit Test

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Analytical
Verification

We expect the samples to come from same distribution


So, we can perform Pearson’s Goodness of Fit Test
For each sample from different distributions, we compute the
sign statistics

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Analytical
Verification

We expect the samples to come from same distribution


So, we can perform Pearson’s Goodness of Fit Test
For each sample from different distributions, we compute the
sign statistics
Then, we test the hypothesis that the sample of R sign
statistics have come from Binomial distribution with
parameters k and 0.5

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Analytical
Verification

We expect the samples to come from same distribution


So, we can perform Pearson’s Goodness of Fit Test
For each sample from different distributions, we compute the
sign statistics
Then, we test the hypothesis that the sample of R sign
statistics have come from Binomial distribution with
parameters k and 0.5
We repeat the same for all distribution

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Analytical
Verification

We expect the samples to come from same distribution


So, we can perform Pearson’s Goodness of Fit Test
For each sample from different distributions, we compute the
sign statistics
Then, we test the hypothesis that the sample of R sign
statistics have come from Binomial distribution with
parameters k and 0.5
We repeat the same for all distribution
Then, we repeat for different choices of sample size

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Analytical
Verification

We expect the samples to come from same distribution


So, we can perform Pearson’s Goodness of Fit Test
For each sample from different distributions, we compute the
sign statistics
Then, we test the hypothesis that the sample of R sign
statistics have come from Binomial distribution with
parameters k and 0.5
We repeat the same for all distribution
Then, we repeat for different choices of sample size
All the hypotheses are accepted

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test Statistic Distribution Free: Analytical
Verification

We expect the samples to come from same distribution


So, we can perform Pearson’s Goodness of Fit Test
For each sample from different distributions, we compute the
sign statistics
Then, we test the hypothesis that the sample of R sign
statistics have come from Binomial distribution with
parameters k and 0.5
We repeat the same for all distribution
Then, we repeat for different choices of sample size
All the hypotheses are accepted
Hence, the underlying distribution has no role in the
distribution of sign statistic

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 1

Sample Size Beta Gamma Log Normal Normal


5 0.3348326 0.6636682 0.2463768 0.8980510
10 0.9450275 0.5397301 0.5627186 0.0284858
15 0.0424788 0.4337831 0.0154923 0.7026487
20 0.1874063 0.6886557 0.8640680 0.7976012

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Verification of Asymptotic Normality of Sign Test
Statistic for Large Samples

For large samples, one uses Normal cut-off points for Sign test

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Verification of Asymptotic Normality of Sign Test
Statistic for Large Samples

For large samples, one uses Normal cut-off points for Sign test
We wish to verify this by simulation study

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Shapiro-Wilk Normality Test

One of the most commonly used test for Normality

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Shapiro-Wilk Normality Test

One of the most commonly used test for Normality


Draw large number (say, R) of samples of fixed sample size
(say, k)

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Shapiro-Wilk Normality Test

One of the most commonly used test for Normality


Draw large number (say, R) of samples of fixed sample size
(say, k)
Samples may come from distributions under H0 , or may not be

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Shapiro-Wilk Normality Test

One of the most commonly used test for Normality


Draw large number (say, R) of samples of fixed sample size
(say, k)
Samples may come from distributions under H0 , or may not be
Generate R sign statistics from these samples and perform the
test

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Shapiro-Wilk Normality Test

One of the most commonly used test for Normality


Draw large number (say, R) of samples of fixed sample size
(say, k)
Samples may come from distributions under H0 , or may not be
Generate R sign statistics from these samples and perform the
test
Low p-value rejects the null hypothesis of Normality

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 2
Situation pValue
H0 True Median = Theta_0 1.89113914884773e-15
H1 True Median > Theta_0 3.32390703175591e-24
H2 True Median < Theta_0 1.14623343298736e-24
H3 True Median != Theta_0 1.94129280273761e-15
Justification

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 2
Situation pValue
H0 True Median = Theta_0 1.89113914884773e-15
H1 True Median > Theta_0 3.32390703175591e-24
H2 True Median < Theta_0 1.14623343298736e-24
H3 True Median != Theta_0 1.94129280273761e-15
Justification

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 2
Situation pValue
H0 True Median = Theta_0 1.89113914884773e-15
H1 True Median > Theta_0 3.32390703175591e-24
H2 True Median < Theta_0 1.14623343298736e-24
H3 True Median != Theta_0 1.94129280273761e-15
Justification
Clearly, it was shocking to see the rejection with such a low
p-value

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 2
Situation pValue
H0 True Median = Theta_0 1.89113914884773e-15
H1 True Median > Theta_0 3.32390703175591e-24
H2 True Median < Theta_0 1.14623343298736e-24
H3 True Median != Theta_0 1.94129280273761e-15
Justification
Clearly, it was shocking to see the rejection with such a low
p-value

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 2
Situation pValue
H0 True Median = Theta_0 1.89113914884773e-15
H1 True Median > Theta_0 3.32390703175591e-24
H2 True Median < Theta_0 1.14623343298736e-24
H3 True Median != Theta_0 1.94129280273761e-15
Justification
Clearly, it was shocking to see the rejection with such a low
p-value
Even more, as here we have used the sample size as 50

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 2
Situation pValue
H0 True Median = Theta_0 1.89113914884773e-15
H1 True Median > Theta_0 3.32390703175591e-24
H2 True Median < Theta_0 1.14623343298736e-24
H3 True Median != Theta_0 1.94129280273761e-15
Justification
Clearly, it was shocking to see the rejection with such a low
p-value
Even more, as here we have used the sample size as 50

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 2
Situation pValue
H0 True Median = Theta_0 1.89113914884773e-15
H1 True Median > Theta_0 3.32390703175591e-24
H2 True Median < Theta_0 1.14623343298736e-24
H3 True Median != Theta_0 1.94129280273761e-15
Justification
Clearly, it was shocking to see the rejection with such a low
p-value
Even more, as here we have used the sample size as 50
It happens because of the sparseness of the possible values

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 2
Situation pValue
H0 True Median = Theta_0 1.89113914884773e-15
H1 True Median > Theta_0 3.32390703175591e-24
H2 True Median < Theta_0 1.14623343298736e-24
H3 True Median != Theta_0 1.94129280273761e-15
Justification
Clearly, it was shocking to see the rejection with such a low
p-value
Even more, as here we have used the sample size as 50
It happens because of the sparseness of the possible values

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 2
Situation pValue
H0 True Median = Theta_0 1.89113914884773e-15
H1 True Median > Theta_0 3.32390703175591e-24
H2 True Median < Theta_0 1.14623343298736e-24
H3 True Median != Theta_0 1.94129280273761e-15
Justification
Clearly, it was shocking to see the rejection with such a low
p-value
Even more, as here we have used the sample size as 50
It happens because of the sparseness of the possible values
Based on a sample of size k, sign statistic can take only the
non-negative integer values not greater than k

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 2
Situation pValue
H0 True Median = Theta_0 1.89113914884773e-15
H1 True Median > Theta_0 3.32390703175591e-24
H2 True Median < Theta_0 1.14623343298736e-24
H3 True Median != Theta_0 1.94129280273761e-15
Justification
Clearly, it was shocking to see the rejection with such a low
p-value
Even more, as here we have used the sample size as 50
It happens because of the sparseness of the possible values
Based on a sample of size k, sign statistic can take only the
non-negative integer values not greater than k

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 2
Situation pValue
H0 True Median = Theta_0 1.89113914884773e-15
H1 True Median > Theta_0 3.32390703175591e-24
H2 True Median < Theta_0 1.14623343298736e-24
H3 True Median != Theta_0 1.94129280273761e-15
Justification
Clearly, it was shocking to see the rejection with such a low
p-value
Even more, as here we have used the sample size as 50
It happens because of the sparseness of the possible values
Based on a sample of size k, sign statistic can take only the
non-negative integer values not greater than k
On the other hand, a normal sample could possibly take any
value in this range

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 2
Situation pValue
H0 True Median = Theta_0 1.89113914884773e-15
H1 True Median > Theta_0 3.32390703175591e-24
H2 True Median < Theta_0 1.14623343298736e-24
H3 True Median != Theta_0 1.94129280273761e-15
Justification
Clearly, it was shocking to see the rejection with such a low
p-value
Even more, as here we have used the sample size as 50
It happens because of the sparseness of the possible values
Based on a sample of size k, sign statistic can take only the
non-negative integer values not greater than k
On the other hand, a normal sample could possibly take any
value in this range

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 2
Situation pValue
H0 True Median = Theta_0 1.89113914884773e-15
H1 True Median > Theta_0 3.32390703175591e-24
H2 True Median < Theta_0 1.14623343298736e-24
H3 True Median != Theta_0 1.94129280273761e-15
Justification
Clearly, it was shocking to see the rejection with such a low
p-value
Even more, as here we have used the sample size as 50
It happens because of the sparseness of the possible values
Based on a sample of size k, sign statistic can take only the
non-negative integer values not greater than k
On the other hand, a normal sample could possibly take any
value in this range
So, the sensitive parametric rejects the hypothesis
Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Graphical Verification

We now seek to find some justification graphically

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed
We Plot the frequency distribution of this sample

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed
We Plot the frequency distribution of this sample
We superimpose the expected Normal density

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed
We Plot the frequency distribution of this sample
We superimpose the expected Normal density
Repeat for different choices of k

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed
We Plot the frequency distribution of this sample
We superimpose the expected Normal density
Repeat for different choices of k
Close similarity indicates in favour of asymptotic normality

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed
We Plot the frequency distribution of this sample
We superimpose the expected Normal density
Repeat for different choices of k
Close similarity indicates in favour of asymptotic normality
Also, empirical distribution functions match closely with
expected Normal CDF

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Sign Test Statistic:
Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed
We Plot the frequency distribution of this sample
We superimpose the expected Normal density
Repeat for different choices of k
Close similarity indicates in favour of asymptotic normality
Also, empirical distribution functions match closely with
expected Normal CDF
So, one can use normality approximation for moderate (10
onwards) sample sizes

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 5

Sample Size 5 Empirical CDF and Normal CDF

1.0
0.30

0.8
0.25
0.20
Relative Frequency

0.6
Fn(x)
0.15

0.4
0.10

0.2
0.05
0.00

0.0

0 1 2 3 4 5 −3 −2 −1 0 1 2 3

Sign Statistic x
Plot of Standardized Observations

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 6

0.25 Sample Size 10 Empirical CDF and Normal CDF

1.0
0.20

0.8
Relative Frequency

0.15

0.6
Fn(x)
0.10

0.4
0.05

0.2
0.00

0.0

0 1 2 3 4 5 6 7 8 9 10 −4 −2 0 2 4

Sign Statistic x
Plot of Standardized Observations

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 7

0.20 Sample Size 15 Empirical CDF and Normal CDF

1.0
0.8
0.15
Relative Frequency

0.6
0.10

Fn(x)

0.4
0.05

0.2
0.00

0.0

1 2 3 4 5 6 7 8 9 11 13 15 −4 −2 0 2 4

Sign Statistic x
Plot of Standardized Observations

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 8

Sample Size 20 Empirical CDF and Normal CDF

1.0
0.15

0.8
Relative Frequency

0.6
0.10

Fn(x)

0.4
0.05

0.2
0.00

0.0

1 3 5 7 9 11 13 15 17 −4 −2 0 2 4

Sign Statistic x
Plot of Standardized Observations

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Power Function

We now calculate the power function of Sign Test

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Power Function

We now calculate the power function of Sign Test


Given a sample size k, we generate R samples from a known
distribution

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Power Function

We now calculate the power function of Sign Test


Given a sample size k, we generate R samples from a known
distribution
Then, we select some other number in close neighbourhood as
an alternative of θ0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Power Function

We now calculate the power function of Sign Test


Given a sample size k, we generate R samples from a known
distribution
Then, we select some other number in close neighbourhood as
an alternative of θ0
We compute values of sign statistic based on this value

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Power Function

We now calculate the power function of Sign Test


Given a sample size k, we generate R samples from a known
distribution
Then, we select some other number in close neighbourhood as
an alternative of θ0
We compute values of sign statistic based on this value
We check the p-value of the observed value of the statistic

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Power Function

We now calculate the power function of Sign Test


Given a sample size k, we generate R samples from a known
distribution
Then, we select some other number in close neighbourhood as
an alternative of θ0
We compute values of sign statistic based on this value
We check the p-value of the observed value of the statistic
Proportion of cases of rejection gives the simulated power
function

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Sign Test: Power Function

We now calculate the power function of Sign Test


Given a sample size k, we generate R samples from a known
distribution
Then, we select some other number in close neighbourhood as
an alternative of θ0
We compute values of sign statistic based on this value
We check the p-value of the observed value of the statistic
Proportion of cases of rejection gives the simulated power
function
Repeat this process for different sample sizes

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 9

1.0
0.8
0.6 Sign Test Power Curves for Different Sample Sizes
Power

Sample Size 10
Sample Size 20
0.4

Sample Size 30
0.2
0.0

0 1 2 3 4 5

True Median
Exponential Distribution with Parameters 1

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Assumptions

(X1 , X2 , . . . , Xn ) is a random sample from a location family


with distribution function F (x − θ)

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Assumptions

(X1 , X2 , . . . , Xn ) is a random sample from a location family


with distribution function F (x − θ)
F ∈ Ωs = {F ∈ Ω0 , F (x ) = F (−x )}

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Assumptions

(X1 , X2 , . . . , Xn ) is a random sample from a location family


with distribution function F (x − θ)
F ∈ Ωs = {F ∈ Ω0 , F (x ) = F (−x )}
Ω0 = {F : F is absolutely continuous, F (0) = 21 }

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Assumptions

(X1 , X2 , . . . , Xn ) is a random sample from a location family


with distribution function F (x − θ)
F ∈ Ωs = {F ∈ Ω0 , F (x ) = F (−x )}
Ω0 = {F : F is absolutely continuous, F (0) = 21 }
Here, we assume that the underlying distribution is symmetric
about its median

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Testing Problem

We wish test whether the population median is some specified


constant θ0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Testing Problem

We wish test whether the population median is some specified


constant θ0
Null Hypothesis H0 : θ = θ0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Testing Problem

We wish test whether the population median is some specified


constant θ0
Null Hypothesis H0 : θ = θ0
Alternative Hypotheses

H1 : θ > θ 0
H2 : θ < θ 0
H3 : θ 6= θ0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Test Statistic

Let Yi = Xi − θ0 , i = 1(1)n

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Test Statistic

Let Yi = Xi − θ0 , i = 1(1)n
Define Rj = Rank(| Yj |), j = 1(1)n

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Test Statistic

Let Yi = Xi − θ0 , i = 1(1)n
Define Rj = Rank(| Yj |), j = 1(1)n
Let T = ni=1 Rj I(Yi > 0)
P

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Test Statistic

Let Yi = Xi − θ0 , i = 1(1)n
Define Rj = Rank(| Yj |), j = 1(1)n
Let T = ni=1 Rj I(Yi > 0)
P

T is the Wilcoxon Signed Rank Statistic

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Testing Rule

Under H1 , more observations will tend to be greater than θ0


and will have higher ranks

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Testing Rule

Under H1 , more observations will tend to be greater than θ0


and will have higher ranks
So, we reject H0 in favour of H1 for large values of T

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Testing Rule

Under H1 , more observations will tend to be greater than θ0


and will have higher ranks
So, we reject H0 in favour of H1 for large values of T
On the other hand, observations will tend to be lesser than θ0
under H2

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Testing Rule

Under H1 , more observations will tend to be greater than θ0


and will have higher ranks
So, we reject H0 in favour of H1 for large values of T
On the other hand, observations will tend to be lesser than θ0
under H2
So, we reject H0 in favour of H2 for small values of T

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Testing Rule

Under H1 , more observations will tend to be greater than θ0


and will have higher ranks
So, we reject H0 in favour of H1 for large values of T
On the other hand, observations will tend to be lesser than θ0
under H2
So, we reject H0 in favour of H2 for small values of T
Combining these two cases, we reject H0 in favour of H3 if T is
too large or too small

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Null Distribution of
test Statistic

T can be expressed as nj=1 jWj , where {Wj }nj=1 are i.i.d.


P

Ber ( 21 ) random variables under the null hypothesis

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Null Distribution of
test Statistic

T can be expressed as nj=1 jWj , where {Wj }nj=1 are i.i.d.


P

Ber ( 21 ) random variables under the null hypothesis


Wj = I(| X |(j) corresponds to a positive observation)

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Null Distribution of
test Statistic

T can be expressed as nj=1 jWj , where {Wj }nj=1 are i.i.d.


P

Ber ( 21 ) random variables under the null hypothesis


Wj = I(| X |(j) corresponds to a positive observation)
Thus, T is distribution free under H0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Null Distribution of
test Statistic

T can be expressed as nj=1 jWj , where {Wj }nj=1 are i.i.d.


P

Ber ( 21 ) random variables under the null hypothesis


Wj = I(| X |(j) corresponds to a positive observation)
Thus, T is distribution free under H0
For small sample sizes, cut-off points of exact distribution are
used to determine the critical region

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Null Distribution of
test Statistic

T can be expressed as nj=1 jWj , where {Wj }nj=1 are i.i.d.


P

Ber ( 21 ) random variables under the null hypothesis


Wj = I(| X |(j) corresponds to a positive observation)
Thus, T is distribution free under H0
For small sample sizes, cut-off points of exact distribution are
used to determine the critical region
If n is large, one can use cut-off points of Normal distribution

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Implementation

In some of the latter sections, we will use wilcox.test function


from stats package

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Verification of Distribution Free Property of
Wilcoxon Signed Rank Test Statistic under the Null
Hypothesis

We have already stated that T is a distribution free statistic


under H0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Verification of Distribution Free Property of
Wilcoxon Signed Rank Test Statistic under the Null
Hypothesis

We have already stated that T is a distribution free statistic


under H0
We wish to verify this by means of simulation study

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Verification of Distribution Free Property of
Wilcoxon Signed Rank Test Statistic under the Null
Hypothesis

We have already stated that T is a distribution free statistic


under H0
We wish to verify this by means of simulation study
We will do that by both graphical methods and formal tests

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test Statistic Distribution
Free: Graphical Verification

First, we draw a large number (say, R) of samples of fixed


sample size (say, k) from different symmetric continuous
distributions (say, Cauchy, Normal, t, Uniform)

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test Statistic Distribution
Free: Graphical Verification

First, we draw a large number (say, R) of samples of fixed


sample size (say, k) from different symmetric continuous
distributions (say, Cauchy, Normal, t, Uniform)
We compute the test statistic for all the samples

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test Statistic Distribution
Free: Graphical Verification

First, we draw a large number (say, R) of samples of fixed


sample size (say, k) from different symmetric continuous
distributions (say, Cauchy, Normal, t, Uniform)
We compute the test statistic for all the samples
Under distribution free property, the frequency distribution of
these R Sign statistics for each distribution will be identical

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test Statistic Distribution
Free: Graphical Verification

First, we draw a large number (say, R) of samples of fixed


sample size (say, k) from different symmetric continuous
distributions (say, Cauchy, Normal, t, Uniform)
We compute the test statistic for all the samples
Under distribution free property, the frequency distribution of
these R Sign statistics for each distribution will be identical
So, we plot the column diagrams, and expect those to be more
or less same

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test Statistic Distribution
Free: Graphical Verification

First, we draw a large number (say, R) of samples of fixed


sample size (say, k) from different symmetric continuous
distributions (say, Cauchy, Normal, t, Uniform)
We compute the test statistic for all the samples
Under distribution free property, the frequency distribution of
these R Sign statistics for each distribution will be identical
So, we plot the column diagrams, and expect those to be more
or less same
We repeat this process for different choices of k

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 10

Sample Size 10

Cauchy
Normal
t
Uniform
0.03
Relative Frequency

0.02
0.01
0.00

2.5 7.5 12 18 22 28 32 38 42 48 52

Wilcoxon Signed Rank Statistic

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 11

Sample Size 15

Cauchy
0.020

Normal
t
Uniform
0.015
Relative Frequency

0.010
0.005
0.000

2.5 12 18 22 28 32 38 42 48 52 58 62 68 72 78 82 88 92 98 110 120

Wilcoxon Signed Rank Statistic

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 12

0.014 Sample Size 20

Cauchy
Normal
t
0.012

Uniform
0.010
Relative Frequency

0.008
0.006
0.004
0.002
0.000

5 15 25 35 45 55 65 75 85 95 100 120 140 160 180 200

Wilcoxon Signed Rank Statistic

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 13

0.010 Sample Size 25

Cauchy
Normal
t
Uniform
0.008
Relative Frequency

0.006
0.004
0.002
0.000

30 50 70 90 110 130 150 170 190 210 230 250 270 290

Wilcoxon Signed Rank Statistic

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test Statistic Distribution
Free: Analytical Verification

We expect the samples of test statistic based on different


underlying distributions to come from same distribution

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test Statistic Distribution
Free: Analytical Verification

We expect the samples of test statistic based on different


underlying distributions to come from same distribution
So, probability of rejecting H0 must be same for all of those

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test Statistic Distribution
Free: Analytical Verification

We expect the samples of test statistic based on different


underlying distributions to come from same distribution
So, probability of rejecting H0 must be same for all of those
We find out the probability of rejection for different choices of
level of significance

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test Statistic Distribution
Free: Analytical Verification

We expect the samples of test statistic based on different


underlying distributions to come from same distribution
So, probability of rejecting H0 must be same for all of those
We find out the probability of rejection for different choices of
level of significance
We can say that the underlying distribution has no role

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test Statistic Distribution
Free: Analytical Verification

We expect the samples of test statistic based on different


underlying distributions to come from same distribution
So, probability of rejecting H0 must be same for all of those
We find out the probability of rejection for different choices of
level of significance
We can say that the underlying distribution has no role
Provided they match for all such choices, and also for different
sample sizes

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 3

## Level of Significance = 0.01


Sample Size Cauchy Normal t Uniform
10 0.0113 0.0091 0.0107 0.0088
15 0.0085 0.0083 0.0071 0.0075
20 0.0098 0.0111 0.0106 0.0089
25 0.0085 0.0102 0.0086 0.0086

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 4

## Level of Significance = 0.05


Sample Size Cauchy Normal t Uniform
10 0.0435 0.0454 0.0513 0.0477
15 0.0503 0.0465 0.0501 0.0484
20 0.0470 0.0466 0.0464 0.0507
25 0.0465 0.0489 0.0498 0.0510

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 5

## Level of Significance = 0.1


Sample Size Cauchy Normal t Uniform
10 0.0857 0.0864 0.0893 0.0824
15 0.0954 0.0952 0.0969 0.0962
20 0.0973 0.0983 0.0973 0.0991
25 0.0967 0.0909 0.0946 0.1010

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Verification of Asymptotic Normality of Wilcoxon
Signed Rank Test Statistic for Large Samples

n(n+1)
T−
q 4
∼ AN(0, 1)
n(n+1)(2n+1)
24

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Verification of Asymptotic Normality of Wilcoxon
Signed Rank Test Statistic for Large Samples

n(n+1)
T−
q 4
∼ AN(0, 1)
n(n+1)(2n+1)
24
So, for large samples, one uses Normal cut-off points for
Wilcoxon Signed Rank test

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Verification of Asymptotic Normality of Wilcoxon
Signed Rank Test Statistic for Large Samples

n(n+1)
T−
q 4
∼ AN(0, 1)
n(n+1)(2n+1)
24
So, for large samples, one uses Normal cut-off points for
Wilcoxon Signed Rank test
We wish to verify this by simulation study

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Shapiro-Wilk Normality Test

Draw large number (say, R) of samples of fixed sample size


(say, k)

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Shapiro-Wilk Normality Test

Draw large number (say, R) of samples of fixed sample size


(say, k)
Samples may come from distributions under H0 , or may not be

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Shapiro-Wilk Normality Test

Draw large number (say, R) of samples of fixed sample size


(say, k)
Samples may come from distributions under H0 , or may not be
Generate R sign statistics from these samples and perform the
test

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Shapiro-Wilk Normality Test

Draw large number (say, R) of samples of fixed sample size


(say, k)
Samples may come from distributions under H0 , or may not be
Generate R sign statistics from these samples and perform the
test
Sometimes high p-value rejects the null hypothesis of Normality

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Shapiro-Wilk Normality Test

Draw large number (say, R) of samples of fixed sample size


(say, k)
Samples may come from distributions under H0 , or may not be
Generate R sign statistics from these samples and perform the
test
Sometimes high p-value rejects the null hypothesis of Normality
But very inconsistent p-value in the sense of high fluctuation

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Shapiro-Wilk Normality Test

Draw large number (say, R) of samples of fixed sample size


(say, k)
Samples may come from distributions under H0 , or may not be
Generate R sign statistics from these samples and perform the
test
Sometimes high p-value rejects the null hypothesis of Normality
But very inconsistent p-value in the sense of high fluctuation
Consistent only for very large sample size

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Table 6

Sample Size Replication 1 Replication 2 Replication 3


20 0.0604578 0.1477418 0.0014243
30 0.5633280 0.3140424 0.8130286
40 0.0749628 0.0303223 0.7927796
50 0.0118960 0.3181890 0.7778051
60 0.0281755 0.0840748 0.4462483

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Graphical Verification

We now seek to find some justification graphically

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed
We Plot the frequency distribution of this sample

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed
We Plot the frequency distribution of this sample
We superimpose the expected Normal density

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed
We Plot the frequency distribution of this sample
We superimpose the expected Normal density
Repeat for different choices of k

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed
We Plot the frequency distribution of this sample
We superimpose the expected Normal density
Repeat for different choices of k
Close similarity indicates in favour of asymptotic normality

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed
We Plot the frequency distribution of this sample
We superimpose the expected Normal density
Repeat for different choices of k
Close similarity indicates in favour of asymptotic normality
Also, empirical distribution functions match closely with
expected Normal CDF

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Asymptotic Normality of Wilcoxon Signed Rank
Test Statistic: Graphical Verification

We now seek to find some justification graphically


We draw large number (say, R) of samples of fixed sample
size(say, k)
Based on these, a sample of size R from the distribution of sign
statistic is formed
We Plot the frequency distribution of this sample
We superimpose the expected Normal density
Repeat for different choices of k
Close similarity indicates in favour of asymptotic normality
Also, empirical distribution functions match closely with
expected Normal CDF
So, one can use normality approximation for moderate (10
onwards) sample sizes

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 14

50
40 Q−Q Plot for Sample Size 10
WSRT Quantiles

30
20
10
0

0 20 40 60

Normal Quantiles

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 15

120
100
80 Q−Q Plot for Sample Size 15
WSRT Quantiles

60
40
20
0

0 20 40 60 80 100 120

Normal Quantiles

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 16

200
150 Q−Q Plot for Sample Size 20
WSRT Quantiles

100
50

0 50 100 150 200

Normal Quantiles

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 17

300
250
200 Q−Q Plot for Sample Size 25
WSRT Quantiles

150
100
50

50 100 150 200 250 300

Normal Quantiles

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Power Function

We now calculate the power function of Wilcoxon Signed Rank


Test

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Power Function

We now calculate the power function of Wilcoxon Signed Rank


Test
Given a sample size k, we generate R samples from a known
distribution

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Power Function

We now calculate the power function of Wilcoxon Signed Rank


Test
Given a sample size k, we generate R samples from a known
distribution
Then, we select some other number in close neighbourhood as
an alternative of θ0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Power Function

We now calculate the power function of Wilcoxon Signed Rank


Test
Given a sample size k, we generate R samples from a known
distribution
Then, we select some other number in close neighbourhood as
an alternative of θ0
We compute values of test statistic based on this number and
find the p-value

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Power Function

We now calculate the power function of Wilcoxon Signed Rank


Test
Given a sample size k, we generate R samples from a known
distribution
Then, we select some other number in close neighbourhood as
an alternative of θ0
We compute values of test statistic based on this number and
find the p-value
Find proportion of cases when H0 is rejected

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Wilcoxon Signed Rank Test: Power Function

We now calculate the power function of Wilcoxon Signed Rank


Test
Given a sample size k, we generate R samples from a known
distribution
Then, we select some other number in close neighbourhood as
an alternative of θ0
We compute values of test statistic based on this number and
find the p-value
Find proportion of cases when H0 is rejected
Repeat this process for different sample sizes

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 18

1.0
0.8
0.6 Wilcoxon Signed Rank Test Power Curves for Different Sample Sizes

10
Power

20
30
0.4
0.2

−4 −2 0 2 4

True Median
Logistic Distribution with Parameters 0 and 1

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Parametric Test for One Sample Location Problem

Best known test is the Student’s t-test

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Parametric Test for One Sample Location Problem

Best known test is the Student’s t-test


Designed for samples from Normal distribution

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Parametric Test for One Sample Location Problem

Best known test is the Student’s t-test


Designed for samples from Normal distribution
Performs well for other continuous distributions also

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Parametric Test for One Sample Location Problem

Best known test is the Student’s t-test


Designed for samples from Normal distribution
Performs well for other continuous distributions also
This tests for population mean based on the observed sample
mean

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Parametric Test for One Sample Location Problem

Best known test is the Student’s t-test


Designed for samples from Normal distribution
Performs well for other continuous distributions also
This tests for population mean based on the observed sample
mean
Test statistic: t = x̄s/−µ
√0
n

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Parametric Test for One Sample Location Problem

Best known test is the Student’s t-test


Designed for samples from Normal distribution
Performs well for other continuous distributions also
This tests for population mean based on the observed sample
mean
Test statistic: t = x̄s/−µ
√0
n
Follows tn−1 distribution under H0 : µ = µ0

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Parametric Test for One Sample Location Problem

Best known test is the Student’s t-test


Designed for samples from Normal distribution
Performs well for other continuous distributions also
This tests for population mean based on the observed sample
mean
Test statistic: t = x̄s/−µ
√0
n
Follows tn−1 distribution under H0 : µ = µ0
t.test is implemented in stats package

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Parametric Test for One Sample Location Problem

Best known test is the Student’s t-test


Designed for samples from Normal distribution
Performs well for other continuous distributions also
This tests for population mean based on the observed sample
mean
Test statistic: t = x̄s/−µ
√0
n
Follows tn−1 distribution under H0 : µ = µ0
t.test is implemented in stats package
Power function can be simulated using the same steps as before

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Comparison of Power Curves

We know t-test is uniformly most powerful for Normal testing


problem of population mean among the unbiased tests

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Comparison of Power Curves

We know t-test is uniformly most powerful for Normal testing


problem of population mean among the unbiased tests
So, we can expect it to perform better than the other two tests

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Comparison of Power Curves

We know t-test is uniformly most powerful for Normal testing


problem of population mean among the unbiased tests
So, we can expect it to perform better than the other two tests
On the other hand, for samples from Logistic distribution, we
expect Wilcoxon Signed Rank test to the best best among the
trio

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Comparison of Power Curves

We know t-test is uniformly most powerful for Normal testing


problem of population mean among the unbiased tests
So, we can expect it to perform better than the other two tests
On the other hand, for samples from Logistic distribution, we
expect Wilcoxon Signed Rank test to the best best among the
trio
That’s because this is symmetric about median and does not
satisfy the normality assumption for t-test

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Comparison of Power Curves

We know t-test is uniformly most powerful for Normal testing


problem of population mean among the unbiased tests
So, we can expect it to perform better than the other two tests
On the other hand, for samples from Logistic distribution, we
expect Wilcoxon Signed Rank test to the best best among the
trio
That’s because this is symmetric about median and does not
satisfy the normality assumption for t-test
In both cases, Sign test is expected to perform not as good as
the others

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Comparison of Power Curves

We know t-test is uniformly most powerful for Normal testing


problem of population mean among the unbiased tests
So, we can expect it to perform better than the other two tests
On the other hand, for samples from Logistic distribution, we
expect Wilcoxon Signed Rank test to the best best among the
trio
That’s because this is symmetric about median and does not
satisfy the normality assumption for t-test
In both cases, Sign test is expected to perform not as good as
the others
However, if we consider Exponential distribution, which is
neither symmetric nor Normal (obviously!), Sign test should
perform better

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 19

1.0
0.8
0.6 Comaprison with Parametric Test

t
Power

Sign
Signed Rank
0.4
0.2
0.0

−4 −2 0 2 4

True Median
Normal Distribution with Parameters 0 and 1

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 20

1.0
0.8
0.6 Comaprison with Parametric Test

t
Power

Sign
Signed Rank
0.4
0.2
0.0

−4 −2 0 2 4

True Median
Logistic Distribution with Parameters 0 and 1

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Graph 21

1.0
0.8
0.6 Comaprison with Parametric Test

t
Power

Sign
Signed Rank
0.4
0.2
0.0

−4 −2 0 2 4

True Median
Exponential Distribution with Parameter 1

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Summary

We have successfully verified distribution free properties of


both the test statistics

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Summary

We have successfully verified distribution free properties of


both the test statistics
We also graphically verified their asymptotic behaviours

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem
Summary

We have successfully verified distribution free properties of


both the test statistics
We also graphically verified their asymptotic behaviours
The estimated power curves also confirm our intuitions based
on the theoretical assumptions

Anirban Ray, Mriganka Aulia Non-Parametric Tests for One Sample Location Problem

You might also like