| hanaml.ChisqGoF {hana.ml.r} | R Documentation |
Perform the chi-squared goodness-of-fit(GoF) test to tell whether or not an observed distribution differs from an expected chi-squared distribution.
hanaml.ChisqGoF(conn.context,
data,
key,
observed.data = NULL,
expected.freq = NULL)
conn.context |
codeConnectionContext |
data |
|
key |
|
observed.data |
|
expected.freq |
|
Comparsion between the actual counts and the expected counts :
DataFrame
structured as follows:
- ID column, with same name and type as data's ID column
- Observed data column, with same name as data's observed_data column,
but always with type DOUBLE.
- EXPECTED, type DOUBLE, expected count in each category.
- RESIDUAL, type DOUBLE, the difference between the observed counts and the
expected counts.
Statistical outputs : DataFrame
including the calculated chi-squared value,
degrees of freedom and p-value, structured as follows:
- STAT_NAME, type NVARCHAR(100), name of statistics.
- STAT_VALUE, type DOUBLE, value of statistics.
## Not run:
Input DataFrame for Preprocessing:
> data
ID OBSERVED P
0 0 519.0 0.3
1 1 364.0 0.2
2 2 363.0 0.2
3 3 200.0 0.1
4 4 212.0 0.1
5 5 193.0 0.1
Create chisquaredfit instance:
> res <- hanaml.ChisqGoF(conn, data)
Expected output:
> res[[1]]$Collect()
ID OBSERVED EXPECTED RESIDUAL
0 0 519.0 555.3 -36.3
1 1 364.0 370.2 -6.2
2 2 363.0 370.2 -7.2
3 3 200.0 185.1 14.9
4 4 212.0 185.1 26.9
5 5 193.0 185.1 7.9
## End(Not run)