Question: Correct way to calculate one and two way p-values for a test statistic
0
gravatar for denalitastic
2.0 years ago by
denalitastic0 wrote:

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 • 460 views
ADD COMMENTlink written 2.0 years ago by denalitastic0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1224 users visited in the last hour