/* the following program will divide a dataset in two randomly */ /* coded by Bjarne Ersbøll */ data train test; * two temporary datasets; set stat2.mini1; * the dataset to be divided; rand=ranuni(7913); * generate a uniform random number from 0 to 1; if rand>0.5 then output train; * approx. 50% observations in each; else output test; proc discrim data=train testdata=test ; class rock; var tm1 tm3 tm7; run;