chiSq {discretization} | R Documentation |
Auxiliary function for discretization using Chi-square statistic
Description
This function is required to perform the discretization based on Chi-square statistic( CACC, Ameva, ChiMerge, Chi2, Modified Chi2, Extended Chi2).
Usage
chiSq(tb)
Arguments
tb |
a vector of observed frequencies |
Details
The formula for computing the value is
number of (no.) classes,
no. patterns in the
th interval,
th class,
no. patterns in the
th class =
,
no. patterns in the
the class =
,
total no. patterns =
,
expected frequency of
.
If either
or
is 0,
is set to 0.1. The degree of freedom of the
statistic is on less the number of classes.
Value
val |
|
Author(s)
HyunJi Kim polaris7867@gmail.com
References
Kerber, R. (1992). ChiMerge : Discretization of numeric attributes, In Proceedings of the Tenth National Conference on Artificial Intelligence, 123–128.
See Also
cacc
,
ameva
,
chiM
,
chi2
,
modChi2
and
extendChi2
.
Examples
#----Calulate Chi-Square
b=c(2,4,1,2,5,3)
m=matrix(b,ncol=3)
chiSq(m)
chisq.test(m)$statistic