Useful reference for serious SAS programmers

I often do bootstrap and simulations in my research, and for some background research, I found the following excellent short article on how to use SAS to do efficient replications/bootstrapping/jackknifing.

Paper 183-2007
Don’t Be Loopy: Re-Sampling and Simulation the SASĀ® Way
David L. Cassell, Design Pathways, Corvallis, OR

http://www2.sas.com/proceedings/forum2007/183-2007.pdf

Here is an elegant example that shows how to do 1000 replications of the Kurtosis of X. Note that proc univariate could be replaced with anything. Discussion of proc append and critique of alternative programs is also useful.

(I will note that it starts by creating a sample that is 1000 times as large as the original, but still, it is very fast given what is being done.)

proc surveyselect data=YourData out=outboot /* 1 */
seed=30459584 /* 2 */
method=urs /* 3 */
samprate=1 /* 4 */
outhits /* 5 */
rep=1000; /* 6 */
run;
proc univariate data=outboot /* consider noprint option here to reduce output */;
var x;
by Replicate; /* 7 */
output out=outall kurtosis=curt;
run;
proc univariate data=outall;
var curt;
output out=final pctlpts=2.5, 97.5 pctlpre=ci;
run;

Leave a Reply

Your email address will not be published. Required fields are marked *