Permutation Test for matlab
This is taken and copied from github/behinger/permtest: I couldn’t find a simple permutation test for matlab, thus I decided to implement it on my own. I got inspired by the “statmod”-R package and followed Phipson & Smyth 2010’s recommendations. How to Use: [code lang=matlab] permtest(randi([1,5],100),randi([3,8],100)) permtest(randi([1,5],100),randi([3,8],100),10000) permtest(randi([1,5],100),randi([3,8],100),[],\"conservative\") % usually the fastest implementation [/code] Permutations / Randomization I chose to do permutations with repeats. This complicates p-values, but in the end I found it to be faster (and scales better). P-Values There are three methods implemented to get the p-value: b = permutations with greater value than test-statistic m_t = number…