Statistical Analysis - 2023 - Mo

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 126

Statistical Analysis

Zhiying Long
A very simple fMRI experiment
One session
Task: 110 units
Rest: 101 units
被动听词 vs 静息

7 cycles of
rest and listening

问题:在聆听和休息之间
,BOLD的反应有什么
变化吗?
Stimulus function
我们不想知道任务区fMRI活动是否比非任务区更大。

我们想知道在对同一被试、同一组或整个人群的重复观察中,
Inferential Statistics
l Research hypothesis H1
States possible relation between IV and DV
H1: condition 1≠condition 2

l Null Hypothesis H0
States the manipulation has no effect
H0: condition 1=condition 2
l Significance testing
反证法思想:
l Evaluating whether difference between conditions are likely
to be due
先假定H to chance.
0成立,看由此产生什么结果,如果导致不合
l Significance is the probability
理现象出现,表明原假设H that the results could occur
0不成立,拒绝原假设,否则接
under the null hypothesis (alpha value).
受原假设。
l If probability of result < alpha, then reject H0 as untenable
不合理:计算事件发生的概率,小概率事件在一次观察中
可认为基本不会发生。 P<0.05
The alpha value
provides the
probability of a
type I error.
False positive
(假激活)

False negative
(假未激活)
在单个voxel上进行推断统计
为了检验一个假设,我们构建“检验统计量”。

l The Null Hypothesis H0 (condition1=condition2)


¡ 通常我们想要反驳的东西(没有效果)。
¡ 备择假设HA表示了感兴趣的结果。

l The Test Statistic T


测试统计量总结了关于H0的证据。
通常,当假设H0为真时,检验统计量较小
当假设为假时,检验统计量较大。
我们需要知道T在零假设下的分布。

Null Distribution of T
Hypothesis Testing
l Type I Error α: u
Acceptable false positive rate α.可接受的假阳性率α。
Level  threshold uα
Threshold uα controls the false positive rate

  p(T  u  | H 0 )
Null Distribution of T

l Calculating the Test Statistic Ts of the samples


Ts
If Ts > u , reject the null hypothesis.
If Ts < u , accept the null hypothesis

P-val

Null Distribution of T
Statistical Parametric Maps 统计参数图
Basic Statistics

lT test
¡t分布描述了来自同一正态分布的两个样本之间
的期望差异。

¡零假设
l条件1和条件2的fMRI数据均值之间的任何差异都是由
于随机因素。

Degrees of freedom (df): The number of unconstrained


data
One sample T test: df=N-1
Two sample T test: df=2N-2
Conducting T test
T test
l 在组块设计中
为t条件分配时
间点
Correlation Analysis

¡描述了观察和预期之间的匹配性

¡Ranges from -1 to 1
¡反应强度不直接影响相关性
Basic Concepts of the GLM
l GLM将数据视为模型因素加噪声的线性组合

¡模型因子(xi)具有已知的形状
¡参数权重(ai)未知
l GLM分析确定了一组最能说明数据的振幅值
¡常用代价函数:建模后残差的最小二乘偏差(噪声)
Form of the GLM
SPM
Design matrix
Voxel-wise time series analysis

Model
specification
Parameter
estimation

Time
Hypothesis
Statistic
Ti
m
e

BOLD signal
single voxel
time series SPM
Single voxel regression model

error
=1 + 2 +
Time

BOLD signal x1 x2 e
Mass-univariate analysis: voxel-wise GLM

Model is specified by
y = + 1. Design matrix X
2. Assumptions about
e

N: number of scans
GLM的四个基本组成部分 p: number of regressors
经验数据(y)
设计矩阵(X)
The design matrix embodies all available knowledge
参数权重(β)
about experimentally controlled factors and potential
剩余误差(e)
confounds.
Parameter estimation

= +

y X

N Least squares
Estimate parameters
such that e
t 1
2
t
minimal parameter estimate
(assuming iid error)
Constructing a Design Matrix (Model
building)
lExperimental factors
¡Model factors that are associated with specific
experimental hypotheses.
lNuisance factors
¡Reduce the amount of residual variation
included in the error term
¡Assigning known variability to nuisance factors
improves the validity of the GLM.

