Permutation test

2023-05-16

Outlines:

  • Goals and strategy
  • The simple condition
  • The complex condition

Goals and strategy

Goals:

  • Estimate the distribution of the test statistic( T ) under the null hypothesis, thus the p-value of the observed test statistic(Tobs) is easy to get.
    • When there are multiple tests, permutation test could account for the correcton for multiple testing;

Strategy:

  • Rearrange the labels on the observed data points;
  • This is on condition that: If the labels are exchangeable under the null hypothesis, then the resulting tests yield exact significance levels.

The simple condition[@wiki_Permutation_tests]

Questions:

See if the mean values of group A and B differ or not.(We don’t know the distribution of A and B)

Notations

sample size nA,nB ,mean value x¯A,x¯B ;

## $A
##  [1] -0.34998424  0.79496994  0.16626749  0.62345697  0.31640182
##  [6]  0.06934537 -0.26458933  0.23255516  1.59808657 -1.84554150
## [11]  0.40214946  0.97689181
## 
## $B
##  [1] 2.6513936 3.6293449 3.2774724 0.1550930 0.8845866 0.4786718 1.7699035
##  [8] 1.4825841 1.3901246 2.3369900 3.4759334 1.9347075 2.2098590 0.3936378
## [15] 3.1333022

Algorithm of permutation test under the simple condition

  1. Calculate the observed value of Tobs=x¯Ax¯B using the original data;
  2. Pool the data,randomly pick nA samples for group A and nB for group B, calculate T ;
  3. Repeat 2 for I times , thus get statistic T1,...,TI ;
  4. p-value: pobs=#{i:Ti>Tobs}I ;

Remarks:

  • I is called the resolution of p-value, thus the bigger the better;

The complex condition

fig

This figure is abstracted from the GWAS[@hirschhorn2005genome], intending to correct for multiple testing.

Notations

notation meaning
i i ’th sample
j j ’th test
yi response variable for individual i :case=1,control=0
xi1,..,xiJ J predictor variables for individual i,respectively m,n number of cases and controls,respectively

Data at location j

group response variable predictors
case y1=1 x11,..,x1J … … … case ym=1 xm1,..,xmJ control y(m+1)=0 x(m+1)1,..,x(m+1)J … … … control y(m+n)=0 x(m+n)1,..,x(m+n)J

Remarks: Those xij could be either scaler or vector;

Algorithm of permutation test under the complex condition

  1. Calculate the observed value of T˜={T1,T2,...,TJ} for J tests with the original data;
  2. Randomly shuffle yi,get permutation data D and calculate T˜ ;
  3. Repeat 2 for I times , thus get data D1,...,DI and corresponding statistic T˜1,...,T˜I ;
  4. p-value for j ’th test correcting for multiple test:
    pj=#{i:Tij>Tj}I;

