R: fastest way of finding out of all elements of a vector are identical?

There is a question on SO about this: stackoverflow.com/questions/4752275/test-for-equality-among-all-elements-of-a-single-vector But I was a bit more curious, so! #test data, large vectors v1 = rep(1234, 1e6) v2 = runif(1e6) #functions to try all_the_same1 = function(x) {   range(x) == 0 } all_the_same2 = function(x) {   max(x) == min(x) } all_the_same3 = function(x) {   sd(x)…

Continue Reading

Ethnic heterogeneity and tail effects

Chisala has his 3rd installment up: www.unz.com/article/closing-the-black-white-iq-gap-debate-part-3/ One idea I had while reading it was that tail effects interact with population ethnic/racial heterogeneity. To show this, I did a simulation experiment. Population 1 is a regular population with a mean of 0 and sd of 1. Population 2 is a composite population of three sub-populations:…

Continue Reading