lCollinear factors
¡Complicated the interpretation of results
l 时间导数回归系数的正估计意味着血流动力学响应的峰值比
平常出现得更早。
l 色散导数的正估计意味着比通常情况下分散的响应更少。
Design matrix
这种模式有什么问题?
1. BOLD反应具有延迟和分散的形式。
热电厂
2. BOLD信号包含大量的低频噪声。
3.数据是序列相关的(时间自相关),这违反了
GLM中噪声模型的假设
问题1:BOLD响应的卷积模型

具有典型血流动力学反应函数
(HRF)的卷积刺激函数: t
f  g (t )   f ( ) g (t   )d
0

 HRF
问题2:低频噪声解决方案:高通滤波

discrete cosine
transform (DCT) set
Global Normalization
Contrasts
l 我们通常对整个ß向量不感兴趣。
l Contrast选择特定的感兴趣的效果:
 a contrast c is a vector of length p.

 cTβ is a linear combination of regression coefficients β.


cT = [1 0 0 0 0 …]
cTβ = 1xb1 + 0xb2 + 0xb3 + 0xb4 + 0xb5 + . . .

cT = [0 -1 1 0 0 …]
cTβ = 0xb1 + -1xb2 + 1xb3 + 0xb4 + 0xb5 + . . .
T-test - one dimensional contrasts –
SPM{t}
Question: box-car amplitude > 0 ?
cT =10000000 =
b1 = cTb> 0 ?

b1 b2 b3 b4 b5 ... H0: cTb=0


Null hypothesis:

contrast of
estimated
parameters
T=
variance
Test statistic:
estimate
T-contrast in SPM
q For a given contrast c:

ResMS image
beta_???? images
ˆT ˆ
ˆ 2 
Np

con_???? image spmT_???? image

SPM{t}
T-test: a simple example
q Passive word listening vs rest

cT = [ 1 0 ] Q: activation during
listening ?
1

SPMresults:
Null hypothesis:
10
Height threshold T = 3.2057 {p<0.001}
20 voxel-level
mm mm mm
30
T ( Zº ) puncorrected
Statistics:p-values13.94 Inf 0.000
adjusted for search volume
-63 -27 15
40
set-level
p c
12.04
cluster-level
p corrected k E p
Inf 0.000 voxel-level
p FWE-corr p FDR-corr T (
-48
Zº )
-33 12 mm mm mm
p uncorrected
11.82 uncorrectedInf 0.000 -66 -21 6
50
0.000 10 0.000
13.72520
Inf
0.000 0.000
0.000
0.0000.000 13.94
0.000 12.04
57
Inf
Inf
-21
0.000
0.000
12 -63 -27 15
-48 -33 12
12.29 Inf 0.000 0.0000.000 11.82 63 -12
Inf 0.000 -3 -66 -21 6

60
0.000
9.89426
7.83
0.000
0.000 0.000
0.000 0.000 13.72
0.000 12.29 57 -39
Inf
Inf 0.000 6 63 -12 -3
0.000 57 -21 12

7.39 6.36 0.000 0.0000.000 9.89 36 -30


7.83 0.000 -15 57 -39 6

0.000 6.84 5.99 0.000 0.000 51 0.000


0 48 36
0.000 35 0.000 0.000 0.000 7.39 6.36 -30 -15
9 0.000 0.000 6.84 5.99 0.000 51 0 48
70 0.002 6.36 3 5.65
0.024 0.001 0.0000.000 6.36 -63 -54
5.65 0.000 -3 -63 -54 -3

0.000 6.19 5.53 0.003 0.000 -30 -33


0.000 -18 36 -27 9
0.000 8 0.001 0.001 0.000 6.19 5.53 0.000 -30 -33 -18
9 0.000 0.000 5.96 5.36
80 0.005 5.96 2 5.36
0.058 0.004 0.0000.000 5.84 36 -27
5.27 0.000 9 -45 42 9

0.015 5.84 5.27 0.000 -45 42 9


0.015 1 0.166 0.022 0.000 5.44 4.97 0.000 48 27 24
1 0.166 0.036 0.000 5.32 4.87 0.000 36 -27 42
0.5 1 1.5 2 2.5 5.44 4.97 0.000 48 27 24
5.32 4.87 0.000 36 -27 42
Design matrix
Scaling issue
cT ˆ cT ˆ
[1 1 1 1 ]/ 4
T 
var(cT ˆ ) ˆ c X X  c
2 T T 1
Subject 1

