### Maths Non Parametric Test

##### Non Parametric Test

Non-parametric tests, also known as distribution-free tests, are statistical tests that do not make assumptions about the distribution of the population from which the sample is drawn. They are used when the sample size is small, the data is not normally distributed, or the population distribution is unknown.

##### Types of Non Parametric Test

Non-parametric tests, also known as distribution-free tests, are statistical tests that do not make assumptions about the distribution of the population from which the sample was drawn. They are used when the sample size is small, the data is not normally distributed, or the population distribution is unknown.

There are many different types of non-parametric tests, each with its own strengths and weaknesses. Some of the most common non-parametric tests include:

**1. Chi-square test:**

- The chi-square test is used to test for independence between two categorical variables.
- It is based on the chi-square statistic, which is a measure of the discrepancy between observed and expected frequencies.
- The chi-square test is a powerful test, but it can be sensitive to small sample sizes.

**2. Kruskal-Wallis test:**

- The Kruskal-Wallis test is used to compare three or more independent groups on a single ordinal variable.
- It is based on the ranks of the data, rather than the actual values.
- The Kruskal-Wallis test is a non-parametric alternative to the one-way analysis of variance (ANOVA).

**3. Mann-Whitney U test:**

- The Mann-Whitney U test is used to compare two independent groups on a single ordinal variable.
- It is based on the ranks of the data, rather than the actual values.
- The Mann-Whitney U test is a non-parametric alternative to the two-sample t-test.

**4. Wilcoxon signed-rank test:**

- The Wilcoxon signed-rank test is used to compare two related groups on a single ordinal variable.
- It is based on the ranks of the differences between the two groups.
- The Wilcoxon signed-rank test is a non-parametric alternative to the paired t-test.

**5. Spearman’s rank correlation coefficient:**

- Spearman’s rank correlation coefficient is used to measure the strength of the relationship between two ordinal variables.
- It is based on the ranks of the data, rather than the actual values.
- Spearman’s rank correlation coefficient is a non-parametric alternative to the Pearson product-moment correlation coefficient.

**6. Kendall’s tau:**

- Kendall’s tau is another non-parametric measure of the strength of the relationship between two ordinal variables.
- It is based on the number of concordant and discordant pairs of observations.
- Kendall’s tau is a more robust measure of correlation than Spearman’s rank correlation coefficient, but it is also more sensitive to ties.

**7. Friedman test:**

- The Friedman test is used to compare three or more related groups on a single ordinal variable.
- It is based on the ranks of the data, rather than the actual values.
- The Friedman test is a non-parametric alternative to the repeated-measures ANOVA.

**8. Cochran’s Q test:**

- Cochran’s Q test is used to test for homogeneity of proportions across multiple groups.
- It is based on the number of discordant pairs of observations.
- Cochran’s Q test is a non-parametric alternative to the chi-square test for homogeneity of proportions.

**9. McNemar’s test:**

- McNemar’s test is used to compare two related groups on a single binary variable.
- It is based on the number of discordant pairs of observations.
- McNemar’s test is a non-parametric alternative to the chi-square test for paired proportions.

**10. Sign test:**

- The sign test is used to compare two related groups on a single binary variable.
- It is based on the number of positive and negative differences between the two groups.
- The sign test is a non-parametric alternative to the paired t-test.

Non-parametric tests are a valuable tool for statistical analysis when the assumptions of parametric tests are not met. They are relatively easy to use and interpret, and they can provide powerful insights into the data.

##### Difference between Parametric and Non Parametric Test

Parametric and non-parametric tests are two different types of statistical tests that are used to analyze data. The main difference between the two is that parametric tests assume that the data is normally distributed, while non-parametric tests do not.

##### Parametric Tests

Parametric tests are based on the assumption that the data is normally distributed. This means that the data is expected to follow a bell-shaped curve. If the data is not normally distributed, then the results of the parametric test may not be accurate.

Some common parametric tests include:

