Reply To: Help me do a Permutation Test

#14057
Dan Damelin
Keymaster

I too thought of the Scrambler, but because we don’t have a ranking function, I tried making this using the Sampler. I set up two devices and sample them without replacement, so we get any number of MPH and Year pairings. You are right that we can’t automate doing the exact number of unique permutations, but one might argue that understanding if we had lots of samples where we randomly pair MPH and Year, and then calculate the rank sum we will get a sense of how likely our Actual Rank Sum compares. This CODAP doc does that.

I used a special variable we have called caseindex, which provides the rank as long as we have sorted them. Then we can calculate the rank sum, or the difference as you did in your example.

Does this help get closer to what you want? (If we had a rank() function then this could be done simpler using the Scrambler.