数据分析中的统计Test

在数据分析中,遇到统计问题的时候,基本可以按照下表来:
数据分析中的统计Test_第1张图片

(图片来源自网上,出处不详)


那么首先我们需要判断是否是正态分布(Normal Distribution), 四种方法:

  1. 绘制数据的直方图,看叠加线——这是一种粗略的方法,且不是硬性( hard-and-fast)指标。一般来说看得多了你就知道哪些是属于正态分布,哪些不属于。

  2. 偏态值(Skewness)峰态值(Kurtosis):
    Skewness 是关于分布是否对称的指标。
    分为正偏态分布(positively skewed distribution ,整体往左偏)和负偏态分布(negatively skewed distribution,整体往右偏)
    Kurtosis 是关于分布峰值陡峭情况的一个指标。
    它是指整个曲线的形状是钟型(bell-shaped )的而不是例如肥胖型或尖峰型等等。
    正态分布的Skewness 和 Kurtosis 都是 0,所以离0 越远越不是正态分布,但是到底多少距离 0 我们可以认为它是正态的呢?这个就难办了,所以出现了下面的办法,它是结合了偏态值和峰态值的一种统计检验方法。

  3. Kolmogorov-Smirnov test (K-S)Shapiro-Wilk (S-W) test
    他们是通过comparing your data to a normal distribution with the same mean and standard deviation of your sample 来检验是否正态的。
    如果检验不显著(NOT significant,即大于0.05),则是正态的,显著的话(significant,即小于0.05),则是非正态的。
    需要注意的是,样本越大,越有可能得到显著的结果。

  4. 另外一种方法就是做图画点的方法,叫做“Normal Q-Q Plot”。
    The black line indicates the values your sample should adhere to if the distribution was normal. The dots are your actual data. If the dots fall exactly on the black line, then your data are normal. If they deviate from the black line, your data are non-normal.

一些很明显不是正态分布的情形:
when the outcome is an ordinal variable or a rank
when there are definite outliers or
when the outcome has clear limits of detection.


第二个就是判断是否是方差齐性(Homogeneity of variance)

首先要知道什么是方差齐性:是指每一个总体的方差都是相同的。它是ANOVA分析的基础。数学表示如下:
H0=σ21=σ22==σ2n

检验是否具有方差齐性的方法主要有三个:
Bartlett’s Test
Levene’s Tes
Brown-Forsythe Test
同时 F statistic test 也可以用来判断方差齐性。


关于 parametricnonparametric

什么是 nonparametric?
即方差不齐或者不是正态分布,Distribution-free,与 Parametric 对应

根据以上即可推出:
什么时候用 Nonparametric Tests呢?
1、方差不齐或者非正态时
2、数据是 名词意义的或者有序的 (非正态的常见情况)
3、样本非常小的时候
当然每一组肯定还是任意分配的

In general, when compared to a corresponding parametric test, a nonparametric test is less powerful.
For very small samples, nonparametric tests can be as powerful as the parametric counter parts.

Parametric vs. Nonparametric tests
数据分析中的统计Test_第2张图片
数据分析中的统计Test_第3张图片
(source: http://changingminds.org/explanations/research/analysis/parametric_non-parametric.htm)

Q: 样本大小跟 nonparametric 的关系?
• Validity of the unpaired t-test is not seriously compromised by violating the assumption of
equality of variance IF n1 = n2.
• If sample sizes are unequal, differences in variance can affect the accuracy of the t-statistics.
(From course material)


常见Test 说明

Parametric tests:

T-Test for Independent Samples
Equal Variances、unpaired
T-test 是在比较两者的均值(means)
independent 是指 unpaired t-test
既可以用作equal variance 又可以是在 unequal variance 的情况下:
数据分析中的统计Test_第4张图片
数据分析中的统计Test_第5张图片

T-Test for Paired Samples

Subjects may be matched on relevant variables (age, twins, etc.), or using self as control.
数据分析中的统计Test_第6张图片

One-Way Analysis of Variance for Independent Samples
ANOVA 是比较两组以上均值的
one way 指的是independent variable or factor, with 3 or more levels.(一个变量,但该变量在每组的程度不同)
它是基于 F 检验的:
数据分析中的统计Test_第7张图片
数据分析中的统计Test_第8张图片

A significant F-ratio does NOT indicate each group is different from all other groups.
It only tells us that there is a significant difference between at least 2 of the means (largest vs smallest).

(Need to be continued)

Reference:
[1] Foundations of Clinical Research: Applications to practice Third Edition Leslie G.Portney, Mary P.Watkins
[2] https://statistics.laerd.com/spss-tutorials/mixed-anova-using-spss-statistics.php
[3] http://www.ats.ucla.edu/stat/mult_pkg/whatstat/
[4] http://www.psychwiki.com/wiki/How_do_I_determine_whether_my_data_are_normal%3F
[5] http://blog.minitab.com/blog/adventures-in-statistics/choosing-between-a-nonparametric-test-and-a-parametric-test
[6] http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Nonparametric/BS704_Nonparametric2.html
[7] http://www.biostathandbook.com/testchoice.html

你可能感兴趣的:(fMRI)