**t-test:**This test is used to compare the means of two independent groups.**ANOVA:**This test is used to compare the means of three or more independent groups.**Regression analysis:**This test is used to investigate the relationship between two or more variables.

##### Non-Parametric Tests

Non-parametric tests do not assume that the data is normally distributed. This makes them more versatile than parametric tests, as they can be used with any type of data. However, non-parametric tests are generally less powerful than parametric tests, meaning that they are less likely to detect a significant difference between groups.

Some common non-parametric tests include:

**Mann-Whitney U test:**This test is used to compare the medians of two independent groups.**Kruskal-Wallis test:**This test is used to compare the medians of three or more independent groups.**Chi-square test:**This test is used to test for independence between two categorical variables.

##### Choosing the Right Test

The choice of which statistical test to use depends on the type of data you have and the research question you are trying to answer. If you are not sure which test to use, it is always best to consult with a statistician.

Parametric and non-parametric tests are two different types of statistical tests that are used to analyze data. The main difference between the two is that parametric tests assume that the data is normally distributed, while non-parametric tests do not. The choice of which test to use depends on the type of data you have and the research question you are trying to answer.

##### Importance of Non Parametric Test

Non-parametric tests are statistical tests that do not make assumptions about the distribution of the population from which the sample was drawn. This is in contrast to parametric tests, which do make assumptions about the population distribution.

Non-parametric tests are often used when the sample size is small, or when the data is not normally distributed. They are also used when the researcher does not know the population distribution, or when the data is not suitable for parametric tests.

**Advantages of Non-Parametric Tests**

There are several advantages to using non-parametric tests, including:

**They do not require assumptions about the population distribution.**This makes them more versatile than parametric tests, which can only be used when the population distribution is known or can be reasonably assumed.**They are often more powerful than parametric tests.**This is especially true when the sample size is small or the data is not normally distributed.**They are easier to understand and interpret.**This is because they do not require the researcher to have a deep understanding of statistics.

**Disadvantages of Non-Parametric Tests**

There are also some disadvantages to using non-parametric tests, including:

**They can be less efficient than parametric tests.**This is because they do not use all of the information in the data.**They can be more difficult to find.**This is because they are not as commonly used as parametric tests.

**When to Use Non-Parametric Tests**

Non-parametric tests should be used when:

- The sample size is small.
- The data is not normally distributed.
- The researcher does not know the population distribution.
- The data is not suitable for parametric tests.

**Examples of Non-Parametric Tests**

There are many different types of non-parametric tests, including:

**The Mann-Whitney U test:**This test is used to compare two independent groups.**The Kruskal-Wallis test:**This test is used to compare three or more independent groups.**The Wilcoxon signed-rank test:**This test is used to compare two related groups.**The Friedman test:**This test is used to compare three or more related groups.

Non-parametric tests are a valuable tool for researchers who need to analyze data without making assumptions about the population distribution. They are often more powerful and easier to understand than parametric tests, and they can be used with a variety of data types.

##### Non Parametric Test Solved Examples

Non-parametric tests are statistical tests that do not make assumptions about the distribution of the population from which the sample was drawn. They are often used when the sample size is small or when the data is not normally distributed.

##### Example 1: Wilcoxon Signed-Rank Test

The Wilcoxon signed-rank test is a non-parametric test that compares the medians of two related samples. It is often used when the sample size is small or when the data is not normally distributed.

**Example:** A researcher wants to compare the effectiveness of two different teaching methods. They randomly select 10 students and teach them using Method A. They then teach the same 10 students using Method B. The researcher records the test scores for each student for both methods.

The data is as follows:

Student | Method A | Method B |
---|---|---|

1 | 80 | 85 |

2 | 75 | 80 |

3 | 90 | 95 |

4 | 85 | 90 |

5 | 70 | 75 |

6 | 65 | 70 |

7 | 80 | 85 |

8 | 75 | 80 |

9 | 90 | 95 |

10 | 85 | 90 |

The researcher wants to test the hypothesis that there is no difference in the medians of the two methods.

**Solution:**

