An instructor is interested in creating a frequency table of score changes between a pair of tests given in one of his college
courses. The data set Score
contains test scores for his students who took a pretest and a posttest on the same material. The variable ScoreChange
contains the difference between the two test scores. The following statements create the data set:
data Score; input Student $ PreTest PostTest @@; label ScoreChange = 'Change in Test Scores'; ScoreChange = PostTest - PreTest; datalines; Capalleti 94 91 Dubose 51 65 Engles 95 97 Grant 63 75 Krupski 80 75 Lundsford 92 55 Mcbane 75 78 Mullen 89 82 Nguyen 79 76 Patel 71 77 Si 75 70 Tanaka 87 73 ;
The following statements produce a frequency table for the variable ScoreChange
:
title 'Analysis of Score Changes'; ods select Frequencies; proc univariate data=Score freq; var ScoreChange; run;
The ODS SELECT statement restricts the output to the "Frequencies" table; see the section ODS Table Names. The FREQ option in the PROC UNIVARIATE statement requests the table of frequencies shown in Output 4.4.1.
From Output 4.4.1, the instructor sees that only score changes of and occurred more than once.
A sample program for this example, uniex03.sas, is available in the SAS Sample Library for Base SAS software.