You are on page 1of 29

NON

PARAMETRIC TEST
BY; MS. TRIPTA RANI
NON PARAMETRIC TESTS- CONCEPT
◦ Non-parametric tests do not make an assumption about the parameters of the population.
◦ Most of these tests work on the principle of ranking the data: that is, finding the lowest score and giving
it a rank of 1, then finding the next highest score and giving it a rank of 2, and so on.
◦ For instance, while testing the two training methods, say A and B, for determining the superiority of one
over the other, if we do not assume that the scores of the trainees are normally distributed or that the
mean score of all trainees taking method A would be a certain value, then the testing method is known as
a distribution-free or nonparametric method.
◦ In fact, there is a growing use of such tests in situations when the normality assumption is open to doubt.
As a result many distribution-free tests have been developed that do not depend on the shape of the
distribution or deal with the parameters of the underlying population.
IMPORTANT NONPARAMETRIC OR
DISTRIBUTION-FREE TESTS
(i) Test of a hypothesis concerning some single value for the given data (such as one-sample sign test).
(ii) Test of a hypothesis concerning no difference among two or more sets of data (such as two-sample sign
test, Fisher-Irwin test, Rank sum test, etc.).
(iii) Test of a hypothesis of a relationship between variables (such as Rank correlation, Kendall’s coefficient
of concordance and other tests for dependence.
(iv) Test of a hypothesis concerning variation in the given data i.e., test analogous to ANOVA viz., Kruskal-
Wallis test.
(v) Tests of randomness of a sample based on the theory of runs viz., one sample runs test.
(vi) Test of hypothesis to determine if categorical data shows dependency or if two classifications are
independent viz., the chi-square test. The chi-square test can as well be used to make comparison
between theoretical populations and actual data when categories are used.
SIGN TEST
◦ The sign test is one of the easiest parametric tests.
◦ Its name comes from the fact that it is based on the direction of the plus or minus signs of observations in
a sample and not on their numerical magnitudes.
◦ The sign test may be one of the following two types:
◦ One sample sign test
◦ Two sample sign test
One sample sign test
One sample sign test: The one sample sign test is applicable when we sample a continuous symmetrical
population in which case the probability of getting a sample value less than mean is 1/2 and the probability of
getting a sample value greater than mean is also 1/2.

◦ The null hypothesis µ = µH0, alternate µ ≠µH0 (µ >µH0; right tail), (µ <µH0; left tail).
◦ To test the null hypothesis
1. we replace the value of each and every item of the sample with a plus (+) sign if it is greater than µH 0, and with a minus
(–) sign if it is less than µH0.
2. But if the value happens to be equal to µH0, then we simply discard it.
3. After doing this, we test the null hypothesis that these + and – signs are values of a random variable,
having a binomial distribution with p = 1/2*.
◦ For performing one sample sign test when the sample is small, we can use tables of binomial probabilities, but
when sample happens to be large, we use normal approximation to binomial distribution.
Two sample sign test
◦ two sample sign test: The sign test has important applications in problems where we deal with paired
data.
◦ In such problems, each pair of values can be replaced with a plus (+) sign if the first value of the first
sample (say X) is greater than the first value of the second sample (say Y) and we take minus (–) sign if
the first value of X is less than the first value of Y.
◦ In case the two values are equal, the concerning pair is discarded. (In case the two samples are not of
equal size, then some of the values of the larger sample left over after the random pairing will have to be
discarded.)
◦ The testing technique remains the same as started in case of one sample sign test.
Mann whitney U test – 2 independent
samples
◦ This test is used to determine whether two independent samples have been drawn from the same
population.
◦ It uses more information than the sign test or the Fisher-Irwin test.
◦ This test applies under very general conditions and requires only that the populations sampled are
continuous.
◦ However, in practice even the violation of this assumption does not affect the results very much.
◦ SPSS steps: Analyze → Non parametric tests→ 2independent sample
◦ Select both Sunday_BDI and
Wednesday_BDI and shift to test
variable
◦ Select drug variable and shift to
grouping variables
◦ After define groups window is
activated write 1 in group 1 for ecstasy
group and 2 for alcohol
◦ Check the box for Mann-whitney U
◦ Click ok
Output from spss for Mann-whitney U This initial table can be used to ascertain which group had the
Ranks highest scores, which is useful in case we need to interpret a
Mean Sum of significant result.
Drug N Rank Ranks
Sunday_ ecstasy 10 11.95 119.50 This table provides the actual test statistics for the Mann–
BDI alcohol 10 9.05 90.50 Whitney test, the Wilcoxon procedure and the corresponding z-
Total 20 score.
Wednesd ecstasy 10 15.10 151.00 For these data, the Mann–Whitney test is non-significant (two-
ay_BDI alcohol tailed) for the depression scores taken on the Sunday. This
10 5.90 59.00
finding indicates that ecstasy is no more of a depressant, the
Total 20
day after taking it, than alcohol: both groups report comparable
Test Statisticsa levels of depression.
Wednesday_B However, for the midweek measures the results are highly
Sunday_BDI DI significant (p < .001).
Mann-Whitney The value of the mean rankings indicates that the ecstasy group
35.500 4.000 had significantly higher levels of depression midweek than the
U
Wilcoxon W 90.500 59.000 alcohol group.
Z -1.105 -3.484 This conclusion is reached by noting that for the Wednesday
Asymp. Sig. (2- scores, the average rank is higher in the ecstasy users (15.10)
.269 .000 than in the alcohol users (5.90).
tailed)
Exact Sig.
[2*(1-tailed .280b .000b
Sig.)]
Reporting the results
For the Mann–Whitney test, we need to report only the test statistic (which is denoted by U) and its
significance.
• Depression levels in ecstasy users (µ= 17.50) did not differ significantly from alcohol users (µ = 16.00)
the day after the drugs were taken, U = 35.50, z = -1.11
• However, by Wednesday, ecstasy users (µ = 33.50) were significantly more depressed than alcohol
users (µ = 7.50), U = 4.00, z = -3.48, p < .001.
• Important points
• The Mann–Whitney test compare two conditions when different participants take part in each
condition and the resulting data violate any assumption of the independent t-test.
• Look at the row labelled Asymp. Sig. (2-tailed). If the value is less than .05 then the two groups
are significantly different.
• The values of the ranks tell you how the groups differ (the group with the highest scores will have
the highest ranks).
• SPSS provides only the two-tailed significance value; the one-tailed significance is this value
divided by 2.
• Report the U statistic, the corresponding z, and the significance value. Also report the medians.
WILCOXON SIGNED –RANK TEST
◦ This is used in situations in which there are two sets of scores to compare, but these scores come from
the same participants.
◦ Wilcoxon signed rank test is used for that are at least ordinal scaling.
◦ Imagine the experimenter in the previous section was now interested in the change in depression levels,
within people, for each of the two drugs.
◦ We now want to compare the BDI scores on Sunday to those on Wednesday. We still have to use a
nonparametric test because the distributions of scores for both drugs were non-normal on one of the
two days.
◦ The Wilcoxon signed-rank test works in a fairly similar way to the dependent t-test in that it is based on
the differences between scores in the two conditions you’re comparing.
SPSS steps to run the analysis
◦ Analyze→non parametric test→ 2
related samples
◦ Select the variables of pair and drag it to the
column labelled Variable 1 and 2.
◦ Check the box of descriptive and then
continue.
◦ In the main window
check the Wilcoxon box
and click on ok
Output from SPSS for Wilcoxon signed
rank test- table 1
Ranks

N Mean Rank Sum of Ranks ◦ This table tells us the number of negative ranks
BDI Negative (these are people who were more depressed on
0a 0.00 0.00
wednesday Ranks Sunday than on Wednesday) and the number of
for ecstasy - Positive Ranks 8b 4.50 36.00 positive ranks (people who were more depressed
BDI sunday for on Wednesday than on Sunday).
ecstasy Ties 2c
Total 10 ◦ The table shows that for 9 of the 10 participants,
BDI Negative their score on Sunday was greater than on
9d 5.22 47.00
wednesday Ranks
Wednesday, indicating greater depression the
for Alcohol - Positive Ranks 1e 8.00 8.00
BDI sunday for morning after compared to midweek.
Alcohol Ties 0f
Total
◦ Unlike the ecstasy takers there were no tied ranks.
10
a. BDI wednesday for ecstasy < BDI sunday for ecstasy ◦ The table also shows the average number of
b. BDI wednesday for ecstasy > BDI sunday for ecstasy negative and positive ranks and the sum of
positive and negative ranks.
c. BDI wednesday for ecstasy = BDI sunday for ecstasy
◦ Below the table are footnotes that tell us to what
d. BDI wednesday for Alcohol < BDI sunday for Alcohol
the positive and negative ranks relate.
e. BDI wednesday for Alcohol > BDI sunday for Alcohol
f. BDI wednesday for Alcohol = BDI sunday for Alcohol
Output from SPSS for Wilcoxon signed
rank test- table 2
Test Statisticsa ◦ The second table in SPSS Output tells us that the test
statistic is based on the negative ranks, that the z-
score is −2.527 and that this value is significant at p =
.012.

◦ Therefore, because this value is based on the


BDI wednesday for BDI wednesday for
ecstasy - BDI sunday Alcohol - BDI sunday negative ranks, we should conclude that when
for ecstasy for Alcohol taking ecstasy there was a significant increase in
Z -2.527b -1.990c depression from the morning after to midweek.
Asymp. Sig. (2- ◦ If the test statistic had been based on the positive
tailed) .012 .047 ranks then this would have told us that the results
were in the opposite direction (i.e. BDI scores were
a. Wilcoxon Signed Ranks Test
greater the morning after compared to midweek).
b. Based on negative ranks.
◦ Therefore, we can conclude that for ecstasy users
c. Based on positive ranks.
there was a significant increase in depression from
the next day to midweek (z = −2.53, p < .05).
Reporting the results
◦ Important points
◦ The Wilcoxon signed-rank test compares two conditions when the same participants take part in each condition
and the resulting data violate an assumption of the dependent t-test.
◦ Look at the row labelled Asymp. Sig. (2-tailed). If the value is less than .05 then the two groups are
significantly different.
◦ Look at positive and negative ranks (and the footnotes explaining what they mean) to tell you how
the groups differ (the greater number of ranks in a particular direction tells you the direction of the
result).
◦ SPSS provides only the two-tailed significance value. If you want the one-tailed significance just
divide the value by 2.
◦ Report the T statistic, the corresponding z, the significance value. Also report the medians.
The Kruskal–Wallis test (H test)
◦ This test is conducted in a way similar to the U test described above.
◦ This test is used to test the null hypothesis that ‘k’ independent random samples come from identical universes against
the alternative hypothesis that the means of these universes are not equal.
◦ This test is analogous to the one-way analysis of variance, but unlike the latter it does not require the assumption that
the samples come from approximately normal populations or the universes having the same standard deviation.
◦ In this test, like the U test, the data are ranked jointly from low to high or high to low as if they constituted a single
sample. The test statistic is H for this test which is worked out as under:

◦ where n = n1 + n2 + ... + nk and Ri being the sum of the ranks assigned to ni observations in the ith sample.
◦ If the null hypothesis is true that there is no difference between the sample means and each sample has at least five
items*, then the sampling distribution of H can be approximated with a chi-square distribution with (k – 1) degrees of
freedom.
◦ As such we can reject the null hypothesis at a given level of significance if H value calculated, as stated above,
exceeds the concerned table value of chi-square.
SPSS steps to run the Kw analysis
◦ Analyze→ non parametric tests→legacy dialogs→ K
independent samples
◦ Once the dialog box is activated, select the dependent variable from
the list (bowling result) and drag it to the box labelled Test Variable
List.
◦ Next, select the independent variable (the grouping variable), in this
case ball no., and drag it to the box labelled Grouping Variable. When
the grouping variable has been selected the button becomes active
and you should click on it to activate the define range dialog box.
◦ SPSS needs to know the range of numeric codes you assigned to your
groups, and there is a space for you to type the minimum and
maximum code.
◦ In this case the minimum code we used was 1, and the maximum
was 4, so type these numbers into the appropriate spaces. When you
have defined the groups, click on to return to the main dialog box.
◦ The main dialog box also provides options to conduct some tests
similar to the Kruskal–Wallis test (check it).
Output from SPSS for Kruskal wallis test-
table 1&2
Ranks ◦ Table 1 shows the mean ranks of all the categories.
BALL NO. WITH ◦ Table 2 shows test statistic, H, for the Kruskal–Wallis test
EACH Mean
CATEGORY N Rank
(although SPSS labels it chi-square, because of its
BOWLI A 5 10.60 distribution, rather than H), its associated degrees of
NG B 5 13.60 freedom (in this case we had four groups so the degrees of
RESULTS freedom are 4-1, or 3) and the significance.
C 5 6.00
D 5 11.80 ◦ The crucial thing to look at is the significance value, which is
Total 20 .212; because this value is greater than .05 we could
Test Statisticsa,b
conclude that bowler performs equally well with the four
BOWLING bowling balls.
RESULTS
Chi-Square 4.509
df 3
Asymp. Sig. .212
a. Kruskal Wallis Test
b. Grouping Variable: BALL NO.
WITH EACH CATEGORY
McNemer Test
◦ McNemer test is one of the important nonparametric tests often used when the data happen to be nominal
and relate to two related samples.
◦ As such this test is specially useful with before-after measurement of the same subjects.
◦ The experiment is designed for the use of this test in such a way that the subjects initially are divided into
equal groups as to their favourable and unfavourable views about, say, any system (means data should be
in binary/dichotomous form).
◦ After some treatment, the same number of subjects are asked to express their views about the given
system whether they favour it or do not favour it.
◦ Through McNemer test we in fact try to judge the significance of any observed change in views of the
same subjects before and after the treatment by setting up a table in the following form in respect of the
first and second set of responses.
SPSS steps to run the Mcnemar analysis
◦ Analyze→ non parametric
tests→legacy dialogs→ 2 related
samples
◦ Once the dialog box is activated, select both
the variables from the list (pair) and drag
them to the box labelled Test pairs. .
◦ The main dialog box also provides options to
conduct some tests similar to the McNemar
test (check it).
◦ Click Ok.
Output from SPSS for Kruskal wallis test-
table 1& 2 Preference before promotion & Preference
after 1 month of promotion
• Table 1 shows the cross tab for both the variables.
• Table 2 shows test statistic, ꭕ2, for the Mcnemar Preference after 1 month
Preference of promotion
test.
before
• The crucial thing to look at is the significance value, promotion Other Brand X
which is 0.018; because this value is less than .05 we Other 9 25
could conclude that proportion of Brand X has been Brand X 10 6
changed after the promotion.
Test Statisticsa
Preference before
promotion &
Preference after 1
month of promotion
N 50
b
Chi-Square 5.600
Asymp. Sig. .018
a. McNemar Test
b. Continuity Corrected
Spearman’s Rank Correlation
◦ When the data are not available to use in numerical form for doing correlation analysis but when the information is
sufficient to rank the data as first, second, third, and so forth, we quite often use the rank correlation method and
work out the coefficient of rank correlation.
◦ In fact, the rank correlation coefficient is a measure of correlation that exists between the two sets of ranks.
◦ In other words, it is a measure of association that is based on the ranks of the observations and not on the numerical
values of the data. It was developed by famous statistician Charles Spearman in the early 1900s and as such it is also
known as Spearman’s rank correlation coefficient.
◦ For calculating rank correlation coefficient, first of all the actual observations be replaced by their ranks, giving rank 1
to the highest value, rank 2 to the next highest value and following this very order ranks are assigned for all values.
◦ If two or more values happen to be equal, then the average of the ranks which should have been assigned to such
values had they been all different, is taken and the same rank (equal to the said average) is given to concerning
values.
◦ The second step is to record the difference between ranks (or ‘d’) for each pair of observations, then square these
differences to obtain a total of such differences which can symbolically be stated as ∑d2i.
◦ Finally, Spearman’s rank correlation coefficient, r*, is worked out as under:
◦ The value of Spearman’s rank correlation coefficient will always vary between ±1 ,
+1, indicating a perfect positive correlation and –1 indicating perfect negative correlation
between two variables.
SPSS steps to run the Spearman’s rank
correlation
◦ Analyze→correlate→ Bivariate
◦ Drag all the variables to the variables
box of which correlation has to be
calculated
◦ Check the box for spearman
◦ Click ok
SPSS output for sperman’s rank
correlation
Correlations

Intervie
w score Aptitude test score
Spearman's rho Interview score Correla
tion
Coeffici 1.000 .499**
ent
Sig. (2-
tailed) .002

N 35 35
Aptitude test Correla
score tion
Coeffici .499** 1.000
ent
Sig. (2-
tailed) .002

N 35 35
**. Correlation is significant at the 0.01 level (2-tailed).
Simple regression analysis
◦ The determination of a statistical relationship between two or more variables is call regression analysis.
◦ In simple regression, we have only two variables, one variable (defined as independent) is the cause of
the behaviour of another one (defined as dependent variable).
◦ Regression can only interpret what exists physically i.e., there must be a physical way in which
independent variable X can affect dependent variable Y.
◦ The basic relationship between X and Y is given by : Y =a + bX
◦ This equation is known as the regression equation of Y on X (also represents the regression line of Y on X
when drawn on a graph) which means that each unit change in X produces a change of b in Y, which is
positive for direct and negative for inverse relationships.
Regression analysis in SPSS
◦ Analyze→Regression→Linear
◦ There is a space labelled Dependent in which you
should place the outcome variable (in this
example sales). So, select sales from the list on
the lefthand side, and transfer it by dragging it or
clicking on .
◦ There is another space labelled Independent(s)
in which any predictor variable should be placed.
◦ In simple regression we use only one predictor
(in this example, advertising) and so you should
select advertising from the list and click on to
transfer it to the list of predictors.
SPSS output for simple regression-table 1
• The first table provided by SPSS is a summary of the model.
This summary table provides the value of R and R2 for the
Model Summaryb
model that has been derived.
• For these data, R has a value of .916 and because there is only
one predictor, this value represents the simple correlation Std. Error
Adjusted of the
between advertising and sales. Model R R Square R Square Estimate
• The value of R2 is .839, which tells us that advertising 1 .916a .839 .832 .73875
expenditure can account for 83.9% of the variation in.
a. Predictors: (Constant), Advertising spending
• In other words, if we are trying to explain why some sales are
more than others, we can look at the variation in sales of b. Dependent Variable: Detrended sales
different records.
• There might be many factors that can explain this variation,
but our model, which includes only advertising expenditure,
can explain approximately 83% of it. This means that 17% of
the variation in sales cannot be explained by advertising alone.
Therefore, there must be other variables that have an
influence also.
SPSS output for simple regression-table 2
• The next part of the output reports an analysis of variance
Sum
(ANOVA ). The summary table shows the various sums of of Mean
squares and the degrees of freedom associated with each. Squar Squar
• From these two values, the average sums of squares (the mean Model es df e F Sig.
squares) can be calculated by dividing the sums of squares by 1 Regre
ssion 62.514 114.54
1 62.514 .000b
the associated degrees of freedom. 8
• The most important part of the table is the F-ratio, and the Resid
associated significance value of that F-ratio. 12.006 22 .546
ual
• For these data, F is 144.54, which is significant at p < .000. Total
74.520 23
• This result tells us that there is less than a 0.1% chance that an
a. Dependent Variable: Detrended sales
F-ratio this large would happen if the null hypothesis were
true. b. Predictors: (Constant), Advertising
• Therefore, we can conclude that our regression model results spending
in significantly better prediction of sales than if we used the
mean value of sales.
• In short, the regression model overall predicts sales
significantly well.
SPSS output for simple regression-table 3
◦ This out put provides parameters (thebeta values) and the significance of these values. We saw
equation that b0 was the Y intercept and this value is the value B (in the SPSS output) for the constant.

◦ So, from the table, we can say that b0 is 6.584, and this can be interpreted as meaning that when no
money is spent on advertising (when X = 0), the model predicts that 6,584 will be sold (unit of Coefficientsa
measurement was thousands).

◦ We can also read off the value of b1 from the table and this value represents the gradient of the
regression line. It is 1.071/0.096. Although this value is the slope of the regression line, it is more
useful to think of this value as representing the change in the outcome associated with a unit change Standar
in the predictor. dized
◦ Therefore, if our predictor variable is increased by one unit (if the advertising budget is increased by
Unstandardized Coeffici
1), then our model predicts that 1.071 extra sales. Coefficients ents

◦ Our units of measurement were thousands of INR and, so we can say that for an increase in Model B Std. Error Beta t Sig.
advertising of Rs. 1000 the model predicts 1071 (1.071*1000= 1071) extra unit of sales. 1 (Consta
◦ In general, values of the regression coefficient b represent the change in the outcome resulting from a
nt) 6.584 .402 16.391 .000
unit change in the predictor and that if a predictor is having a significant impact on our ability to
predict the outcome then this b should be different from 0 (and big relative to its standard error). Advertisi
ng
◦ We also saw that the t-test tells us whether the b-value is different from 0. SPSS provides the exact spendin 1.071 .100 .916 10.703 .000
probability that the observed value of t would occur if the value of b in the population were 0. If this g
observed significance is less than .05, then scientists agree that the result reflects a genuine effect.

◦ For these two values, the probabilities are .000 and so we can say that the probability of these t- a. Dependent Variable: Detrended sales
values or larger occurring if the values of b in the population were 0 is less than .001. Therefore, the
bs are different from 0 and we can conclude that the advertising budget makes a significant
contribution (p < .000) to predicting sales.

You might also like