Professional Documents
Culture Documents
CEGI - Exercises For Review
CEGI - Exercises For Review
EXERCISES
1. Associate a library named mydata with the c:\sascourse\exercises folder (suppose that this is the
folder where you keep the files of the exercises).
2. In that folder, the faculty.txt file contains data on faculty of a university. The file structure is as
shown in the following table:
Create a data set named faculty with variables Code, Name, Category, Birth and Phone, from the
faculty.txt file. Format the Birth variable so as to have the appearance 15JAN68.
3. The mydata.evaluation data set contains data on the faculty evaluation in the courses they teach.
The descriptive portion of the data set is partly defined in the following table:
Combine the data in the faculty data set (created in question 2) and in the mydata.evaluation data set,
to create a new data set named faculty_eval. Do not include the Phone variable in this new data set
(faculty_eval), but create a new variable named field_code corresponding to the courses field code, i.e.
the first three characters of the course_code variable.
b) Using the faculty_eval data set from the previous paragraph, create a data set named faculty_eval2
that only includes lecturers born after January 1, 1960.
5. Using the faculty_eval data set created in paragraph 4a), produce a report on the evaluation of
lecturers (variables Code, Name, Quest1 and Quest2), such that:
▪ The column that numbers the observations is not displayed;
▪ The data for each field of the courses appear in a different page of the report;
▪ Includes the title Teachers’ Evaluation;
▪ Includes the sub-title in the field of …;
▪ Associates to variable Quest1 the label Question 1, and to Quest2 the label Question 2.
b) Write a program that allows knowing the overall average score for both questions (Quest1 and
Quest2), for each field of the courses. Save the results in a data set named stats and name the variables
with the average scores of Quest1 and Quest2 as Q1_mean and Q2_mean, respectively.