SAS Example Problem Number 7 - Proc Corr
Overview
This is an example problem that extends the data we
used in the data step example and uses proc corr
to look for potential correlations among the variables.
Example Problem
We want to create a SAS program named example2.sas and a data
file named example2.dat.
Problem Definition
We have a data file that has 5 variables CASEID, MATHSAT, SCORE,
SEX, and TEACH. Where:
CASEID - unique identifier for a subject
MATHSAT - SAT score on Mathematics subject area
SCORE - Calculus average at the end of the semester.
SEX - Sex of the person (1 is male, 2 is female)
TEACH - Student rating of teacher (1 very bad, 2 bad, 3 average, 4 good, and
5 very good).
We will ultimately want to analyze the relation of MATHSAT and final
calculus SCORE. There are 10 cases to be entered which are listed below
in the variable order of CASEID, MATHSAT, SCORE. Enter the data as
shown into a file named example1.dat.
0001 650 75 1 4
0002 625 80 1 5
0003 700 85 2 4
0004 550 74 1 3
0005 800 92 2 5
0006 500 68 2 2
0007 725 75 1 3
0008 675 88 1 3
0009 600 81 2 4
0010 700 90 1 5
Create a SAS program that includes the following:
- A title identifying your program
- Set the linewidth on output to be 80
- Create a data set named sample1
- Create your input statement
- Read the data from the file.
- Define labels for each variable giving it a descriptive name.
- Look for potential correlations among the variables using
proc corr.
If you have problems, here are my files to look at:
The SAS program used, example7.sas
The data file used, example2.dat
The SAS listing file generated, example7.lst
The SAS log file generated, example7.log
Author - Jack Suess
UMBC University Computing Services
Created - 1/15/96