I used the PROC PHREG command to create a cox model. How then do I use the train and test split command in the proc phreg command. Or even the option of training the initial model on bootstrap samples.
I don't understand.
You could use TRAIN dataset to build a COX model. and using BASELINE statement to score a new dataset. Like:
data test; format gender gender.; input gender age; datalines; 0 69.845947 1 69.845947 ; run; proc phreg data = train plots(overlay)=(survival); class gender; model lenfol*fstat(0) = gender age; baseline covariates=test out=base / rowid=gender; run;
PHREG does not have any options to create test/train data sets or employ bootstrap resampling methods directly. You would need to create them prior to running the procedure.
The issue, which was mentioned previously, is that PH models cannot truly be used to extrapolate beyond the time range of the data that the model was built upon. Trying to automate the process of creating test and train data sets is difficult for that reason--your validation data set would need to have the identical time range as the data set you used to build the model.
Train and test data is relevant for prediction. Then it is probably not a Cox model you want to fit, as the Cox model does not predict anything. It only estimate the hazard rate ratios.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.