Normality assumption
For a large enough sample size, the normality assumption is not as important as you can usually rely on the central limit theorem.
Small sample size: check boxplots (looking for symmetry) and QQ plots (looking for a straight line). If we're checking for normality in a boxplot, then we're mostly looking for symmetry. If we're checking for normality in a QQ plot, then we're mostly looking for points that lie reasonably close to the line.
Sign test
If we can safely assume that the differences are normally distributed, we can use a paired -test, to test if the population mean difference equals zero, H0 : = 0.
If we do not feel comfortable making the normality assumption, we can still analyse the differences using the sign test.
binom.test(t0, n, p = 0.5, alternative = "greater", conf.level = 0.95)
Wilcoxon signed-rank test
直接R:
wilcox.test(y, x, alternative = "greater", paired = TRUE)
#直接给d代替y和x也可
Normal approximation (if there are ties)
Wilcoxon rank-sum test
A non-parametric test to compare means of two independent samples
Relaxes normality assumption (like sign and Wilcoxon sign-rank tests)
Also relaxes the assumption of symmetry
Suppose the samples X1,X2...Xn and Y1,Y2...Yn are taken from two distinct populations that follow the same kind of distribution but differ in location. That is, μx = μy + θ , where is the population mean of X, μy is the population mean of and is a location shift parameter.
Calculate p-value: no ties on the data
R:wilcox.test( trails~分类的column, data = ...,alternative = ...)