p_value function

Compute the P value