L8: Nonparametric testing Flashcards

1
Q

When should you use nonparametric tests?

A
  • When assumptions are violated
    • e.g. strong non-normality
  • When the variable is ordinal
    • e.g. when playing Mario Kart
  • When unsure about outliers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Parametric vs Nonparametric
Differences?

A

Look at figure 1.
Important note: Nonparametric tests aren’t capable of handling non-random samples.

(Last row isn’t as important because we now have computers that can handle everything.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Whats the most common solution to analyse weirdly distributed data?

A

Ranking the data
All nonparametric tests involve ranking to overcome distributional problems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is ranking?

A

A way of handling data that allows you to deal with extreme data.
You assign ranks to the data, going from lowest score to the highest score.
This means that you can handle outliers well.

Look at figure 2 to see what I mean
The last column has the same ranking despite very different scores on each variable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you deal with ties when ranking individuals?

A

Find the mean ranking of the individuals that have tied.
Look at figure 3 for an example.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the general procedure for nonparametric tests?

A
  1. Assumption: Independent random samples
  2. Hypothesis
    1. H0: equal population distributions (implies equal mean ranking)
    2. HA: Unequal mean ranking (two sided)
    3. HA:Higher mean ranking for one group
  3. Test statistic is difference between mean or sum of ranking
  4. Standardize test statistic to normal sampling distribution
  5. Calculate P-value one or two sided
  6. Conclude to reject H0 if p < alpha
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the Wilcoxon rank-sum test

A

Nonparametric version of independent 2 sample t-test
Also known as the Mann-Whitney U test

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Whats the main expectation of a Wilcoxon rank-sum test

A

By ranking all values and then summing the ranks per group, one would expect under the null hypothesis that the sum of ranks is approximately equal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The next few flashcards are how to perform a rank-sum test. It’s kind of confusing so stay with me.
(flip the card for good news)

A

JASP does this all for you, so just try and comprehend how the test works, rather than memorise it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

After summing the ranks per group, How do you find W?

A

Pick the group with the lowest sum rank score.
If the group sizes are unequal, W is the group with the smallest amount of people.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

JASP produces a value called U. It is W - W.min
W.min = the minimum value of W.
How do you find W.min?

A

The minimum value depends on the sample size.
If each group has 10 participants, the lowest possible sum ranked score would 1+2+3…+10 = 55.

So, W.min = sum(1:n), with n being your group size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you find the Mean W under the null hypothesis?

A

Look at figure 4.
It depends on your sample size. H0 assumes that the sum rank score will be equal, so do some maths trickery, and shabang.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Besides the formula in figure 4, how else could you find the Mean W?

A

You’ve found W.min, if you find the maximum value of W, you can average those two values and get the mean.
To find the max value of W, do the same as W.min, but with the highest ranks (11:20 in the case of 2 groups of 10.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Almost there, calculate the standard error of W, (so standard deviation thingymabob)

A

Look at Figure 5.
(two points.
1. I don’t know why the bottom is 12, johnny didnt say, the book didnt say, it just is
2. You don’t need to know the formula, i’m just going step by step)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Alas, you have the mean W, the SE of W, and the W of your data (being the lowest sum rank score)
What do you do now?
Hint, block 1 stats is coming to haunt you

A

Thats right! Calculate the Z-score!
Figure 6 shows you it.
Its the same as if you were doing it with the mean value of a t-test, but instead of the mean, its W
Pretty nifty, right?
(end my suffering)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What do you do with your prized Z-score?

A

Calculate the p-value to see if your data is significant.
Make sure to specify if its one sided or two sided based on your hypothesis.
If its significant, you’re done!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Hol’up, did you seriously forget to calculate the effect size… -.-
Do better.
Whats the name of the effect size you use. How do you calculate it
(IMPORTANT)

A

Rank-biserial correlation
Formula 7
(You don’t need to know how to calculate it, but remember its name and what type of number it is)

It formats your W as a correlation.
Therefore, the closer to -1 or 1 it is, the higher the effect is.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How can you convert your rank biserial correlation into a percentage of support?

A

((1+rbs)/2) x 100% , e.g. an effect size of 0.29 = 65% of the ranked data support the idea that …

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How robust is W?
Are nonparametric tests good?

A

Look at figure 8
Shits robust as fuck
No matter how you fuck with the data, it dont change the W.

20
Q

Tips and tricks for JASP when doing a rank-sum test

A

Use a raincloud plot, they are useful, they show you the differences between groups clearly.
Q-Q plots allow you to see if the data is distributed weirdly.
Look at the repeated p-value, is it significant?

21
Q

How to write the results for rank-sum tests

A

Report only the test statistic and its significance, and include effect size and exact values of p
E.g.
Depression levels in ecstasy users did not differ significantly from alcohol users the day after the drugs were taken, U = 64.50, p =0.29, rbs = 0.29, 95% CI [-0.22, -0.67]. However, by Wednesday, ecstasy users were significantly more depressed than alcohol users, U = 96, p <.001, rbs = 0.92, 95% CI [0.79, 0.97].

22
Q

Wilcoxon Rank-sum test Notation summary

A

W: Base test statistic - Lowest summed rank score
W.min: Lowest possible summed rank score - Dependent on sample size
W-hat: Mean W under H0
SEw-hat: Standard error of W
U: W - W.min
rbs: rank biserial correlation - effect size

23
Q

What is the Wilcoxon signed-rank test

A

A nonparametric alternative to the paired samples t-test.
It assigns + or - signs to the difference between two repeated measures.
By ranking the absolute differences and summing these ranks for the positive group, the null hypothesis is tested that both positive and negative differences are equal.
The test statistic is T+ (the sum of positive ranks)

24
Q

What does a high sum of positive ranks indicate?

A

It indicates that most of the individuals’ second measure score decreased from the first measure.
T+: Score decreased at second measure
T-: Score increased at second measure

25
Q

Why do you calculate both the difference scores and the absolute difference scores.

A

You use the absolute diff. scores to rank the individuals.
You use the normal diff. scores to see whether its a ‘+’ or a ‘-‘.

26
Q

Why do you remove scores that have no difference?

A

It won’t affect our sum positive score, but it will affect the sample size, making the mean T larger, weakening your effect.
By removing them, you only analyse the proportion of affected scores.

27
Q

What are all the values needed to standardize T?

A

Look at figures 9 to 11.

28
Q

Whats the name of the effect size?

A

Matched rank biserial correlation - Figure 12
It’s similar to the rank biserial correlation, but here it is literally the effect expressed as a proportion of the total of all the ranks.

Again, its a correlation, so interpret it as you normally would
You can convert it into a percentage of support if you please (look at flashcard 18)

29
Q

How do you write the results of a signed-rank test?

A

Report the test statistic (denoted by the letter T+), its exact significance and an effect size.
E.g.
For ecstasy users, depression levels were significantly higher on Wednesday than on Sunday, T+ = 0, p = 0.014, rsb = 1. For alcohol users, no significant difference was found between depression levels on Wednesday and Sunday, T = 8, p = 0.052, rbs = -0.71, 95% CI [-0.92, -0.18].

30
Q

JASP

A

Perform a paired samples t-test as usual.
Then just click the Wilicoxon signed-rank option under Tests.

31
Q

Wilcoxon signed-rank test Notation summary

A

T+: Sum of positive rank scores
T-: Sum of negative rank scores
T-hat: T mean - middle point for T, expectation under H0
SEt: Standard error of T
r: Matched rank-biserial correlation

32
Q

What is a Kruskal-Wallis test?

A

Independent >2 samples
Nonparametric version of independent one-way (Between-subjects) ANOVA
It essentially subtracts the expected mean ranking from the calculated observed mean ranking which is Chi^2 distributed
You rank them exactly the same as Wilcoxon

The test statistic is ‘H’

33
Q

What values do you need to calculate H?

A

Look at figure 13.
N: Total sample size
ni: sample size per group
k: number of groups
Ri: rank sums per group

Not needed for H itself, but to use it
Degrees of freedom: k-1

34
Q

What follow up would you do after you’ve tested H?

A

A Dunn’s Post Hoc test
Since you have multiple groups, you need to assess which group causes a difference, etc.
JASP performs pairwise Wilcoxon rank-sum tests for you, so it gives rbs as an effect size

35
Q

JASP info for Kruskal-Wallis test

A

You can look at the Q-Q plot, see if the line is weird.
Run a regular ANOVA, then go all the way down to the nonparametric test.
Enable effect size, look at ε

Enable Dunn’s Post Hoc test, it compares all possible pairs of groups with a p-value that is corrected so that the error rate across all tests remains at 5%.
When doing post-hoc tests, look at the effect size (rbs) to avoid issues.
Also never look at regular p, look at Bonferroni’s p or Holm’s p. They’ve been drinking water, they’ve got clear p.

36
Q

Writing the results from a Kruskal-Wallis test

A

Report the test statistic (denoted by H), its degrees of freedom, and its significance.
You can report just the main test, but since it doesn’t tell you which conditions are different, include the follow-up results.
E.g.
Testosterone levels were significantly affected by eating soya meals, H(3)= 8.66, p = 0.034.

Pairwise comparisons with Holm adjusted p-values showed that there were no significant differences between testosterone levels when people ate 7 soya meals per week compared to 4 meals (p = 0.133, rbs = 0.44), 1 meal (p = 0.133, rbs = 0.39) , or no meals (p = 0.058, rbs = 0.48). There were also no significant differences in testosterone levels between those eating 4 soya meals per week and those eating 1 meal (p = 1.00, rbs = 0.02) and no meals (p = 1.00, rbs = 0.06). Finally, there were no significant differences in testosterone levels between those eating 1 soya meal per week and those eating none (p = 1.00, rbs = 0.04).

This is very long because it discusses 4 pairwise tests, i doubt we’d do the same

37
Q

Kruskal-Wallis test Notation summary

A

H: Test statistic
N: Total sample size
ni: sample size per group
k: number of groups
Ri: rank sums per group

ε: Effect size for main test
rbs: Effect size for Post hoc tests

38
Q

What is Friedman’s ANOVA?

A

Paired >2 samples
Nonparametric version of repeated one-way ANOVA
Compares differences between several related groups
Like Kruskal-Wallis, this test subtracts the expected mean ranking from the calculated observed mean ranking, which is also chi^2 distributed.

Fr: Test statistic

39
Q

How do you rank people in Friedman’s ANOVA?

A

Rank within each participant
Sum the ranks for each of the conditions

40
Q

What do you need to calculate Fr

A

Look at figure 14.
N = total number of subjects
k = number of groups
Ri = rank sums for each group
df = k-1
Test for significance with Chi-square distribution

41
Q

What effect size do you look at for the main test?

A

Look at Kendall’s W (coefficient of concordance).
It quantifies the similarity between participants’ scores.
It has a limited range: From 0 (no similarity between participants) to 1 (complete similarity between participants).

42
Q

What post hoc test do you do?

A

Conover tests (JASP performs the Wilcoxon signed-rank tests for you to compare the groups)

Look at the effect size (rbs) to see how different each group is

43
Q

How can you see the sum of ranks for each group?

A

Go to the Conover test table.
Wi is the sum of the first group being compared, Wj is the sum of the second group being compared.
E.g. If t0 and t1 are being compared, Wi is t0’s sum, and Wj is t1’s sum

44
Q

How do you write the results for Friedman’s ANOVA?

A

Report the test statistic (Fr), its degrees of freedom, and its significance.
e.g.
The weight of participant did not significantly change over the two months of the diet, Fr (2) = 0.20, p = 0.91. Wilcoxon tests were used to follow up this finding. It appeared that weight didn’t significantly change from the start of the diet to one month, T = 0.21, rbs = -0.02, from the start of the diet to two months, T = 0.43, rbs = -0.09, or form one month to two months, T = 0.21, rbs = -0.06.

45
Q

Friedman’s ANOVA Notation summary

A

Fr: Test statistic
N = total number of subjects
k = number of groups
Ri = rank sums for each group
df = k-1