|
|
楼主

楼主 |
发表于 2010-6-23 00:12:39
|
只看该作者
解一道SAS题
Data set ‘students.txt’ contains variables name, social security number, and grades for the courses taken by several students.
a.) Using arrays, write a program that calculates the number of courses taken, the total scores earned, and the mean grade for each student
b.) After you get these results, use an indicator variable to indicate the data as two groups:
the first 3 in group 1, and the last 3 in group 2 (don’t put them into two data sets!).
c.) Use PROC IML to read the data from part b into matrices x1 and x2, where x1 and x2 are 3*3 matrices for the variables number of courses taken, total scores earned, and mean grade, respectively.
Only print out matrices 1 and 2.
students.txt:
Smith 888-55-1212 87.3 92.1 90.6 97.8 95.6 93.4 90.4
Jones 555-88-1234 69.2 73.8 82.6 76.5 84.3 90.1 78.7
Green 777-88-9999 86.9 89.0 92.5 81.6 79.4 85.5 82.1
Brown 888-99-1111 78.6 82.1 . 78.4 88.6 95.5 86.0
Young 777-66-5555 96.0 85.5 97.2 86.4 72.1 89.9 93.5
Meyer 888-55-4444 99.9 . 96.7 92.1 . 96.6 92.8 |
|