next up previous
Next: The logic of the Up: Some preliminaries you should Previous: Some preliminaries you should

SAS basics

I assume you know how to read data into SAS, create a dataset, and run a data step. I assume familiarity with code that says
     data first(rename=(ret=unsquared_ret));
         set crsp.msf(keep=permno date ret);
	 squared_ret=ret**2;
     run;
You should also know how to sort datasets and run, say, proc means:
     proc sort data=first;
         by date;
     run;
     proc means data=first;
         by date;
	 var ret;
     run;

You should know how to redirect output:

     proc sort data=first;
         by date;
     run;
     proc means data=first noprint;
         by date;
	 var ret;
	 output out=sumrets sum(ret)=sum_ret;
     run;



Andre de Souza 2012-11-19