/// <summary>
/// Constructs a Chi-Square Test.
/// </summary>
/// <param name="statistic">The test statistic.</param>
/// <param name="degreesOfFreedom">The chi-square distribution degrees of freedom.</param>
/// <param name="threshold">The significance threshold. By default, 0.05 will be used.</param>
///
public ChiSquareTest(double statistic, int degreesOfFreedom, double threshold)
{
this.Statistic = statistic;
this.Threshold = threshold;
this.distribution = new ChiSquareDistribution(degreesOfFreedom);
this.PValue = distribution.SurvivalFunction(Statistic);
}