I have inherited some SAS code that uses PROC LIFEREG with inest= that scores data using a survival model, and I need to convert this to an algorithm that can create the scores for records without using SAS (just using SQL). proc lifereg data = indata inest=in_coeff noprint ;
model days_til_lapse * censor_flag2 (0) =
var1 var2
/dist =
Lognormal maxiter=0 ;
output out = score quantile = .49 p=median std=s ;
run; The in_coeff dataset contains 1 record with intercept, var1, var2, X_scale_, x_Dist, etc. intercept = 3.965421927 var1 = 0.0604628213011544 var2 = 0.0903378482875944 I can see in the SAS code that the only thing that is used out of the SCORE dataset is the ID of the records and MEDIAN, where median is the output score that is used as the predictive value for each of the records. I attempted to create an algorithm like I would do in PROC SCORE to re-create the predicted 'median' that is output using: pred_median = 3.965421927 + 0.0604628213011544 * var1 + 0.0903378482875944 * var2 This doesn't seem to be giving me the desired outcome. Can this be done? I have not used Proc Lifereg before, so I'm not certain that this algorithm can be applied in the above manner to score all records, if I just need to do some additional conversion to the PRED_MEDIAN value that I calculated (based on the distribution from the Lifereg), or if this cannot be reproduced in basic SQL logic without using SAS or some other statistical software. Thanks!
... View more