slug
type
status
category
summary
date
tags
password
icon
Non-Parametric Tests
Non-parametric tests are statistical tests that do not assume that the data follow a specific distribution, such as the normal distribution. These tests are often used when data do not meet the assumptions necessary for parametric tests (e.g., t-tests or ANOVAs), such as normality, homogeneity of variance, or the scale of measurement.
Situations where non-parametric tests might be useful:
- Data are ordinal: Non-parametric tests are useful when the data can only be ranked or ordered (such as Likert scales) but not precisely measured.
- Data do not meet assumptions of parametric tests: If the data violate assumptions such as normality or homogeneity of variance, non-parametric tests can be an alternative.
- Outliers: Non-parametric tests are less sensitive to outliers and skewed data distributions compared to parametric tests.
- Small sample sizes: Non-parametric tests can be more reliable with small sample sizes when parametric tests may not work well due to insufficient data.
The Sign Test, Wilcoxon Signed-Rank Test, and Wilcoxon Rank-Sum Test
- Sign Test:
- The sign test is a simple non-parametric test used to compare the median of a population to a hypothesized value. It works by examining the signs of the differences between paired observations (i.e., whether the observation is greater or less than the hypothesized median).
- Hypothesis:
- Null hypothesis (H₀): The population median is equal to the hypothesized value.
- Alternative hypothesis (H₁): The population median is different from the hypothesized value.
- Procedure:
- For each observation, calculate the difference between the observed value and the hypothesized median.
- Count the number of positive and negative differences, ignoring zero differences.
- The test statistic is the smaller of the number of positive or negative differences.
- Use a binomial distribution to assess the statistical significance of the result.
- Example: A company claims the median salary of its employees is $50,000. A sample of 10 employees' salaries is collected, and the sign test is used to test whether the median salary differs from $50,000.
- Wilcoxon Signed-Rank Test:
- This test is used to compare paired data when the data are continuous but do not follow a normal distribution. It tests the difference between paired observations, similar to the sign test, but it also takes into account the magnitude of the differences.
- Hypothesis:
- Null hypothesis (H₀): The median difference between paired observations is zero.
- Alternative hypothesis (H₁): The median difference is not zero.
- Procedure:
- Calculate the differences between paired observations.
- Rank the absolute values of the differences, ignoring signs.
- Assign ranks to the differences, giving a positive sign for positive differences and a negative sign for negative differences.
- Sum the signed ranks for positive and negative differences separately.
- The test statistic is the smaller of the sum of the positive ranks or the negative ranks.
- Example: A researcher wants to test if a new drug has an effect on patients' blood pressure. Blood pressure is measured before and after taking the drug, and the Wilcoxon signed-rank test is used to check for significant changes.
- Wilcoxon Rank-Sum Test (Mann-Whitney U Test):
- This test is used to compare two independent samples to determine if they come from the same distribution or have identical medians.
- Hypothesis:
- Null hypothesis (H₀): The two populations have the same distribution or median.
- Alternative hypothesis (H₁): The two populations have different distributions or medians.
- Procedure:
- Combine the two samples into one group and rank all observations.
- Sum the ranks for each group separately.
- The test statistic is based on the sum of ranks for each group and compares this sum to what would be expected under the null hypothesis.
- Example: A researcher wants to test if two different treatments for a disease have the same effectiveness. Two independent groups of patients are given different treatments, and the Wilcoxon rank-sum test is used to compare the groups' outcomes.
Hypothesis Testing with Non-Parametric Tests
- Single-Sample Sign Test:
- Purpose: To test whether the population median is equal to a hypothesized value.
- Procedure: Collect a sample, calculate the differences between each observation and the hypothesized median, and count the positive and negative signs. Compare the number of positive and negative differences using a binomial distribution to assess the significance of the result.
Example 1:
Solution:
- Single-Sample Wilcoxon Signed-Rank Test:
- Purpose: To test whether the median difference between the sample and a hypothesized median is zero.
- Procedure: For each observation, compute the difference between the observation and the hypothesized median. Rank the absolute values of the differences, then sum the ranks, and calculate the test statistic based on the sum of ranks. Use the Wilcoxon signed-rank distribution to assess significance.
- Paired-Sample Sign Test:
- Purpose: To test if there is a significant difference between the medians of two related samples.
- Procedure: For each pair of observations, calculate the difference and assign a sign (positive or negative). Count the number of positive and negative signs and use a binomial distribution to test the hypothesis.
- Wilcoxon Matched-Pairs Signed-Rank Test:
- Purpose: To test if there is a significant difference between two related samples, considering both the magnitude and direction of the differences.
- Procedure: Compute the differences between paired observations, rank the absolute values of the differences, assign signs to the ranks, and sum the signed ranks. The test statistic is based on the sum of the signed ranks, and the Wilcoxon matched-pairs signed-rank distribution is used to test significance.
- Wilcoxon Rank-Sum Test:
- Purpose: To test if two independent samples come from populations with identical distributions or medians.
- Procedure: Combine the two samples, rank all observations, sum the ranks for each group, and compare the sum of ranks to the expected sum under the null hypothesis. The test statistic is based on the rank sums, and the U distribution is used to assess significance.
Summary
Non-parametric tests like the sign test, Wilcoxon signed-rank test, and Wilcoxon rank-sum test are useful when the data do not meet the assumptions of parametric tests. These tests are based on the ranks of data rather than the actual values, making them less sensitive to outliers and non-normal distributions. They can be applied to test hypotheses about population medians, the difference between paired samples, or the identity of two populations.
非参数检验
非参数检验是一类不要求数据服从特定分布(如正态分布)的统计检验方法。当数据不满足进行参数检验(如t检验或方差分析)的假设条件时,常使用非参数检验。非参数检验常用于以下情况:
非参数检验的适用场景:
- 数据为顺序型:当数据只能按顺序排列而无法精确测量时(如Likert量表),非参数检验非常有用。
- 数据不符合参数检验假设:例如数据不服从正态分布或不满足方差齐性时,非参数检验可以作为替代方法。
- 异常值的影响:非参数检验对异常值不敏感,相比参数检验在数据存在偏态或异常值时更为稳健。
- 样本量较小:在样本量较小的情况下,参数检验可能由于数据不足而失效,而非参数检验通常更可靠。
符号检验、威尔科克森符号秩检验和威尔科克森秩和检验
- 符号检验:
- 符号检验是一种简单的非参数检验,用于比较样本的中位数与假设的中位数是否相等。它通过计算观察值与假设中位数之间的差异的符号(即正号或负号)来进行。
- 假设:
- 原假设(H₀):总体中位数等于假设值。
- 备择假设(H₁):总体中位数不等于假设值。
- 步骤:
- 对每个观察值,计算其与假设中位数的差异。
- 统计正差异和负差异的数量,忽略差异为零的情况。
- 检验统计量是正差异或负差异中的较小值。
- 使用二项分布检验显著性。
- 例子:某公司声称其员工的中位薪资为50,000美元。收集了10名员工的薪资样本,可以使用符号检验来测试该薪资中位数是否与50,000美元不同。
- 威尔科克森符号秩检验:
- 该检验用于比较成对数据,当数据是连续型但不符合正态分布时,使用威尔科克森符号秩检验。它不仅考虑了差异的符号,还考虑了差异的大小。
- 假设:
- 原假设(H₀):成对观察值的中位数差异为零。
- 备择假设(H₁):中位数差异不为零。
- 步骤:
- 计算每对观察值的差异。
- 对差异的绝对值进行排序,忽略符号。
- 将排名与符号结合,为正差异分配正号,为负差异分配负号。
- 分别求正排名和负排名的和。
- 检验统计量是正排名和负排名和中的较小值。
- 例子:研究人员想测试新药是否对患者血压有影响。收集患者服药前后的血压数据,使用威尔科克森符号秩检验来检测血压是否发生显著变化。
- 威尔科克森秩和检验(Mann-Whitney U检验):
- 该检验用于比较两个独立样本是否来自相同的分布或具有相同的中位数。
- 假设:
- 原假设(H₀):两个总体的分布或中位数相同。
- 备择假设(H₁):两个总体的分布或中位数不同。
- 步骤:
- 将两个样本合并为一个组,对所有观测值进行排名。
- 分别计算每组的排名和。
- 检验统计量是基于每组的排名和,并与零假设下的期望排名和进行比较。
- 例子:研究人员想测试两种不同的治疗方法是否对病人有效。分别对两组患者进行治疗,并使用威尔科克森秩和检验比较两组治疗效果。
非参数检验的假设检验
- 单样本符号检验:
- 目的:测试总体中位数是否等于假设值。
- 步骤:收集样本,计算每个观察值与假设中位数的差异,并统计正负符号的数量。使用二项分布检验显著性。
- 单样本威尔科克森符号秩检验:
- 目的:测试样本与假设中位数的差异的中位数是否为零。
- 步骤:计算每个观察值与假设中位数的差异,排名绝对值并计算符号秩的和,使用威尔科克森符号秩分布检验显著性。
- 配对样本符号检验:
- 目的:测试两个相关样本的中位数是否有显著差异。
- 步骤:对每对观察值计算差异并赋予正负符号。统计正负符号的数量,使用二项分布检验显著性。
- 威尔科克森配对样本符号秩检验:
- 目的:测试两个相关样本的中位数差异是否显著,考虑了差异的大小和方向。
- 步骤:计算每对观察值的差异,排名差异的绝对值,并结合符号计算秩和。根据秩和计算检验统计量,使用威尔科克森配对样本符号秩分布检验显著性。
- 威尔科克森秩和检验:
- 目的:测试两个独立样本是否来自相同的分布或具有相同的中位数。
- 步骤:将两个样本合并,排名所有观测值,分别计算每组的秩和并与零假设下的期望值进行比较,使用U分布检验显著性。
总结
非参数检验,如符号检验、威尔科克森符号秩检验和威尔科克森秩和检验,在数据不满足参数检验假设时具有很好的应用。这些检验通过排名数据而不是使用实际数值,从而减少了对异常值和非正态分布的敏感性。它们可以用来检验总体中位数、成对样本的差异或两个独立样本是否来自相同的总体。
五大非参数TESTs探究:
1.Single Sample Sign test:
单样本符号检验
工具1:
2.Wilcoxon signed-rank TEST:
Wilcoxon 符号秩检验
- the underlying data are symmetric
- the underlying data are continuous
- the data are independent.
(步骤:1.求差, 2.取绝对值,3.排序,4.“恢复"符号P/N,5.分别求和&取小 6.查表比对or正态比对)
工具2:
Wilcoxon Signed-Rank Test Calculator (socscistatistics.com) (支持原始数据,第二组数据全是median即可)
双样本:
3.Paired sample sign test:【配对符号检验】
配对样本符号检验 (与前面1类似)
工具3:
4.Wilcoxon matched-pairs signed-rank test:【配对符号秩检验】
Wilcoxon 配对符号秩检验(与前面2类似)
工具4:
5.Wilcoxon rank-sum test:【独立秩和检验】
Wilcoxon秩和检验
(步骤:1.混合 2.排位 3.求和&小中取小 4.查表比对or正态比对)
工具5:
videos:
- 作者:现代数学启蒙
- 链接:https://www.math1234567.com/nonparametrictests
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。
相关文章