0% found this document useful (0 votes)
8 views6 pages

Sign Test: Nonparametric Method Guide

Uploaded by

Dawsar Abdelhadi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views6 pages

Sign Test: Nonparametric Method Guide

Uploaded by

Dawsar Abdelhadi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

COMM 207

Tutorial
Nonparametric methods: The Sign Test

The Sign Test: The General Idea

- Used when we cannot assume that the population is normally distributed (small sample size
(that is, n<10 ); skewed data)

- A hypothesis test about the population median ( M d ), instead of the population mean ( μ ¿
- The population median: 50% of the population values are less than or equal to M d ; 50%
of the population values are greater than or equal to M d .

- Uses the binomial distribution, not the normal distribution. No table necessary. Time for some
COMM 104 review!

- Properties of a binomial random variable X:


- X = # successes in n trials
- Our sample data (our n trials) fall into two categories: success and failure.
- We have n independent trials
- We have n identical trials
- Each trial has an equal probability of success (e.g., each sample value has the same
probability, 0.5, of being greater than or equal to M d ).

- To declare a binomial random variable: X ~ Bin(n, p)


- This is read as “X has a binomial distribution with n trials and probability of success p”
- For a Sign Test, p=0.5, because we’re interested in a probability related to the
population median, M d . The median is the 50% “dividing point” – half of the observations
should be less than or equal to this value, and half of them should be greater than or equal to this
value.

- To calculate a binomial probability by hand:

()
P ( X=x ) = n p ( 1− p )
x
x n−x

where
- x is the desired number of successes
- p is the probability of success on each trial (remember this is 0.5 for us!)
- n is the number of trials (i.e., the sample size)

Be careful: it’s “n choose x”, not “n divided by x” . The button on your calculator is nCr.

- To calculate a binomial probability using Excel:


=[Link](x, n, p, cumulative)

where
- x is the desired number of successes
- p is the probability of success on each trial (remember this is 0.5 for us!)
- n is the number of trials (i.e., the sample size)
- cumulative is either “true” (if you want to calculate P(X <= x)) or false (if you want to
calculate P(X=x)).

Common question: I still don’t understand – what does “cumulative” mean, and when do I set it
to “true” versus “false”?

Answer: In English, the word “cumulative” should remind you of the word “accumulate”, which
means “to add up”. In Excel, we set “cumulative” to “true” if we want to add probabilities up.

For example, say you have X ~ Bin(3, 0.5), and you want to calculate P( X ≤ 2).

You know that since X is counting the number of successes in 3 trials, X could take any of the
following values: 0, 1, 2, 3 (because we could have 0 successes in those 3 trials, or 1 success, or
2 successes, or 3 successes).

If we want the probability that X takes a value less than or equal to 2, then we want to know the
probability that X is 0, 1, or 2.

By hand, you know P( X ≤ 2)=P(X =0)+ P(X =1)+ P( X=2)

You’re adding up probabilities! You’re accumulating something – this is cumulative.

That means to find P( X ≤ 2)in Excel, you would use: =[Link](2, 3, 0.5, true)

Now let’s say you only want to know P ( X=2 ) .That is, you’re not accumulating anything –
you’re not adding probabilities – you only want to know one specific probability: the probability
that there are 2 successes in those 3 trials.

To find P( X=2) in Excel you would use: =[Link](2, 3, 0.5, false)

To conclude:

Use =[Link](x, n, 0.5, false) if you want to calculate P( X=x) .


Use =[Link](x, n, 0.5, true) if you want to calculate P( X ≤ x).
Common question: What if I want to use the formula, instead of using Excel, to calculate
P( X=2) and P( X ≤ 2)?

Answer: Recall X~Bin(3, 0.5), so n=3 and p=0.5.

x()x

2
2
()
P ( X=x ) = n p ( 1− p ) P ( X=2 )= 3 0.5 ( 1−0.5 )
n−x 3−2

ASIDE

Recall: It’s (n choose x), not (n divided by x)! Remember how the choose function works? We’re
finding the number of ways to select x unique elements from a set of n unique elements. In our
case, that means we’re finding the number of ways to get 2 successes from a set of 3 trials.

If we were to list them out, using “S” for success and “F” for failure, we could see:

SSF
SFS
FSS

There are three possible ways to get 2 successes in a set of 3 trials. Mathematically, the way we
solve this by hand is:

n × ( n−1 ) ×… × 1
()
n= n!
=
x ( n−x ) ! x ! [ ( n−x ) × ( n−x−1 ) × …× 1 ] (x × ( x−1 ) × … ×1)
Well that looks messy. It’s actually not too bad once you see that “!” means “factorial” which
means “multiply the number by every natural number less than it, all the way down to 1”. So, for
example, 5! = 5x4x3x2x1 = 120. Let’s see that in action with our successes and failures (recall 1!
= 1, and 0! = 1 by definition):

(32)= ( 3−2) ! 2 ! =
3! 3 ×2 ×1 3× 2 ×1 3
= = =3On your TI-30XIIB scientific calculator, if you have
1 ! 2! 1(2× 1) 1
one, try entering this: 3 PRB > nCr = 2 =
On your Sharp EL-531XG scientific calculator, if you have one, try entering this: 3 2ndF 5 2 =

Common question: Do I need a scientific calculator? Don’t I always have access to Excel?
Answer: If you are taking this course online, you do not need a scientific calculator, because
yes, you always have access to Excel.

END ASIDE

P ( X=2 )=3 ( 0.52 ) ( 1−0.5 ) P ( X=2 )=3 ( 0.52 ) ( 0.5 ) P ( X=2 )=3 ( 0.53 ) P ( X=2 )=0.375
Common question : Do I really need to show that many steps?

Answer: No. As usual, show me three things: 1) The equation you use; 2) How you plug in; 3)
Your final answer. Here, that would look like this:
()
x
x

