1)Nominal-x2 (chi-square)test ·Examples male Female Sum (row) Fiction 250(90) 200(360) 450 Nonfiction 50(210) 1000(840) 1050 Sum(col) 300 1200 1500 count(male)x count(fiction) 300×450 e11= =90, n 1500 .x2(chi-square)computing as follows: x2=250-90+(50-2102+200-3602+1000-840y =507.93 90 210 360 840 Degree of freedom is(2-1)*(2-1)=1,the final value p<0.001(x 2 10.828),reject the hypothesis.The two attributes are strongly correlated for given group people. 15 Copyright2019 by Xiaoyu Li
Copyright © 2019 by Xiaoyu Li. 15 Examples 1) Nominal-χ 2 (chi-square) test χ 2 (chi-square) computing as follows: male Female Sum (row) Fiction 250(90) 200(360) 450 Nonfiction 50(210) 1000(840) 1050 Sum(col.) 300 1200 1500 507.93 840 (1000 840) 360 (200 360) 210 (50 210) 90 (250 90) 2 2 2 2 2 = − + − + − + − = Degree of freedom is (2-1)*(2-1)=1, the final value p< 0.001 (χ 2 = 10.828 ), reject the hypothesis. The two attributes are strongly correlated for given group people
2)Numeric-correlation coefficient Correlation coefficient (Pearson's product moment coefficient) ∑,(a,-Ab,-B)_∑2(a,b,)-nAB YA.B (n-1)0OB (n-1)0OB n is the number of tuples,4 and B are the mean of A and B,cand oB are the standard deviations of A and B, E(a;bi)is the AB cross-product. IfrA.B0,A and B are positively correlated (A's values increase as B's). .rA.B=0,no correlation between them; 16 rAB <0,negatively Copyright 2019 by Xiaoyu Li
Copyright © 2019 by Xiaoyu Li. 16 Correlation coefficient (Pearson’s product moment coefficient) 2) Numeric-correlation coefficient n is the number of tuples, and are the mean of A and B, σA and σB are the standard deviations of A and B, Σ(aibi ) is the AB cross-product. If rA,B> 0, A and B are positively correlated (A’s values increase as B’s). rA,B = 0, no correlation between them; rAB < 0, negatively. A B n i i i A B n i i i A B n a b nAB n a A b B r ( 1) ( ) ( 1) ( )( ) 1 1 , − − = − − − = = = A B