You are on page 1of 3

Computação em Estatística e Gestão de Informação

Licenciatura em Gestão de Informação

EXERCISES

Docente: Frederico Cruz-Jesus


(fjesus@novaims.unl.pt)
Catarina Neves
(cneves@novaims.unl.pt)
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:

Variable Column Description


Code 1−2 Lecturer code (numeric value)
Name 3 − 11 Lecturer name
Category 12 − 20 Lecturer category (takes the values: Assistant, Associate, Full)
Birth 21 − 28 Date of birth (e.g., 15/01/68 represents January 15, 1968)
Town 29 − 34 Location of residence
Phone 35 – 43 Phone number (numeric value)

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:

Variable Type Width/Length Description


Code Numeric 2 Lecturer code
Course code (takes the values: EST12, EST21,
Course_code Character 5 EST31, EST41, EST42, MAT12, MAT21, INF11,
INF12, INF21, INF31, SIG12, SIG21, SIG41)
Average score for question 1 (takes values
Quest1 Numeric 3
between 0 and 5 with one decimal place)
3 Average score for question 2 (takes values
Quest2 Numeric
between 0 and 5 with one decimal place)

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.

Ana Cristina Costa, Helena Guerra 2


4.
a) Modify the faculty_eval data set created in question 3, so that it includes a new variable named
Field corresponding to the designation of the courses field, i.e. when the courses field code is equal to
EST then the new variable takes the value Statistics, when it is equal to MAT then the new variable
takes the value Mathematics, when it is equal to INF or SIG then the new variable takes the value
Computer Science.

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.

6. Using the faculty_eval data set created in paragraph 4a):

a) Write a program to produce a statistical report on the percentage of lecturers of different


categories who teach courses of Statistics and Mathematics (do not present accumulated values).

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.

Ana Cristina Costa, Helena Guerra 3

You might also like