25.10.2016 Views

SAP HANA Predictive Analysis Library (PAL)

sap_hana_predictive_analysis_library_pal_en

sap_hana_predictive_analysis_library_pal_en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.7.2 Chi-Squared Test for Independent<br />

The chi-squared test for independent tells whether observations of two variables are independent from each<br />

other.<br />

The chi-squared value is defined as:<br />

where O i,j is an observed frequency and E i,j is an expected frequency. Then X 2 will be used to calculate a p-value<br />

by comparing the value of chi-squared to a chi-squared distribution. The degree of freedom is set to<br />

(r-1)*(c-1).<br />

Prerequisites<br />

●<br />

●<br />

The input data contains an ID column in the first column with the type of integer, varchar, or nvarchar and<br />

the other columns are of integer or double data type.<br />

The input data does not contain null value. The algorithm will issue errors when encountering null values.<br />

CHISQTESTIND<br />

This function does the Pearson’s chi-squared test for independent according to the user’s input.<br />

Procedure Generation<br />

CALL SYS.AFLLANG_WRAPPER_PROCEDURE_CREATE (‘AFL<strong>PAL</strong>’, ‘CHISQTESTIND’,<br />

‘’, '', );<br />

The signature table should contain the following records:<br />

Table 368:<br />

Position Schema Name Table Type Name Parameter Type<br />

1 IN<br />

2 IN<br />

3 <br />

4 <br />

OUT<br />

OUT<br />

Procedure Calling<br />

CALL . (, ,<br />

, ) with overview;<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Predictive</strong> <strong>Analysis</strong> <strong>Library</strong> (<strong>PAL</strong>)<br />

<strong>PAL</strong> Functions P U B L I C 497

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!