Correct way to calculate one and two way p-values for a test statistic
0
0
Entering edit mode
8.1 years ago
denalitastic ▴ 30

Assume a sample-wise permutation test to define a pvalue based on some test statistic. I have the test statistic of my comparison of interest. Shouldn't the sum of both one way pvalues = 1 for my statistic . I.e those more extreme on either side.

Below I have 2 snippets of code where I calculate the permutation values(current_stat) more extreme than my test statistic (my_stat) for both one way pvalues. Which snippet is done correctly? Here i am in a for loop going over random samples The two way pval is of course absolute_value(curr_stat) >=absolute_value(my_stat)

Here

1

if (current_stat >= absolute_value(my_stat)){
            found_right++;
        }
        if (current_stat <= -absolute_value(my_stat)){
            found_left++;
        }

2

if (current_stat >= my_stat){
            found_right++;
        }
        if (current_stat <= my_stat){
            found_left++;
        }

Thank you.

p-value • 1.1k views
ADD COMMENT

Login before adding your answer.

Traffic: 1522 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6