This is an example solution to Ch1 Problem 1.

 

SAS Code: Copy you SAS Code from the Program Editor window is SAS.

 

* CH1 HOMEWORK PROBLEM 1;

 

DATA HWPROB1;

        INPUT ID AGE GENDER $ GPA CSCORE;

 

INDEX = GPA + 3*CSCORE/500;

 

DATALINES ;

1 18 M 3.7 650

2 18 F 2.0 490

3 19 F 3.3 580

4 23 M 2.8 530

5 21 M 3.5 640

;

 

PROC PRINT DATA=HWPROB1;

        TITLE 'Roster in Student';

        ID ID;

        VAR GPA CSCORE;

RUN;

 

PROC MEANS DATA=HWPROB1 N MEAN STD STDERR MAXDEC=1;

        TITLE 'Descriptive Statistics';

        VAR GPA CSCORE;

RUN;

 

PROC SORT DATA=HWPROB1;

        BY INDEX;

RUN;

 

PROC PRINT DATA=HWPROB1;

        TITLE 'Roster in Student';

        ID ID;

        VAR GPA CSCORE INDEX;

RUN;

 

SAS Output: To save the SAS output, click on the Output window is SAS then go to File > Save As >  Give a file name and for the type select RTF.  The RTF format can be read into MS Word.

 

Roster in Student     12:33 Tuesday, January 11, 2000   1

 

                                      ID    GPA    CSCORE

 

                                       1    3.7      650

                                       2    2.0      490

                                       3    3.3      580

                                       4    2.8      530

                                       5    3.5      640

 

Descriptive Statistics                                    2

12:33 Tuesday, January 11, 2000

 

                                      The MEANS Procedure

 

                 Variable    N            Mean         Std Dev       Std Error

                 -------------------------------------------------------------

                 GPA         5             3.1             0.7             0.3

                 CSCORE      5           578.0            69.1            30.9

                 -------------------------------------------------------------

 

Roster in Student     12:33 Tuesday, January 11, 2000   3

 

                                  ID    GPA    CSCORE    INDEX

 

                                   2    2.0      490      4.94

                                   4    2.8      530      5.98

                                   3    3.3      580      6.78

                                   5    3.5      640      7.34

                                   1    3.7      650      7.60