l t统计量不依赖于回归量的缩放。

l t统计量不依赖于对比度的尺度。

[1 1 1 ]/ 3
l 但是要注意However be careful of the
interpretation of the contrasts
themselves (eg, for a second level
Subject 5

analysis):本身的解释(如对于二阶分析)

sum ≠ average
T-test:几点说明
l t检验是一种信噪比测量(估计值与估计值标准差的
比值)。
l t对比是β的简单组合;
t统计量不依赖于回归量的缩放或对比的缩放。

l 单侧检验
H0: c T   0 vs H A: c T   0
0.4

0.35 n=1
n=2
n=5
0.3 n=10
n=¥
0.25

0.2

0.15

0.1

0.05

0
-5 -4 -3 -2 -1 0 1 2 3 4 5
Probability Density Function of Student’s t distribution
F-test - 额外的平方和原则
l模型比较:完整模型与简化模型?

Null Hypothesis H0: True model is X0 (reduced model)==X1=0


X0 X1 X0
检验统计量: 已解释变异性与
未解释变异性的比率(误差)

RSS RSS0
 full
ˆ
 2
 reduced
ˆ
 2

1 = rank(X) – rank(X0)
Full model ? Or Reduced model? 2 = N – rank(X)
F-test - multidimensional contrasts –
SPM{F}
lTests multiple linear hypotheses:
H0: True model is X0 H0: b3 = b4 = ... = b9 = 0 test H0 : cTb = 0 ?
X0 X1 (b3-9) X0 0010000
0
cT =0 0 0 1 0 0 0
0
0000100
0
0000010
0
0000001
0
0000000
1

SPM{F6,322}

Full model? Reduced model?


F-contrast in SPM

ResMS image
beta_???? images
ˆT ˆ
ˆ 2 
Np

ess_???? images spmF_???? images

( RSS0 - RSS ) SPM{F}


F-test example: movement related
effects
q To assess m o vem e n t -
related activation:
q 数据中存在大量与运动相关
的残余伪影(尽管进行了空间重
组),这些伪影往往集中在组织
类型边界附近。
q 即使我们对这种伪影不感兴
趣,通过在我们的设计矩阵中
包括重新排列参数,我们
“covary out”了被试运动的线性
成分,减少了剩余误差,从而
改善了我们的统计数据的影响。
F-test: a few remarks
l F检验回归系数beta的一种或几种组合的加权平方
和。

l Hypotheses:
1 0 0 0
0 0 

0
1
0
0
1 0
Null Hypothesis H 0 : 1   2   3  0
 
0 0 0 0
Alternative Hypothesis H A : at least one  k  0

l 在用f检验测试一维对比时,例如β1 - β2,结果将与
测试β2 - β1相同。它将恰好是t检验的平方,同时检
验正和负的效应。
Design matrix with canonical HRF only.

在之前的设计矩阵中,onset时间与典型血流动力学
响应函数(HRF)卷积形成左边的两个回归量。
Design matrix with canonical HRF + 2 derivatives.

Left Right Mean

这与之前的模型相同,但使
用3个回归因子对每种条件
进行建模。

这三个基础函数是典型的
HRF及其关于时间和离散度
的导数。
time derivative+dispersion derivative
For this new model, how do we test the effects of, for
instance, the right motor response ?
[0 0 0 1 0 0 0
0 0 0 0 1 0 0
0 0 0 0 0 1 0] 首先,使用Fcontrast对所有对这一反
应建模的回归因子进行测试。

这种contrast检验针对参数为零的零
假设对每一行进行检验。

由于参数是针对零进行测试的,因此
必须重建拟合数据,并检查响应的正
or负方面。
我们如何测试左右侧响应之间的总体差异

[1 0 0 -1 0 0 0
0 1 0 0 -1 0 0
0 0 1 0 0 -1 0]

这显示了用于测试左右响应之间
的总体差异(跨基础函数)的f对比。

SPM-F图像对应于左右响应的总体差异。
Comparison of the fitted response

这些图显示了单个体素(先前SPM-F图的最大值)的血流动力学反应。
左图显示了使用简单模型估计的HRF,并显示出一定的拟合不足。
右图使用具有基函数的更灵活的模型纠正了这种拟合不足。
Orthogonal regressors正交回归因子

