Statistical Analysis for Education and Psychology Researchers

(Jeff_L) #1

should not be included in your programme (although there is a screen option to turn line
numbers on—type ‘nums on’ on the command line, see options in the appropriate SAS
Language guide).
Line 0001 contains OPTION statement an NODATE, which tells SAS not to print the
date and time at the top of each page of output.
The first DATA statement, line 0002, tells SAS to create a SAS data set called
‘child1’. You can call your SAS data set anything you like provided the name has no
more than 8 characters. You should notice that this SAS statement ends in a semicolon
(;). All SAS statements must do so. For examples, look at each statement in the
programme.
In line 3 the INFILE statement is used to tell the SAS system where to find the
external ASCII data file. Here the file is on the a: directory and is called ‘child1.dat’.
Line 4 of the programme is the format statement for the variables. There are 5 variables,
‘caseid’ in columns 1–3, ‘ageyrs’ in columns 5–6, ‘sex’ in column 8, ‘ses’ in column 10,
and ‘raven’ in column 12. If this fixed format is used, all cases must have the these
variables in the same column positions in the ASCII data file.
Lines 6–8 of the programme have the same function as lines 2–4 but this time the
child2.dat data file is read into the SAS system. In this example there are two data steps
because we have entered two data files (in any session, SAS can handle more than one
data file but by default always refers to the last named data set unless an alternative data
set name is specified).
Line 10 is the PROCEDURE step. PROC COMPARE checks the two SAS data sets,
child1 and child2.
A TITLE is given to the programme output in line 11. Finally, a RUN statement is
used in line 12. This tells the SAS system to execute the statements contained in the SAS
procedure. To actually run the job and submit the data for analysis you can use the
SUBMIT command on the command line or the F8 key in SAS versions 6.10 and 6.08 (or
the F10 key in SAS version 6.04). Depending on the particular procedure you choose and
on your SAS configuration, output is sent to the output window where it can be viewed
and printed.


SAS Output

When a SAS programme is submitted a LOG file is created, and the results of the
analysis are produced in an OUTPUT file. Note, the statistical output appears by default
in an output screen (it can be routed direct to a printer or a computer file). The LOG and
OUTPUT files resulting from the PROC COMPARE statement are shown in Figures 3.4
and 3.5.


0001 NOTE: Copyright (c) 1989 by SAS
Institute Inc., Cary, NC USA. USA.
0002 NOTE: SAS (r) Proprietary Software
6.08
0003 Licensed to UNIVERSITY OF Site
0020900316.
0004

Initial data analysis 41
Free download pdf