# One sample permutation test on skewed data

I have one sample of values, each of them is a z-score from mutually independent z-scored distributions. I aimed at testing that the mean value of the sample is larger than zero. Originally I wanted to test it using one-sample permutation test, however, the z-scored distributions turn out to be skewed, so the sign flipping seems to be invalid. The distributions are skewed in a way, where most of the datapoints are negative but close to zero, while some of the data are positive with higher absolute value. Which test is appropriate in this situation?

• Thanks for comment, I just want to clarify that I am not performing a test on z-scored distribution, but rather on a sample, where each of the values is a z-score, but from different distributions. – NeuroPanda Mar 24 at 23:40
• But you still haven't said what you mean by z-scored. And what do you mean by 'different distributions'? Not sure how to make sense of a test on a dataset that is not a sample from a particular definable distribution, population, or process. – BruceET Mar 24 at 23:48
• The z-scores were obtained by the formula you are mentioning (substracting mean and dividing by std). The different distributions correspond to different measurments, where within within each measurment some conditions were shuffled to obtain random distribution and observed value is z-scored in respect to that distribution, This has been done for multiple experiments/measurments which rendered z-score values constituing the tested sample. – NeuroPanda Mar 24 at 23:58
• You give me limited choices how to try to help. Options are (a) I just pick a skewed sample with some negative values and try to illustrate a permutation test for $0$ mean. (b) You give me some data: along a row, commas separating values. (c) You give me an idea how to simulate data that might be enough like yours to be helpful. What is sample size? – BruceET Mar 25 at 0:05
• Thank you, would be grateful even for (a). I am meanwhile thinking of how to describe nature of my data in simple and meaningful way. The sample size to perform the test on is 26 values. – NeuroPanda Mar 25 at 0:15

Data. Here is a right skewed sample that has some negative values, but a sample average $$A$$ somewhat above $$0.$$

set.seed(1234)
n = 200;  x = rexp(n, .1) - 8
a.obs = mean(x); a.obs
[1] 2.045604
stripchart(x, pch="|")
abline(v = mean(x), col="greens")


Permutation test. Now we use the sample mean as metric, permute signs of the $$n = 200$$ observations, and find the average a.perm of the sign-permuted data. With $$10\,000$$ such values we can get a good idea of the permutation distribution sample averages.

The null hypothesis that the mean is $$0$$ for the distribution from which x was randomly sampled is rejected. The P-value of the test is about $$0.0035 < .05 = 5\%.$$

set.seed(326)
a.prm = replicate(10^4,
mean(sample(c(-1,1),n,rep=T)*x))
mean(abs(a.prm)>=abs(a.obs))
[1] 0.0035   # P-value of permutation test

hist(a.prm, prob=T, br=30, col="skyblue2", main="Permutation Dist'n")
abline(v = c(a.obs,-a.obs), lwd=2, col="red", lty="dotted")