- Calculate the difference between the scores for each student.
- Rank the absolute values of the differences from smallest to largest.
- Assign a sign to each rank, based on whether the difference is positive or negative.
- Calculate the sum of the positive ranks and the sum of the negative ranks.
- Calculate the test statistic:

$$W = \min(R^+, R^-)$$

where $R^+$ is the sum of the positive ranks and $R^-$ is the sum of the negative ranks.

- Compare the test statistic to the critical value from the Wilcoxon signed-rank test table.

In this example, the test statistic is $W = 15$. The critical value for a two-tailed test with $n = 10$ is $16$. Therefore, the researcher fails to reject the null hypothesis. There is not enough evidence to conclude that there is a difference in the medians of the two methods.

##### Example 2: Kruskal-Wallis Test

The Kruskal-Wallis test is a non-parametric test that compares the medians of three or more independent samples. It is often used when the sample size is small or when the data is not normally distributed.

**Example:** A researcher wants to compare the effectiveness of three different drugs in treating a disease. They randomly select 15 patients and assign them to one of three groups. Each group receives a different drug. The researcher records the improvement in symptoms for each patient after one month of treatment.

The data is as follows:

Group | Drug | Improvement in Symptoms |
---|---|---|

1 | A | 10 |

2 | A | 15 |

3 | A | 20 |

4 | B | 5 |

5 | B | 10 |

6 | B | 15 |

7 | C | 25 |

8 | C | 30 |

9 | C | 35 |

The researcher wants to test the hypothesis that there is no difference in the medians of the three drugs.

**Solution:**

- Rank the data from smallest to largest, ignoring the group labels.
- Calculate the sum of the ranks for each group.
- Calculate the test statistic:

$$H = \frac{12}{n(n+1)} \sum_{i=1}^k n_i (R_i - \overline{R})^2$$

where $n$ is the total sample size, $k$ is the number of groups, $n_i$ is the sample size for group $i$, $R_i$ is the sum of the ranks for group $i$, and $\overline{R}$ is the average rank.

- Compare the test statistic to the critical value from the Kruskal-Wallis test table.

In this example, the test statistic is $H = 6.0$. The critical value for a two-tailed test with $k = 3$ and $n = 15$ is $5.99$. Therefore, the researcher rejects the null hypothesis. There is enough evidence to conclude that there is a difference in the medians of the three drugs.

##### Conclusion

Non-parametric tests are a powerful tool for analyzing data when the assumptions of parametric tests are not met. They are easy to use and can be applied to a wide variety of data types.

##### Non Parametric Test FAQs

##### What is a non-parametric test?

A non-parametric test is a statistical test that does not make any assumptions about the distribution of the population from which the sample was drawn. This means that non-parametric tests can be used with data that is not normally distributed, or with data that has outliers.

##### When should I use a non-parametric test?

You should use a non-parametric test when:

- You do not know the distribution of the population from which the sample was drawn.
- Your data is not normally distributed.
- Your data has outliers.

##### What are some common non-parametric tests?

Some common non-parametric tests include:

- The Mann-Whitney U test
- The Kruskal-Wallis test
- The Wilcoxon signed-rank test
- The Friedman test

##### How do I interpret the results of a non-parametric test?

The results of a non-parametric test are interpreted in the same way as the results of a parametric test. The null hypothesis is either rejected or not rejected, and the p-value is used to determine the statistical significance of the results.

##### What are the advantages of non-parametric tests?

The advantages of non-parametric tests include:

- They can be used with data that is not normally distributed.
- They are not affected by outliers.
- They are often simpler to perform than parametric tests.

##### What are the disadvantages of non-parametric tests?

The disadvantages of non-parametric tests include:

- They can be less powerful than parametric tests when the assumptions of the parametric test are met.
- They can be more difficult to interpret than parametric tests.

##### Conclusion

Non-parametric tests are a valuable tool for statistical analysis. They can be used with data that is not normally distributed, or with data that has outliers. However, it is important to understand the advantages and disadvantages of non-parametric tests before using them.