Skip to content

Instantly share code, notes, and snippets.

View Sarkom's full-sized avatar

Saranga Komanduri Sarkom

View GitHub Profile
@Sarkom
Sarkom / simple_permutation_test.R
Created October 19, 2014 22:12
Simple permutation testing code from http://spark.rstudio.com/ahmed/permutation/ (used to show the same effect as the more complex code: https://gist.github.com/Sarkom/95e3c7ecfcdbddeec959)
# 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
@Sarkom
Sarkom / permutationtest.R
Last active August 29, 2015 14:07
Permutation Test R code - performs permutation testing while trying to ensure that we sample from the space of all permutations without replacement.
# 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)
#
###############################################################################