hanaml.ChisqGoF {hana.ml.r}R Documentation

ChisqGoF

Description

Perform the chi-squared goodness-of-fit(GoF) test to tell whether or not an observed distribution differs from an expected chi-squared distribution.

Usage

hanaml.ChisqGoF(conn.context,
                       data,
                       key,
                       observed.data = NULL,
                       expected.freq = NULL)

Arguments

conn.context

codeConnectionContext
Connection to SAP HANA System

data

DataFrame
Dataset used for training the model.

key

character, optional
Name of the ID column in data.

observed.data

character, optional
Name of column for counts of actual observations belonging to each category. If not given, it defaults to the first non-ID column of data.

expected.freq

character, optional
Name of the expected frequency column. If not given, it defaults to the first non-ID, non-observed.data columns.

Value

Examples

## 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)

[Package hana.ml.r version 1.0.8 Index]