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 的相关文章

  • JavaScript 中重复元素的独特排列

    假设我们有元素 0 和 1 它们可以出现多次 就像00 00 11 00 00 11 11 or 01 11 为了更好的可读性分成 2 组 我已经有一个函数来生成所有独特的排列 class UniqueElement constructor
  • O(N) 排列识别

    这个答案 https stackoverflow com a 36818947 2642059通过比较两个字符串的内容来确定它们是否是排列 如果它们包含相同数量的每个字符 那么它们显然是排列 这是在O N time 但我不喜欢这个答案 因为
  • 在 R 数据框中创建所有可能的列排列

    我有一个看起来像这样的 df code 1 code 2 code 3 code 4 1 82 93 NA NA 2 15 85 93 NA 3 93 89 NA NA 4 81 NA NA NA 我想生成一个新的 df 它包含所有可能的列
  • (任何语言)使用交换查找向量中元素的所有排列

    今天在实验室会议上有人问我这个问题 我们可以想象一个包含元素 1 N 1 长度为 N 的向量 是否存在生成向量中元素的所有排列或顺序的算法 系统 方法 一种建议的方法是交换随机元素 显然 如果存储所有先前生成的排列以供将来参考 那么这将起作
  • 如何从 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
  • 排列未排序

    我知道一种算法 可以在网上找到 对排列进行排名 即给定一个排列 将整数索引返回到按字典顺序排序的排列列表中 但我不知道unrank执行相反操作的算法 给定索引 i 返回按字典顺序排列的第 i 个排列 由于我找不到任何内容 有人可以透露一些信
  • SPOJ:洗牌

    最近开始解答网上评委的问题 我被困在SPOJ 中的这个问题 http www spoj pl problems CODESPTC 下面是洗 N 张牌的算法 这些牌被分成 K 个相等的牌堆 其中 K 是 N 的因数 底部的 N K 张牌按相同
  • 仅一个循环的排序和非排序排列

    我想按照给定长度的字典顺序对一个周期的排列进行排名和取消排名 具有一个循环的排列是您可以在此循环中访问每个元素的位置 p 2 3 1 是一个循环的排列 排名1 p 3 1 2 也有 1 个循环 但等级为 2 因为排列在字典顺序上比第一个大
  • 计算非图的所有可能突变[关闭]

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

    我正在寻找 CUDA 上的排序算法 它可以对元素数组 A 双精度 进行排序 并返回该数组 A 的键 B 数组 我知道sort by keyThrust 库中的函数 但我希望元素数组 A 保持不变 我能做些什么 我的代码是 void sort
  • 可能的数独谜题的数量[关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 Wiki http en wikipedia org wiki Mathematics of Sudoku http en wikiped
  • 在 C 中打印字符串的所有排列

    我正在学习回溯和递归 并且我陷入了打印字符串所有排列的算法 我用以下方法解决了它贝尔算法 http programminggeeks com bell algorithm for permutation 用于排列 但我无法理解递归方法 我在
  • 修改排列算法以防止重复打印输出的策略

    我一直在审查实践算法 目前正在研究一种我非常喜欢的排列算法 void permute char set int begin int end int range end begin if range 1 cout lt lt set lt l
  • 如何找到排列的索引

    index List Idx Predicate will get List with permutation and I want to know index of permutation For example index 4 1 3
  • 分隔字符串

    给定一个字符串 我想生成所有可能的组合 换句话说 在字符串中的某处放置逗号的所有可能方法 例如 input abcd output abcd abc d ab cd ab c d a bc d a b cd a bcd a b c d 我对
  • 为什么循环引导迭代算法的数组大小必须为 3^k+1?

    The 循环引导迭代算法 http www geeksforgeeks org an in place algorithm for string transformation 是一种通过将所有偶数项移至前面并将所有奇数项移至后面同时保留其相
  • 如何生成排列?

    我的问题是 给定一个长度为 n 的列表 L 和一个整数 i 使得 0 对于任意 i 和任意 2 个列表 A 和 B perm A i 和 perm B i 都必须将 A 和 B 的第 j 个元素映射到 A 和 B 相同位置的元素 对于任何输
  • 如何在 R 中建立具有某些条件的排列[重复]

    这个问题在这里已经有答案了 我是 R 新手 有点困惑 假设我有一个向量 c 1 2 3 4 5 6 我想生成具有四个元素的排列 每个排列应涉及 1 和 5 谢谢 您可以使用permutations https www rdocumentat
  • Excel - 确定排列的奇偶性

    我正在处理一个 Excel 工作表 需要确定大小数字的垂直数组的奇偶校验N 该数组包含来自的每个数字1 to N每一次正好一次 在这种情况下 奇偶校验被定义为将加扰数组转换为从小到大排序的数组所需的交换次数 例如 数组 3 1 2 4 具有

随机推荐

Powered by Hwhale