A test method of statistics. Like fitness test, it belongs to X2 test (chi-square test), which is a hypothesis test to judge whether two factors are related or independent according to frequency data. Suppose there are two classified variables, X and Y, with values ranging from {x 1, x2} and {y 1, y2}, and the sample frequency series table is as follows:
Total of Y 1 y2
x 1 a b a+b
x2 c d c+d
A+c b+d a+b+c+d in total
If we want to infer that the statement is H1:"X is related to Y", we can use independence test to examine whether the two variables are related, which can give the reliability of this judgment more accurately. Specifically, the value of the random variable K 2 (that is, the square of K) K2 = n (ad-BC) 2/[(a+b) (c+d) (a+c) (b+d)] is calculated from the data in the table, where n=a+b+c+d is the sample size K, and when the data in the table A, B+c+d are
k 0.455 0.708 1.323 2.072 2.706
p(k^2≥k)0.05 0.025 0.0 1.005 0.00 1
k 3.84 1 5.024 6.635 7.879 10.828
For example, when the value of the variable K 2 of "X is related to Y" is 6. 109, according to the table, because 5.024 ≤ 6. 109.