Perhaps the easiest way to obtain approximate leave-one-out (LOO) cross-validated predicted probabilities in proc logistic is using the Output statement with the PredProbs=(Xvalidate) option.
http://support.sas.com/documentation/cdl/en/statug/67523/HTML/default/viewer.htm#statug_logistic_syntax27.htm
HOWEVER, note that this assumes the model is something fixed. If you do some predictor selection prior to fitting a model, then the resulting LOO cross-validated predicted probabilities from this approach will be over-optimistic. Unbiased cross- validated estimates require cross-validation of the whole process (predictor selection and model fitting) and not just model fitting.
Now, if this is what you are doing, then another approach is to randomly split the dataset into a few partitions, say 4 (i.e., 4-fold cross-validation). You can do this adding a random variable to the dataset.
http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p0fpeei0opypg8n1b06qe4r040lv.htm
And then conduct the whole process of predictor selection and model fitting 4 times, at each time using 3 folds for predictor selection and model fitting, and the remaining fold to obtain predicted probabilities on data not used in the modeling process. This way, each case is used for both model fitting and independent validation. Because the partition is random, you may expect different results if you start from different partitions, so you can do the 4-fold cross-validation a few times using different random partitions, and for each case, average across the sets of 4-fold cross-validated predicted probabilities.
to store a fitted model and apply it to a different dataset you can use the Store option in proc logistic, combined with proc pml.
http://support.sas.com/documentation/cdl/en/statug/67523/HTML/default/viewer.htm#statug_logistic_syntax33.htm
http://support.sas.com/documentation/cdl/en/statug/67523/HTML/default/viewer.htm#statug_plm_examples01.htm
------------------------------
Andres Azuero
University of Alabama at Birmingham
------------------------------
Original Message:
Sent: 04-20-2015 11:47
From: Tai Yean Teh
Subject: Cross Validation for Logistic Regression
This message has been cross posted to the following eGroups: Young Professionals Group and ASA Connect .
-------------------------------------------Hi. Does anyone know how to do a cross validation for logistic regression on SAS? Thanks!
------------------------------
Tai Yean Teh
Oklahoma State University
alvin.teh@okstate.edu
------------------------------