References

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Permutation test 的相关文章

  • Python 中的重复排列

    我想迭代一个的所有顶点n尺寸为 1 的维度立方体 我知道我可以做到这一点itertools product如下 gt gt gt n 3 gt gt gt for j in it product 0 1 repeat n print j 0
  • 部分排列

    我有以下递归函数用于输出部分组合 void comb string sofar string rest int n string substring if n 0 cout lt lt sofar lt lt endl else for s
  • 包含重复序列的数字到唯一排列映射

    我正在寻找一种可以将数字映射到序列的唯一排列的算法 由于类似的问题 我发现了莱默代码和阶乘系统 快速排列 gt 数字 gt 排列映射算法 https stackoverflow com questions 1506078 fast perm
  • 如何计算具有重复元素的列表的排列(排列)

    我有一个包含重复元素的列表 即orig 1 1 1 2 2 3 我想创建一个精神错乱 https en wikipedia org wiki Derangement b f orig 这样对于每个位置值b与值不同orig b i orig
  • 生成 M 个箱中 N 个球的所有排列

    我想生成一组排列n球进m垃圾箱 以下一组嵌套列表生成这些排列 n lt 3 m lt 4 v lt rep 0 m for i in n 0 for j in n sum i 0 for k in n sum i j 0 for l in
  • java中数组的所有可能的组合和子集

    给定一个可变维度的数组 例如 数组 1 2 4 5 我需要一种方法来概括数组的所有可能组合和子集 给定一个包含 n 个元素的数组 我需要拥有所有子集 1 个元素的所有子集 2 个元素的所有子集 n 个元素的所有子集 以及每个子集的所有可能排
  • O(N) 排列识别

    这个答案 https stackoverflow com a 36818947 2642059通过比较两个字符串的内容来确定它们是否是排列 如果它们包含相同数量的每个字符 那么它们显然是排列 这是在O N time 但我不喜欢这个答案 因为
  • 对于给定的整数 a,找到总和为 a 的所有唯一的正整数组合

    不是家庭作业问题 我正在回答这些问题here http www careercup com question id 5653595164770304我遇到了这个问题 有人已经回答了 我已经尝试了很多方法来理解所使用的递归 但我无法理解它 有
  • 对元素进行随机排列,使得任何元素都不应出现在其原始索引处

    我有一个对象元素列表 SourceList ResultList Expected Obj A Obj F Obj B Obj C Obj C Obj G Obj D Obj B Obj E Obj A Obj F Obj B Obj G
  • 返回很大范围内的非重复随机值

    我想要一个函数 它可以从一组 n 个整数 0 到 n 1 中生成 k 个伪随机值 而不重复任何先前的结果 k小于或等于n O n 内存不可接受由于尺寸较大n以及我需要重新洗牌的频率 这些是我到目前为止考虑过的方法 Array 通常 如果我想
  • 查找具有重复字母的单词(排列)的排名

    尽管已经发布了很多关于这个问题的文章 但我还是发布了此内容 我不想发布答案 因为它不起作用 这篇文章的答案 查找给定字符串在所有可能的重复排列列表中的排名 https stackoverflow com questions 17620694
  • 如何从 Perl 正则表达式生成所有可能的排列?

    我知道你可以使用列表生成所有排列glob http perldoc perl org functions glob html or 算法 置换 http search cpan org dist Algorithm Permute例如 但如
  • 对(双精度)实数向量进行排序并获得它们

    在 C 中想要对很长的 2 20 实数向量 显然sort 就可以了 在我习惯了 R 的优点之前就已经使用过 Rorder 函数产生导致排序向量的排列 Example x 24 55 22 1 然后是排列 perm 3 2 0 1 贴出原图x
  • C++ 中排列、组合和 PowerSet 的实现 [重复]

    这个问题在这里已经有答案了 我正在寻找使用 C 实现排列 组合和幂集 使用STL 排列 using std next permutation template
  • 如何在R中生成对象的排列或组合?

    如何生成序列r对象来自n物体 我正在寻找一种方法来进行排列或组合 有 没有替换 具有不同和非不同的项目 又名多重集 这与十二倍的方式 http en wikipedia org wiki Twelvefold way 不同的 解决方案可以以
  • 计算非图的所有可能突变[关闭]

    Closed 这个问题需要细节或清晰度 help closed questions 目前不接受答案 我需要根据非常具体的配方构建一个非图解算器 对于每一行 我需要计算所有可能的突变 然后检查该行是否仍然使谜题有效 对于那些不知道非图的人 这
  • CUDA Thrust 和 sort_by_key

    我正在寻找 CUDA 上的排序算法 它可以对元素数组 A 双精度 进行排序 并返回该数组 A 的键 B 数组 我知道sort by keyThrust 库中的函数 但我希望元素数组 A 保持不变 我能做些什么 我的代码是 void sort
  • 不分配内存的重复排列

    我正在寻找一种算法来生成列表中重复 4 个元素 长度 2 1000 的所有排列 Java实现 http en literateprograms org Permutations with repetition 28Java 29 问题是上面
  • 使用正整数参数优化

    我需要解决一个需要比较具有相同列数的两个矩阵的问题 其中之一被操纵 直到获得最佳匹配 我对两个矩阵之间的差异进行评分的方式非常复杂 我仍然需要最终确定它 目前我真正感兴趣的是找到一种仅适用于正整数的搜索 优化算法 我创建了一个简单的示例 其
  • 4 x 3 锁图案

    我遇到了这个 它要求计算在 4x3 网格中可以制作特定长度的锁定图案的方式数 并遵循规则 可能有些点不能包含在路径中 有效的模式具有以下属性 图案可以使用第一次接触的点序列来表示 与绘制图案的顺序相同 从 1 1 到 2 2 的图案与图案不

随机推荐

Powered by Hwhale