chiSq | R Documentation |
This function is required to perform the discretization based on Chi-square statistic( CACC, Ameva, ChiMerge, Chi2, Modified Chi2, Extended Chi2).
chiSq(tb)
tb |
a vector of observed frequencies |
The formula for computing the χ^2 value is
χ^2 = ∑_{i=1}^2 ∑_{j=1}^k \frac{(A_{ij} - E_{ij})^2}{E_{ij}}
k = number of (no.) classes, A_{ij} = no. patterns in the ith interval, jth class, R_i = no. patterns in the jth class = ∑_{j=1}^k A_{ij}, C_j = no. patterns in the jthe class = ∑_{i=1}^2 A_{ij}, N = total no. patterns = ∑_{i=1}^2 R_ij, E_{ij} = expected frequency of A_{ij} = R_i * C_j /N. If either R_i or C_j is 0, E_{ij} is set to 0.1. The degree of freedom of the χ^2 statistic is on less the number of classes.
val |
χ^2 value |
HyunJi Kim polaris7867@gmail.com
Kerber, R. (1992). ChiMerge : Discretization of numeric attributes, In Proceedings of the Tenth National Conference on Artificial Intelligence, 123–128.
cacc
,
ameva
,
chiM
,
chi2
,
modChi2
and
extendChi2
.
#----Calulate Chi-Square b=c(2,4,1,2,5,3) m=matrix(b,ncol=3) chiSq(m) chisq.test(m)$statistic
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.