MADlib
1.1 A newer version is available
User Documentation
|
SQL functions for cox proportional hazards. More...
Go to the source code of this file.
Functions | |
cox_prop_hazards_result | cox_prop_hazards_regr (varchar source, varchar indepColumn, varchar depColumn, varchar status, integer maxNumIterations=20, varchar optimizer="newton", float8 precision=0.0001) |
Compute cox-regression coefficients and diagnostic statistics. More... | |
Definition in file cox_prop_hazards.sql_in.
cox_prop_hazards_result cox_prop_hazards_regr | ( | varchar | source, |
varchar | indepColumn, | ||
varchar | depColumn, | ||
varchar | status, | ||
integer | maxNumIterations = 20 , |
||
varchar | optimizer = "newton" , |
||
float8 | precision = 0.0001 |
||
) |
To include an intercept in the model, set one coordinate in the independentVariables
array to 1.
source | Name of the source relation containing the training data |
indepColumn | Name of the independent column |
depColumn | Name of the dependent column measuring time of death |
status | Name of the column that determines right censoring support |
maxNumIterations | The maximum number of iterations |
optimizer | The optimizer to use (either 'newton' /'newton' for the newton method |
precision | The difference between log-likelihood values in successive iterations that should indicate convergence. Note that a non-positive value here disables the convergence criterion, and execution will only stop after maxNumIterations iterations. |
coef FLOAT8[]
- Array of coefficients, \( \boldsymbol \beta \)log_likelihood FLOAT8
- Log-likelihood \(l(\boldsymbol \beta)\)std_err FLOAT8[]
- Array of standard errors, \( \mathit{se}(c_1), \dots, \mathit{se}(c_k) \)z_stats FLOAT8[]
- Array of Wald z-statistics, \( \boldsymbol z \)p_values FLOAT8[]
- Array of Wald p-values, \( \boldsymbol p \)condition_no FLOAT8
- The condition number of matrix \( H \) during the iteration immediately preceding convergence (i.e., \( H \) is computed using the coefficients of the previous iteration)num_iterations INTEGER
- The number of iterations before the algorithm terminatedSELECT * FROM cox_prop_hazards_regr( 'sourceName', 'dependentVariable', 'independentVariables' [, numberOfIterations [, 'optimizer' [, precision ] ] ] );
SELECT (cox_prop_hazards_regr('sourceName', 'dependentVariable', 'independentVariables')).coef;
SELECT coef, log_likelihood FROM cox_prop_hazards_regr('sourceName', 'dependentVariable', 'independentVariables');
Definition at line 399 of file cox_prop_hazards.sql_in.