Crosstabulation (commonly called crosstab) is a method used to analyze two nominal variables. The STATS_CROSSTAB
function takes three arguments: two expressions and a return value of type VARCHAR2
. expr1
and expr2
are the two variables being analyzed. The function returns one number, determined by the value of the third argument. If you omit the third argument, the default is CHISQ_SIG
. The meaning of the return values is shown in Table 54.
Table 54 STATS_CROSSTAB Return Values
Return Value  Meaning 


Observed value of chisquared 

Significance of observed chisquared 

Degree of freedom for chisquared 

Phi coefficient 

Cramer's V statistic 

Contingency coefficient 

Cohen's kappa 
STATS_CROSSTAB Example The following example determines the strength of the association between gender and income level:
SELECT STATS_CROSSTAB (cust_gender, cust_income_level, 'CHISQ_OBS') chi_squared, STATS_CROSSTAB (cust_gender, cust_income_level, 'CHISQ_SIG') p_value, STATS_CROSSTAB (cust_gender, cust_income_level, 'PHI_COEFFICIENT') phi_coefficient FROM sh.customers; CHI_SQUARED P_VALUE PHI_COEFFICIENT    251.690705 1.2364E47 .067367056