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
- CoxCoeffModel: lungcancer_coef, output by CoxPH Example
- PredictorValues: lc_new_predictors, as in CoxHazardRatio Example: No Reference Values
SQL Call
SELECT * FROM CoxHazardRatio ( ON lungcancer_coef AS CoxCoeffModel DIMENSION ON lc_new_predictors AS PredictorValues PARTITION BY name, id USING PredictFeatureNames ('trt','celltype','karno','diagtime','age','prior') PredictFeatureColumns ('trt','celltype','karno','diagtime','age','prior') Accumulate ('id','name') ) AS dt;
Output
id name trt celltype karno diagtime age prior trt_ref celltype_ref karno_ref diagtime_ref age_ref prior_ref hazardratio -- ------ -------- --------- ----- -------- --- ----- -------- ------------ --------- ------------ ------- --------- ----------- 4 steffi test adeno 60 5 63 yes test adeno 60 5 63 yes 1.0 1 john standard squamous 30 4 63 yes standard squamous 30 4 63 yes 1.0 3 stella test smallcell 70 3 72 no test smallcell 70 3 72 no 1.0 2 james standard large 80 12 41 no standard large 80 12 41 no 1.0
Download a zip file of all examples and a SQL script file that creates their input tables.