Variability in Y
Correlated regressors 相关回归因子

Shared variance

Variability in Y
Correlated regressors

Variability in Y
Correlated regressors

Variability in Y
Correlated regressors

Variability in Y
Correlated regressors

Variability in Y
Correlated regressors

Variability in Y
Correlated and orthogonal
regressors y

x2 * x2
x1

Correlated regressors = When x2 is orthogonalized


explained variance is with regard to x1, only the
shared between parameter estimate for x1
regressors changes, not that for x2!
Correlation between regressors
True signal

Model (green and red)

Fit (blue : global fit)

Residual
Correlation between regressors
b1 = 0.79
b2 = 0.85 Residual var. = 0.3
b3 = 0.06
p(Y| b1 = 0) 
p-value = 0.08
(t-test)

= + P(Y| b2 = 0) 
p-value = 0.07
(t-test)

Y Xb e

1 2
Correlation between regressors
True signal

Model (green and red)


red regressor has been
orthogonalised with respect to the
green one
 remove everything that correlates
with the green regressor

Fit

Residual
Correlation between regressors
b1 = 1.47 (0.79)
b2 = 0.85 (0.85) Residual var. = 0.3
b3 = 0.06 (0.06)
p(Y| b1 = 0)
p-value = 0.0003
(t-test)

p(Y| b2 = 0)
= +
p-value = 0.07
(t-test)

Y Xb e

1
2
1 2
Design orthogonality

l 对于设计矩阵的每对列,
正交性矩阵描述它们之间
角度的余弦值大小,从白
色映射到黑色,范围 0 到
1。
q如果两个向量的均值为零,
则向量之间角度的余弦与两
个变量之间的相关性相同。
Design efficiency
q 目的是最小化 t 对比的标准误差(即 t 统计量
的分母)。

q 这相当于最大化效率efficiency e:
e(ˆ 2 , c, X )  (ˆ 2 cT ( X T X ) 1 c) 1
Noise variance Design variance

q 如果我们假设噪声方差Noise variance与特定设计无关:

q 这是一个相对的衡量标准:我们只能说一种设计比另一种设
计更有效(对于给定的contrast)。
Design efficiency
A B

A+B
A-B

q回归量之间的高相关性导致对每个回归量单
独具有低敏感性。
q我们仍然可以有效地估计它们之间的差异。
Estimability of a contrast

Factor 1

Factor 2

Mean
l 如果 X 不是满秩,那么我们可以有 One-way ANOVA
Xb1 = Xb2 with b1≠ b2不同的参数) (unpaired two-sample t-test)

l 因此,这些参数不是“唯一”、“可 1 0 1
识别”或“可估计的”。 1 0 1

images
l 对于这样的模型,XTX is not不是可 1 0 1
逆的,所以我们必须求助于广义逆( 1 0 1
SPM 使用伪逆)。(SPM uses the 0 1 1
pseudo-inverse). 0 1 1
0 1 1
0 1 1parameters
Rank(X)=2
q Example: parameter estimability
®
(gray b not uniquely specified)

[1 0 0], [0 1 0], [0 0 1] are not estimable.


[1 0 1], [0 1 1], [1 -1 0], [0.5 0.5 1] are estimable.
Estimability of a contrast
Three models for the two-samples t-test

1 0
1 0
1 0 [1 0].β = y1
1 0 β1=y1 [0 1].β = y2
0 1 β2=y2 [1 -1].β = y1-y2 1 0 1
0 1
0 1
[.5 .5].β = mean(y1,y2) 1 0 1
0 1 1 0 1
1 0 1 β1+β3=y1
0 1 1 β2+β3=y2
0 1 1
0 1 1
0 1 1

[1 0 1].β = y1
[0 1 1].β = y2
[1 -1 0].β = y1-y2
[.5 0.5 1].β = mean(y1,y2)
A real example (almost !)

Experimental Design Design Matrix

Factorial design with 2 factors : modality and category


2 levels for modality (eg Visual/Auditory)
3 levels for category (eg 3 categories of words)

V A C1 C2 C3
C1
V
C2
C3
C1

