When doing per-sensor permutation tests. I see how this can happen:
if obs_diff <= mean(sampling_dist_diff_means)
pval = 2 * mean(sampling_dist_diff_means .< obs_diff)
else
pval = 2 * mean(sampling_dist_diff_means .> obs_diff)
end
If mean(sampling_dist_diff_means) is skewed enough and obs_diff is close enough to it we may get more than half of the observations less than the observed difference. Confirm this formula is correct.
When doing per-sensor permutation tests. I see how this can happen:
If mean(sampling_dist_diff_means) is skewed enough and obs_diff is close enough to it we may get more than half of the observations less than the observed difference. Confirm this formula is correct.