mattwigway / peak-spreading

Are transportation peak hours getting longer?
MIT License
0 stars 0 forks source link

P-values over 1 #38

Closed mattwigway closed 1 year ago

mattwigway commented 2 years ago

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.