Syntax | Chi-Squared Tests | Vantage Analytics Library - Syntax - Vantage Analytics Library

Vantage Analytics Library User Guide

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Lake
Product
Vantage Analytics Library
Release Number
2.2.0
Published
June 2025
ft:locale
en-US
ft:lastEdition
2025-07-02
dita:mapPath
ibw1595473364329.ditamap
dita:ditavalPath
iup1603985291876.ditaval
dita:id
zyl1473786378775
Product Category
Teradata Vantage
CALL td_analyze (
  'chisquaretest',
  'required_parameter_list [ optional_parameter; [...] ]'
);
required_parameter_list
database = input_database_name;
tablename = input_table_name;
optional_parameter
{ columnofinterest = column_name |
  columns = column_name [,...] |
  fallback = { true | false } |
  firstcolumns = column_name [,...] |
  gensqlonly = { true | false } |
  groupby = column_name [,...] |
  multiset = { true | false } |
  outputdatabase = output_database_name |
  outputtablename = output_table_name |
  overwrite = { true | false } |
  secondcolumns = column_name [,...] |
  statsdatabase = stats_database_name |
  teststyle = { chisq | median } |
  thresholdprobability = threshold_prob
}

Syntax Elements

database
The database containing the table to analyze.
tablename
The table containing the columns to analyze. It must reside in the database indicated by the database parameter.
columnofinterest
[Optional] Only if teststyle=median, the input table column that represents the dependent variable (numeric). It must reside in the table indicated by the tablename parameter.
columns
[Optional] Only if teststyle=median, the input table columns that represent the independent variables (categorical). They must reside in the table indicated by the tablename parameter.
fallback
[Optional] Whether to give the output table the FALLBACK attribute.
Default: false
firstcolumns
[Optional] Only if teststyle=chisq, one or more input table columns that represent the first variable pairs for analysis.
If the product of the number distinct values in these column pairs exceeds 2000 and gensqlonly=false, the analysis of that combination is skipped.
The number of combinations of firstcolumns and secondcolumns cannot exceed 100.
gensqlonly
[Optional] True returns the SQL for the function as a result set but does not run it.
False runs the SQL for the function but does not return it as a result set.
Default: false
groupby
[Optional] The columns for which to separately analyze each value or combination of values.
Disallowed with teststyle=chisq.
Default behavior: Input is not grouped.
multiset
[Optional] Whether to give the output table the MULTISET attribute.
Default: false
outputdatabase
[Optional] The name of the database to contain the analysis results table.
outputtablename
[Optional] The name of the table to store the analysis results.
Default behavior: Function returns results as a result set but does not create an output table.
secondcolumns
[Optional] Only if teststyle=chisq, one or more input table columns that represent the second variable pairs for analysis.
Pairs are a combination of columns 1 and 2.
statsdatabase
[Optional] The database where the statistical test metadata tables are installed.
Default behavior: The function searches the source database for these tables.
teststyle
[Optional] The test style, chisq (chi-squared) or median.
Default: chisq
thresholdprobability
[Optional] The threshold (alpha) probability, below which the null hypothesis is rejected.
Default: 0.05