First attempt at making predictions from a Cox regression model using 1) the Save Option to save the model information
in an xml file; and 2) the Scoring Wizard. The second step fails for some reason. When running through the menus, one of the displays says that my censoring variable is the target variable, and that the outcome variable used is one of the predictors. First
I thought that it might make difference if the role for the variables were defined, setting the outcome to be a target, but it made no difference.
It seems as if the model information becomes misspecified in the regression. This has worked before in OLS regression,
so I expected everything would work here as well. Anyone who has seen this behavior before? A short version of the syntax:
FILE HANDLE dir /NAME=''. DATA LIST LIST/t(F2) status(F1) age(F2). BEGIN DATA 23 1 56 12 1 65 25 0 76 32 0 58 END DATA. DATASET NAME pred0 WINDOW=FRONT. COXREG t /STATUS=status(1) /METHOD=ENTER age /OUTFILE=PARAMETER('dir/pred_test.xml') /CRITERIA=PIN(.05) POUT(.10) ITERATE(20). DATA LIST LIST/status(F1) age(F3). BEGIN DATA 1 60 END DATA. DATASET NAME pred1 WINDOW=FRONT. COMPUTE t=$SYSMIS. EXECUTE. *Here I tried to use the menus, Utilities/Scoring Wizard, where the first display says “Target: status” and “Predictor:
t, age” which is not correct, it should be “Target: t” and “Predictor: age”. MODEL HANDLE NAME=pred_test FILE='dir/pred_test.xml' /OPTIONS MISSING=SUBSTITUTE. COMPUTE PredictedValue=APPLYMODEL(pred_test, 'PREDICT'). COMPUTE CumulativeHazard=APPLYMODEL(pred_test, 'CUMHAZARD'). EXECUTE. MODEL CLOSE NAME=pred_test.
Robert Lundqvist
|
You need to put in a time in your pred1 dataset (we all die eventually!).
I don't have any formulas memorized offhand for figuring out say the median survival time given a set of covariates. (You need to pick one of a few different ways to estimate the baseline hazard function regression I think?) One way in the current scoring wizard though is to submit a string of multiple times at some reasonable resolution, then pick up the time when it crosses 50% (or whatever). ----- Andy W [hidden email] http://andrewpwheeler.wordpress.com/ -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Free forum by Nabble | Edit this page |