Test statistic formula for hypothesis testing