Examples | Factor Analysis | Vantage Analytics Library - Examples - Vantage Analytics Library

Vantage Analytics Library User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Vantage Analytics Library
Release Number
2.2.0
Published
March 2023
Language
English (United States)
Last Update
2024-01-02
dita:mapPath
ibw1595473364329.ditamap
dita:ditavalPath
iup1603985291876.ditaval
dita:id
zyl1473786378775
Product Category
Teradata Vantage

Required Parameters Only

Returns result set, which cannot be subsequently scored.

call td_analyze (
  'factor',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;'
);

Return Reports in Output Table

Returns output table, which can be subsequently scored.

call td_analyze (
  'factor',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;'
   outputdatabase = val_results;
   outputtablename = myFactorOutput;'
);

Show output table:

SELECT * FROM val_results.myFactorOutput;

Return Near Dependency Report

Threshold values are unrealistic but produce results with this data.

call td_analyze (
  'factor',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;'
   neardependencyreport = true;
   conditionindexthreshold = 3;
   varianceproportionthreshold = .3;'
);

Return Reports in Output Table with Two groupby Columns

Output table has one row for each group by column combination.

call td_analyze (
  'factor',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;'
   outputdatabase = val_results;
   outputtablename = myFactorOutputGB;
   groupby = gender, marital_status;'
);

Show output table:

SELECT * FROM val_results.myFactorOutputGB;

Build Matrix and Do Factor Analysis

Factor Analysis uses subset of matrix columns.

Build matrix:

call td_analyze (
  'matrix',
  'matrixtype = esscp;
   database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children, nbr_children;
   outputdatabase = val_results;
   outputtablename = matrix1;'
);

Show output table:

SELECT * FROM val_results.matrix1 ORDER BY rownum;

Do factor analysis:

call td_analyze (
  'factor',
  'matrixinput = true;
   database = val_results;
   tablename = matrix1;
   columns = age, years_with_bank, nbr_children;'
);

Build Matrix with groupby Column and Do Factor Analysis

Build matrix:

call td_analyze (
  'matrix',
  'matrixtype = esscp;
   database = val_source;
   tablename = customer;
   columns = income, age, age, nbr_children;
   outputdatabase = val_results;
   outputtablename = matrix1GB;
   groupby = gender;'
);

Show output table:

SELECT * FROM val_results.matrix1GB ORDER BY gender, rownum;

Do factor analysis:

call td_analyze (
  'factor',
  'matrixinput = true;
   database = val_results;
   tablename = matrix1GB;
   columns = age, years_with_bank, nbr_children;
   groupby = gender;'
);

Factor Analysis with Varimax Rotation

call td_analyze (
  'factor',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;
   rotationtype = varimax;'
);

Factor Analysis with Prime Factor Variables Report

call td_analyze (
  'factor',
  'database = val_source;
   tablename = customer;
   columns = age, years_with_bank, nbr_children;
   flr = true;
   fvr = true;
   thresholdpercent = 0.9;
   fvlr = true;'
);