The Z or T statistics may be reported by component (discrete/continuous) when combined='no'
or combined by Fisher's or Stouffer's method (combined='fisher'
or combined='stouffer'
.
Fisher's method uses the product of the p-values, while Stouffer's method uses the sum of the Z/T scores.
The "Z" score returned by Fisher is the normal quantile that would yield the observed Fisher P-value, whose sign is derived from the sign of the maximum component Z score.
The "Z" score returned by Stouffer when testType='normal'
is the sum of the Z scores, over sqrt(2).
When testType='t'
it is a weighted combination of the Z scores, with weights correponding to the degrees of freedom in each of the t statistics.
A t-approximation to this sum of t-variables is derived by matching moments. It seems to be fairly accurate in practice.
calcZ(gseaObj, testType = "t", combined = "none")
output from gseaAfterBoot
either 'normal' or 't'. The 't' test adjusts for excess kurtosis due to the finite number of bootstrap replicates used to estimate the variance of the statistics. This will result in more conservative inference.
character
one of 'none', 'fisher' or 'stouffer'
3D array with dimensions set (modules) comp ('cont'inuous or 'disc'rete) and metric ('Z' stat and two sided 'P' value that P(z>|Z|)) if combined='no'
, otherwise just a matrix.
gseaAfterBoot
## See the examples in gseaAfterBoot
example(gseaAfterBoot)
#>
#> gsAftB> data(vbetaFA)
#>
#> gsAftB> vb1 = subset(vbetaFA, ncells==1)
#>
#> gsAftB> vb1 = vb1[,freq(vb1)>.1][1:15,]
#>
#> gsAftB> zf = zlm(~Stim.Condition, vb1)
#>
#> Done!
#>
#> gsAftB> boots = bootVcov1(zf, 5)
#>
#> gsAftB> sets = list(A=1:5, B=3:10, C=15, D=1:5)
#>
#> gsAftB> gsea = gseaAfterBoot(zf, boots, sets, CoefficientHypothesis('Stim.ConditionUnstim'))
#>
#> gsAftB> ## Use a model-based estimate of the variance/covariance.
#> gsAftB> gsea_mb = gseaAfterBoot(zf, boots, sets, CoefficientHypothesis('Stim.ConditionUnstim'),
#> gsAftB+ control = gsea_control(var_estimate = 'modelbased'))
#>
#> gsAftB> calcZ(gsea)
#> , , metric = Z
#>
#> comp
#> set cont disc
#> A -1.5094802 -0.354171
#> B -0.5426047 -4.122921
#> C NaN -4.194486
#> D -1.5094802 -0.354171
#>
#> , , metric = P
#>
#> comp
#> set cont disc
#> A 0.1699737 0.738658168
#> B 0.6116679 0.003365104
#> C NaN 0.005510968
#> D 0.1699737 0.738658168
#>
#>
#> gsAftB> summary(gsea)
#>
#> gsAftB> ## Don't show:
#> gsAftB> stopifnot(all.equal(gsea@tests['A',,,],gsea@tests['D',,,]))
#>
#> gsAftB> stopifnot(all.equal(gsea@tests['C','cont','stat','test'], coef(zf, 'C')[15,'Stim.ConditionUnstim']))
#>
#> gsAftB> ## End(Don't show)
#> gsAftB>
#> gsAftB>
#> gsAftB>