calc_pvalue function

Calculate p-values