Nothing Special   »   [go: up one dir, main page]

Non Parametric Tests

Download as pdf or txt
Download as pdf or txt
You are on page 1of 43

PPH 707

PARAMETRIC AND NON PARAMETRIC TESTS

Dr Nicholas Tendongfor
Department of Public Health and Hygiene
Definition
Parametric statistical tests assume that:
• The observations are independent (except when paired),
• The data are randomly drawn from the normally distributed
population of values,
• It provides generalizations for making statements about the
mean of the parent population.
• The test assume that there is the normal distribution of
variable and the mean in known or assumed to be known.
• It is assumed that the variables of interest, in the population
are measured on an interval scale.
• It uses direct observations from the field
Definition
Nonparametric Test
• The nonparametric test is defined as the hypothesis test which is not based
on underlying assumptions, i.e. it does not require population’s distribution

• Also known as the distribution-free test.

• The test is mainly based on differences in medians.

• The test assumes that the variables are measured on a nominal or ordinal
level.

• It is used when the independent variables are non-metric.

• The test is performed using ranks

• NP tests still have assumptions but are less stringent

• NP tests can be applied to Normal data but parametric tests have greater
power if assumptions met
Differences Between Parametric and Nonparametric Tests

• A statistical test, in which specific assumptions are made about


the population parameter is known as the parametric test. A
statistical test used in the case of non-metric independent
variables is called nonparametric test.

• In the parametric test, the test statistic is based on


distribution. On the other hand, the test statistic is arbitrary in
the case of the nonparametric test.

• In the parametric test, it is assumed that the measurement of


variables of interest is done on interval or ratio level. As
opposed to the nonparametric test, wherein the variable of
interest are measured on nominal or ordinal scale.
Differences Between Parametric and Nonparametric Tests

• In general, the measure of central tendency in the


parametric test is mean, while in the case of the
nonparametric test is median.

• In the parametric test, there is complete information


about the population. Conversely, in the nonparametric
test, there is no information about the population.

• For measuring the degree of association between two


quantitative variables, Pearson’s coefficient of
correlation is used in the parametric test, while
spearman’s rank correlation is used in the nonparametric
test.
Equivalent Tests

Parametric Test Non-Parametric Test

Independent Sample t Test Mann-Whitney test

Paired samples t test Wilcoxon signed Rank test

One way Analysis of Variance


Kruskal Wallis Test
(ANOVA)
One way repeated measures
Friedman's ANOVA
Analysis of Variance
Choosing Between Parametric and Nonparametric Tests
Deciding whether to use a parametric or nonparametric test depends
on the normality of the data
• Therefore, the first step in making this decision is to check
normality.

• One option is to perform a simple check based on a histogram or a


Q-Q plot.

• If your histogram is roughly symmetrical, it is safe to assume that


the data is relatively normally distributed, and a parametric test will
be appropriate.

• If the histogram is not symmetrical, then a nonparametric test will


be more appropriate.
Choosing Between Parametric and Nonparametric Tests

• It should be noted that checking normality of data produced by


smaller samples can be difficult.

• This is because with a small sample, the histogram may not be


smooth even if the data are normal. There might not be any
significant evidence of symmetry or asymmetry, which can make it
difficult to determine whether the data are normal or not.

• If data is found to be normal in previous studies using larger


samples, it’s safe to assume your data will be normal as well.

• If Your Data is Not Normal, There Are Steps You Can Take prior to
performing a nonparametric tests e.g transformation of the data.
NON PARAMETRIC TEST
Ranks

• Practical differences between parametric and NP are that NP


methods use the ranks of values rather than the actual values
• E.g.
1, 2, 3, 4, 5, 7, 13, 22, 38, 45 - actual
1, 2, 3, 4, 5, 6, 7, 8, 9, 10 - rank
Parametric Test Procedures

1. Involve Population Parameters (Mean)

2. Have Stringent Assumptions


(Normality)

3. Examples: Z Test, t Test, 2 Test,


F test
Nonparametric Test Procedures

1. Do Not Involve Population Parameters


Example: Probability Distributions, Independence

2. Data Measured on Any Scale (Ratio or


Interval, Ordinal or Nominal)

3. Example: Wilcoxon Rank Sum Test


Popular Nonparametric Tests

1. Sign Test

2. Wilcoxon Rank Sum Test

3. Wilcoxon Signed Rank Test

EPI 809 / Spring 2008


The Sign Test

• The sign test is used to make hypothesis tests about


preferences.
• We use only plus and minus signs to perform these
tests.
• The sign test can be used to perform the following
types of tests:
To determine the preference for one product or item
over another, or to determine whether one outcome
occurs more often than another outcome in categorical
data.
The Large-Sample Case

• If we are testing a hypothesis about preference for categorical


