
Gets the level of significance for the difference of two means from the selected Covariance object being different from a hypothesized value.
This is Student's ttest for the significance of a difference of means. The test statistic is:
t = (x̄_{1}  x̄_{2}  μ) √ (N / s^{2}) with ndf degrees of freedom. 
In the formula above x̄_{1} and x̄_{2} are the elements of the means vector, μ is the hypothesized difference and N is the number of observations. The value that we use for the (combined) variance s^{2} is:
s^{2} = var_{1} + var_{2}  2 * covar_{12}, 
when the samples are paired, and
s^{2} = var_{1} + var_{2} 
when they are not.
The var_{1} and var_{2} are the variance components for x̄_{1} and x̄_{2}, respectively, and covar_{12} is their covariance. When we have paired samples we assume that the two variances are not independent and their covariance is subtracted, otherwise their covariance is not taken into account. Degrees of freedom parameter ndf usually equals 2(N1).
If the two variances are significantly different, the statistic t above is only approximately distributed as Student's t with degrees of freedom equal to:
ndf = (N1) · (var_{1} + var_{2})^{2} / (var_{1}^{2} + var_{2}^{2}). 
The returned probability p will be the twosided probability
p = 2 * studentQ (t, ndf) 
A low probability p means that the difference is significant.
© djmw, January 2, 2016