C2
A
C3
Asking ourselves some questions
...
V A C1 C2 C3
Test C1 > C2 : c = [ 0 0 1 -1 0 0 ]
Test V > A : c = [ 1 -1 0 0 0 0 ]

[001000]
Test C1,C2,C3 ? (F) c= [000100]
[000010]

Test the interaction MxC ?

• 设计矩阵不正交
• 许多contrast是不可估计的
• MxC 的交互作用未被纳入模型
Modelling the interactions
Asking ourselves some questions ...

C1 C1 C2 C2 C3 C3 Test C1 > C2 : c = [ 1 1 -1 -1 0 0 0]
VAVAVA
Test V > A : c = [ 1 -1 1 -1 1 -1 0]

Test the categories :


[ 1 1 -1 -1 0 0 0]
c= [ 0 0 1 1 -1 -1 0]
[ 1 1 0 0 -1 -1 0]
Test the interaction MxC :
[ 1 -1 -1 1 0 0 0]
c= [ 0 0 1 -1 -1 1 0]
[ 1 -1 0 0 -1 1 0]

• Design Matrix orthogonal


• All contrasts are estimable
• Interactions MxC modelled
多重比较的问题
Random dataset: 64*64*20 voxels

P < 0.05 (about 4000 voxels) P < 0.01 (about 800 voxels) P < 0.001 (about 80 voxels)
多重比较
l在多次具有随机噪声的数据集中,n 统计检
验的假阳性结果数量大致为 n*α
l无假阳性结果的概率 p=(1-α)n

A B C

t = 2.10, p < 0.05 (uncorrected) t = 3.60, p < 0.001 (uncorrected) t = 7.15, p < 0.05,
Bonferroni Corrected
统计校正
l 如果进行了多次测试,则集体 alpha 值大于单个测
试 alpha
¡也就是说,总体 I类错误增加

l 一种选择是调整单个测试的 alpha 值,以将整体


alpha 值保持在可接受的水平
¡此过程控制总体类型 I 错误
¡Bonferroni Correction
Bonferroni correction
l alpha 值与独立统计检验的数量成比例地减少。
αbon= α/n
l 非常严格的校正
¡即使是中等数据集,也会产生非常严格的p值
¡典型的大脑可能有大约15,000-20,000个功能性体素
PType1 ~ 0.05 ; Corrected alpha ~ 0.000003
l 对I型错误控制力强,但大大提高了II型错误率
Bonferroni correction
不适用于相关数据
¡如果数据集包含相关数据点,那么统计检验的
有效数量可能会大大减少
¡大多数功能磁共振成像数据具有显著相关

Independent Voxels Spatially Correlated Voxels


Gaussian Field Theory 高斯场论

lWorsley及其同事开发的用于解释多重比较
的方法
¡ 构成大部分SPM的基础
l根据数据的平滑度(空间相关性)估计独
立统计检验的数量
¡如果数据非常平滑,则噪声点通过阈值的几率
就会降低
Gaussian Field Theory

l 如果包含 x*y*z 体素的数据与 V 体素的 FWHM 具


有平滑度,则独立比较的数量 (R) 将为
R=(x*y*z)/V3
False Discovery Rate FDR 错误发现率

l控制超阈值之间的误报值与定义的预测的
比例 (q)

¡Via 假阳性的次数
¡Vaa +Via 表示声明为激活的体素数
l基于p值在数据中的分布
uFDR校验步骤如下:

选择q值 q即所期望的最大的FDR值,常选择q=0.05

No

判别式中c(V)为一常数,它的选择
Yes 依赖于各个体素p值的联合分布情
况,通常取c(V)=1。
按大小顺序排列的p值

斜率为q/m

Thresholding of statistical maps in functional neuroimaging using the False Discovery Rate,
Christopher R. Genovese. et.al, NeuroImage, 2002
FDR用比较温和的方法对p值进行了校正
。其试图在假阳性和假阴性间达到平衡
,将假/真阳性比例控制到一定范围之
内。例如,如果检验1000次,我们设定
的阈值为0.05(5%),那么无论我们得
到多少个差异蛋白,这些差异蛋白出现
假阳性的概率保持在5%之内,这就叫
FDR<5%。
u基于voxel的Bonferroni与FDR校验方法在对各个体素做显著性
检验时都是将该检验作为独立的检验来完成的,即voxel-wise的
校验方法将对统计参数图的检验当作一组离散的检验,事实上,
fMRI数据中各个体素之间往往存在一定的相关性,也即fMRI信
号是在某种程度上连续的信号,理由如下:

