CoxHazardRatio Example 2: No Reference Values, Partition by Name or ID - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.00
1.0
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

The input table can be partitioned by either name or id and the hazard ratio is determined. Because reference values are not used in this example, partitioning by id gives the same result as identity comparison (that is, the patients are compared with themselves and the hazard ratio is one).

Input

SQL Call

SELECT * FROM CoxHazardRatio (
  ON lungcancer_coef AS cox_coef_model DIMENSION
  ON lc_new_predictors AS predicts PARTITION BY name, id
  USING
  PredictFeatureNames ('trt','celltype','karno','diagtime','age','prior')
  PredictFeatureColumns ('trt','celltype','karno','diagtime','age','prior')
  Accumulate ('id','name')
) AS dt ORDER BY 1, 2, 3, 4, 5, 6, 7, 8;

Output

id name trt celltype karno diagtime age prior trt_ref celltype_ref karno_ref diagtime_ref age_ref prior_ref hazardratio
1 John standard squamous 30 4 63 yes standard squamous 30 4 63 yes 1
2 James standard large 80 12 41 no standard large 80 12 41 no 1
3 Stella test smallcell 70 3 72 no test smallcell 70 3 72 no 1
4 Steffi test adeno 60 5 63 yes test adeno 60 5 63 yes 1