SAS Instructions

 

Instructions for SAS

 
Reading the data:

Reading the data from an external file can be done in two ways: First, one can use the import command from the menu bar:

Click on the "Import" option under the "File" menu.

When this import window comes up, simply click the "Next" button since the format of the dat a file matches the default settings.

In the Select file window, click the "Browse" button and find the file to which you saved the data. Then click the "Options..." button.

Again the defaults match the data file characteristics so we can just click the "OK" button.

For this window under the "MEMBER" bar, we enter the name SAS will use to refer to the data set after entering the name you wish to use click "Finish" and the data will be ready to be used in SAS.

 

Or if you are using a strictly textual SAS interface, you can use the following commands:

data one;
  infile in sfdialog;
  input subno sex $ aw an cxew cxen;
  weap = cxew-aw;
  nonweap = cxen-an;
  diff = weap-nonweap;
 
 

Summary table:

proc means;
  var aw an cxew cxen; 
  run;

See output

Descriptive Statistics (individual plots)

proc univariate plot;
  var aw an cxew cxen;
   run;

See output

*to get the side by side box plots, first the data has to be re-arranged in the data file - we create a new variable RT and a category variable NAME:

data new;
length name $ 5;
   set one;
   array y(4) aw an cxew cxen;
   do c = 1 to 4;
					select (c);
       when (1) name= 'aw';
       when (2) name= 'an';
       when (3) name= 'cxew';
       when (4) name= 'cxen';
       otherwise name= 'na';
    	end;
     RT=y(c);
     output;
   end;
   drop aw an cxew cxen weap nonweap diff;
 

*then sorted:

proc sort;
 by name;
 

*then use the same procedure as before:

proc univariate plot;
 var RT;
 by name;

See output

Inferential Statistics:

within-Subjects ANOVA:
proc glm data=one;
model aw an cxew cxen = /nouni;
repeated wordtype 2,prime 2;
See output

t-test 
proc means data=one n t prt;
var diff;
See output


Between/Within subjects ANOVA
proc glm data=one ;
class sex;
model aw an cxew cxen = sex/nouni;
repeated wordtype 2, prime2;
run;

See output