q test statistic