False discovery rate revisted: FDR and topological inference using Gaussian random fields, Justin
R. Chumbley. et.al, NeuroImage, 2009.
uspm8中已将voxel-wise FDR隐去,并且加入了两种统称为
topological FDR的方法:cluster-FDR;peak-FDR。但是
在spm_defaults代码中可将参数defaults.stats.topoFDR改
为0来调出voxel-wise FDR这一功能。
Ø 拓扑 FDR 在簇上应用 FDR(因此考虑到数据/结果具有空间结构的事实)
--> do p= 0.001 得到簇,然后从簇分布中进行 FDR 校正。
Ø 拓扑 FDR 在峰值上应用 FDR(因此解释了数据/结果具有空间结构的事实)--
> 在峰值 = do p= 0.001 上得到跨集群的峰值并校正。
Cluster Analyses
l Assumptions
¡假设I:真正的功能磁共振成像活动区域通常会延伸到多
个体素
¡假设二:可以计算观察到给定体素范围激活的概率
l 确定给定特定“阈值”体素“cluster”的可能性
¡更高的阈值(例如,P < .0001)需要更小的cluster
l Unlikely to get large cluster of highly active voxels
¡更低的阈值(例如,P < .01)需要更大的cluster
How large should clusters be?
l 假阳性结果的可能性随着cluster大小的增加而降低
l For instance, a slice of 4096 voxels
If C=2, 16000 clusters
If C=3, 55000 clusters
Suppose voxel-wise alpha=0.001
For C=1, 4096*0.001=4.096
For C=2, 16000*0.001*0.001=0.016
For C=3, 55000*0.001*0.001*0.001=0.000055

lUsing AFNI program(Alphasim) to determine the cluster


size

Data from Forman et al., 1995


ROI analysis

l将统计数据的检验限制在较小的(较)区

l需要更少的“相关”
l基于解剖学的ROI不会引入偏差
l用功能像ROI时候会有一些潜在问题
ROI analysis

lROIs 的解释
¡在复杂设计(例如具有多个水平的因子设计)中
,通常很难从整体map中识别跨条件的激活模式.
¡如果ROI的选择基于相同的contrast,则无法对
结果数据进行测试的显著性做出任何结论
ROI analysis

lROIs 统计控制
¡通过将统计测试的数量限制为几个ROI来控制I型
误差
¡将voxel-based的分析限制为一组 ROI,然后仅
在这些体素中控制多重比较
¡预先指定一组解剖上的ROI,然后跨这些区域执
行统计分析
ROI analysis

l功能特异性的ROIs
¡将检验限制在根据其他一些信息(例如单独的
“localizer”scan或条件)的功能定义区域

¡这种方法在视觉加工的fMRI中最为普遍,其中
localizer用于识别功能特定的区域,例如V1中
的视网膜局部组织区域,或MT中的运动敏感体

Defining ROIs

lROI可以根据结构或功能特征来定义.

¡结构ROI通常根据宏观解剖结构定义,例如脑回
解剖.
Defining ROIs

lROI可以根据结构或功能特征来定义.
¡功能ROI通常基于对来自同一个人的数据分析.
l一种常见的方法是使用单独的“localizer”扫
描来识别特定解剖区域中显示特定响应的体素
l可以在因子设计中使用正交contrast创建功能
ROI
l可以基于以前的研究创建ROI.
怎么在被试间比较

lRandom-effects Model 随机效应


¡假设这种效应在不同人群中有所不同
¡解释分析中被试间的差异
¡允许从人群中推断出被试
¡对于组间比较尤其重要
¡许多审稿人/期刊要求
怎么在被试间比较

lFixed-effects Model 固定效应


¡假设效应在人群中是恒定的(“固定的”)
¡忽略被试间差异
¡使用所有被试的数据进行统计检验
¡例子
l在t检验前跨被试进行平均
¡允许对被试样本进行推断
Summary Statistics approach
First level Second level
Data Design Matrix Contrast Images

SPM(t)

One-sample
t-test @ 2nd level

You might also like