data and n >25, we can use the normal probability distribution
as an approximation to the binomial probability distribution.

• where X is the number of units in the sample that belong to the


outcome referring to p.
EXAMPLE. A developer is interested in developing a farm adjacent to a
residential area. Before granting or denying permission to develop the farm,
the town council took a random sample of 75 adults from adjacent areas and
asked them whether they favor or oppose the creation of the farm. Of these
75 adults, 40 opposed creation of the farm and 30 favoured it, and 5 had no
opinion. Can you conclude that the number of adults in this area who oppose
the creation of the farm is higher than the number who favor it? Use  = .01.

Step 1. State the null and alternative hypotheses.


H0: p= .50 and q = .50 (The two proportions are equal)
H1: p > .50 or p > q (The proportion of adults who oppose the creation of the
farm is greater than the proportion who favor it)

Step 2. Select the distribution to use.


The sample size is n= 70; since only 70 people indicated their preference and
since n > 25), we can use the normal approximation to perform the test.

Step 3. Determine the rejection and non rejection regions.


Step 4. Calculate the value of the test statistic.
Step 5. Make a decision.
Because the observed value of z =1.08 is less than the critical
value of z = 2.33, it falls in the non-rejection region. Hence, we
do not reject H0. Consequently, we conclude that the number of
adults who oppose creation of the farm is not higher than the
number who favour its creation.
The Wilcoxon Signed-Rank Test for Two Dependent Samples

• The Wilcoxon signed-rank test for two dependent (paired) samples


is used to test whether or not the two populations from which these
samples are drawn are identical.

• This test is an alternative to the paired-samples test

The Large-Sample Case


If n 15, we can use the normal distribution to make a test of
hypothesis about the paired differences.
Example
The manufacturer of a cow food additive claims that the use of its additive increases
animal weight. A random sample of 25 mature cows was selected, and these cows
were feed for two weeks without the food additive and then feed for another two
week with the additive.
Then, the weights of each cow were estimated for the cows without and with the
additive. Next, the paired differences were calculated for these 25 cows, where a
paired difference is defined as

Paired difference = weight without additive - weight with additive


The differences were positive for 4 cows, negative for 19 cows, and zero for 2 cows.
First, the absolute values of the paired differences were ranked, and then these ranks
were assigned the signs of the corresponding paired differences.
The sum of the ranks of the positive paired differences was 58, and the sum of the
absolute values of the ranks of the negative paired differences was 218.

Can you conclude that the use of the additive increases the weight of animals? Use
the 1% significance level.
• Step 5. Make a decision.
The observed value of z = 2.43 falls in the rejection region. Hence, we reject
the null hypothesis and conclude that the additive increases animal weight.
Solution
Step 1. State the null and alternative hypotheses.
We are to test whether or not the food additive increases the weight of animals.
H0: MA = MB
H1: MA > MB

Step 2. Select the distribution to use.


We use the Wilcoxon signed-rank test procedure with the normal distribution
approximation.

Step 3. Determine the rejection and non-rejection regions.


The test is right-tailed. The significance level is .01, the critical value of z is 2.33.
Step 4. Calculate the value of the test statistic.
Because the sample size is larger than 15, the test statistic T follows (an
approximate) normal distribution.

Observed Value of z . In a Wilcoxon signed-rank test for two dependent


samples, when the sample size is large (n > 15), the observed value of z for the test
statistic T is calculated as
The Wilcoxon Rank Sum Test for
Two Independent Samples
• In a Wilcoxon rank sum test, we assume that the two populations have identical
shapes but differ only in location, which is measured by the median.
To apply this test, we must be able to rank the given data. Note that the Wilcoxon
rank sum test is almost identical to the Mann-Whitney test.
The Large-Sample Case
If either n1 or n2 or both n1 and n2 are greater than 10, we use the normal
distribution as an approximation to the Wilcoxon rank sum test for two
independent samples.

Observed Value of z In the case of a large sample, the observed value of z is


calculated as.

• Here, the sampling distribution of the test statistic T is approximately


normal with mean µT and standard deviation T. The values of µT and T
are calculated as
The critical value or values of z are obtained from Table IV in Appendix C for
the given significance level.

EXAMPLE A researcher wanted to find out whether job-related stress is lower


for college and university professors than for physicians. She took random
samples of 14 professors and 11 physicians and tested them for job-related
stress. The following data give the stress levels for professors and physicians
on a scale of 1 to 20, where 1 is the lowest level of stress and 20 is the highest.

