loop_calc_pvalue function

loop_calc_pvalue()