2 ()
P ( X=x ) = n p ( 1− p ) P ( X=2 )= 3 0.5 ( 1−0.5 ) P ( X=2 )=0.375
n−x 2 3−2

Now for P( X ≤ 2):

P ( X ≤2 )=P ( X=0 )+ P ( X=1 ) + P ( X=2 )

()0
0
()
1
1
()
P ( X ≤2 )= 3 0.5 ( 1−0.5 ) + 3 0.5 ( 1−0.5 ) + 3 0.5 ( 1−0.5 )
3−0 3−1

2
2 3−2

P ( X ≤2 )=0.125+0.375+ 0.375 P ( X ≤2 )=0.875 Common question: Do I need to show line 3


(that is, do I need to show 0.125 + 0.375 + 0.375)?

Answer: Yes, if you were asked in the question to show each calculated probability; no, if you
were not. Please read the question carefully.

Common question: Why is it called “The Sign Test”?

Answer: This was answered in the required reading; basically, it’s based on an old way of
collecting data in marketing. They used to record -1 and +1 – that is, “failure” if the customer did
not like the product, “success” if they did. Please refer to the required reading for more
information.
Steps for The Sign Test

If you need a > sign in Ha, the steps are:

1. State the null and alternative hypotheses: H 0 : M d ≤ value ; H a : M d >value

2. Calculate the test statistic: S = #observations in the sample that are greater than value

3. Calculate the p-value. Assume X ~ Bin(n, 0.5). P-value = P( X ≥ S)

4. If the p-value is less than the significance level, reject H0.

5. Conclude in the context of the original question.

If you need a ≠ sign in Ha, the steps are:

1. State the null and alternative hypotheses: H 0 : M d=value ; H a : M d ≠ value

2. Calculate the test statistic: S = max(#obs less than value , #obs greater than value)

3. Calculate the p-value. Assume X ~ Bin(n, 0.5). P-value = 2 P( X ≥ S)

4. If the p-value is less than the significance level, reject H0.

5. Conclude in the context of the original question.

We will not cover the case of < in Ha in this course, as it is unintuitive.

Example 1:

a) A company that makes light bulbs advertises that their bulbs last more than 300,000 hours. A
rival company sincerely doubts this claim, and runs tests to see whether this is true. They obtain
the following data:

50000, 100000, 350000, 299000, 400000, 200000

Conduct an appropriate hypothesis test.

b) Consider the data and scenario from part a), but now suppose the goal is simply to determine
whether the median lifetime of the bulbs is different from 300,000 hours. Conduct an appropriate
hypothesis test.

Example 2:

a) Consider the following sample of 7 chemical yields in grams per hour:


801, 814, 784, 720, 730, 752, 751

Use this sample to test whether the median chemical yield is greater than 750 grams per hour.
Round the p-value to 4 decimal places.

b) Consider again the data from part a), and test whether the median chemical yield is different
from 750 grams per hour. Round the p-value to 4 decimal places.

You might also like