/*Next, to ensure the variable descriptions print out, we will need to create a format.*/

DATA SASUSER.AOD;
     SET SASUSER.AOD;
     PROC FORMAT;
     VALUE Rcode 0='White'
                               1='Black'
                               2='Asian'
                               3='Hispanic';
                    Gen    0='Male'
                               1='Female';
                    GRP   0='Control Group'
                              1='Treatment Group';
                    Mar   0='Single'
                              1='Married'
                              2='Divorced';
RUN;

DATA SASUSER.AOD;
     SET SASUSER.AOD;
     FORMAT RACE Rcode. GENDER Gen. GROUP GRP. STATUS Mar.;
RUN;

/*Now you are ready to get some descriptive statistics.  For our purposes, only one case of Frequencies and Means are outlined.  Many can be completed using these steps.*/

PROC FREQ DATA=SASUSER.AOD;
     TABLE GROUP * GENDER/CHISQ;
     TITLE 'The frequency of gender by group assignment';
RUN;

PROC MEANS DATA=SASUSER.AOD N MEAN STD STDERR MIN MAX MAXDEC=2;
     CLASS RECALL;
     VAR SBP DBP CHOLEST RESULTS;
     TITLE 'Means by Recall';
RUN;

/*This step is to sort the dataset so that ID's is in ascending order.*/

PROC SORT DATA=SASUSER.AOD;
        BY ID;
RUN;

/*This next step is to correct the data set, ensuring that each participant is represented only row.*/

PROC TRANSPOSE DATA=SASUSER.AOD OUT=SASUSER.NEW; /*A new data set is created.*/
        BY ID--NUMBERCH;
        ID RECALL;
        VAR RESPONSE;
RUN;

Return to Previous Page                         Forward to Next Page

To contact us:

Phone: 607-255-9991
Email: mls63@cornell.edu