Using the 1% significance level, can you conclude that the job-related stress
level for professors is lower than that for physicians?
Solution
Step 1. State the null and alternative hypotheses.
• We are to test whether or not professors have lower job-related stress
than physicians.
Physicians = population 1 and
Professors = population 2,
Professors will have a lower stress level if the distribution of population 1 is to
the right of the distribution of population
Thus, we can state the two hypotheses as follows.
• H0: The two population distributions are identical
• H1: The distribution of population 1 is to the right of the distribution of
population 2

Step 2. Select the distribution to use.


Because n1 > 10 and n2 > 10, we use the normal distribution to make this test
as the test statistic T follows an approximately normal distribution.
Step 3. Determine the rejection and nonrejection regions.
The test is right-tailed and  = 0.01. The area to the left of the critical point
under the normal distribution curve is 1 - .01 = .9900. From Table IV in
Appendix C, the critical value of z for .9900 is 2.33.

Step 4. Calculate the value of the test statistic.


• Hence, we calculate the value of the test statistic as follows:

Thus, the observed value of z is 2.49.


Step 5. Make a decision.
Because the observed value of z 2.49 is greater than the critical value of z
2.33, it falls in the rejection region. Hence, we reject H0 and conclude that the
distribution of population 1 is to the right of the distribution of population 2.
Thus, the job-related stress level of physicians is higher than that of
professors. This can also be stated as the job-related stress level of professors
is lower than that of physicians.

Wilcoxon Rank Sum Test for Large Independent Samples When n1 > 10 or n2
> 10 (or both samples are greater than 10), the distribution of T (the sum of
the ranks of the smaller of the two samples) is approximately normal with
mean and standard deviation as follows:
The Kruskal-Wallis Test
The one-way analysis of variance (ANOVA) procedure to test whether or not
the means of three or more populations are all equal.
In the ANOVA procedure we assumed that the populations from which the
samples were drawn were normally distributed with equal variance.

However, if the populations being sampled are not normally distributed, we


can use the Kruskal-Wallis test, also called the Kruskal-Wallis H test.

The only assumption we make is that all populations under consideration


have identical sapes but differ only in location.

In a Kruskal-Wallis test, the null hypothesis is that the population distributions


under consideration are all identical. The alternative hypothesis is that at
least one of the population distributions differs
• To perform the Kruskal-Wallis test, we use the chi-square distribution
• The test statistic in this test is denoted by H, which follows (approximately)
the chi-square distribution.
• The critical value of H is obtained from Table VI in
• Appendix C for the given level of significance and df = k - 1, where k is the
number of populations
• Under consideration. Note that the Kruskal-Wallis test is always right-
tailed.
Observed Value of the Test Statistic H The observed value of the test
statistic H is calculated using the following formula:
• R1 = sum of the ranks for sample 1
• R2 = sum of the ranks for sample 2
• Rk sum of the ranks for sample k

• n1 sample size for sample 1


• n2 sample size for sample 2
• nk = sample size for sample k
• n = n1 + n2+….. +nk

• k = number of samples

The test statistic H measures the extent to which the k samples differ with regard to the
ranks assigned to their data values.
• Basically, H is a measure of the variance of ranks (or of the variance
of the means of ranks) for different samples
• If all k samples have exactly the same mean of ranks, H will have a value
of zero.
• The value of H becomes larger as the difference between the means of
ranks for different samples increases.
• Thus, a larger observed value of H indicates that the distributions of the
given populations do not seem to be identical.
Example: A researcher wanted to find out whether the population
distributions of salaries of computer programmers are identical in three cities,
Boston, San Francisco, and Atlanta. Three different samples—one from each
city—produced the following data on the annual salaries (in thousands
of dollars) of computer programmers.

Using the 2.5% significance level, can you conclude that the population distributions
of salaries for computer programmers in these three cities are all identical?
Step 1. State the null and alternative hypotheses.
Note that the alternative hypothesis states that the population distribution of
at least one city is different from those of the other two cities.
H0: The population distributions of salaries of computer programmers in the
three cities are all identical
H1: The population distributions of salaries of computer programmers in the
three cities are not all identical

Step 2. Select the distribution to use.


The shapes of the population distributions are unknown. We are comparing
three populations.
Hence, we apply the Kruskal-Wallis procedure to perform this test, and we
use the chi-square distribution.

Step 3. Determine the rejection and nonrejection regions.


In this example, =0 .025 and df= k -1= 3 -1= 2
• Hence, from Table VI in Appendix C, the critical value of 2 is 7.378,
Step 4. Calculate the value of the test statistic.
To calculate the observed value of the test statistic H, we first rank the combined data
for all three samples and find the sum of ranks for each sample separately
Step 5. Make a decision.
Because the observed value of H 1.543 is less than the critical value of H 7.378 and it
falls in the nonrejection region, we do not reject the null hypothesis. Consequently, we
conclude that the population distributions of salaries of computer programmers in the
three cities seem to be all identical.

You might also like