This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy of code from http://spark.rstudio.com/ahmed/permutation/ | |
a = rnorm(1000, 0, 1) | |
b = rnorm(1000, 100, 1.5) | |
# Combine the two datasets into a single dataset | |
# i.e., under the null hypothesis, there is no difference between the two groups | |
combined = c(a,b) | |
# Observed difference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# permutation_test.R | |
# | |
# A function for performing permutation testing that ensures that we sample | |
# from the space of all permutations without replacement. | |
# | |
# Author: Saranga Komanduri (skomanduri@gmail.com) | |
# | |
############################################################################### | |