Monday, June 16, 2008

Something beautiful!

For those of you who have never used SAS, this may seem trivial. For those of you who have suffered through the initial learning of SAS code, this is a beautiful thing. In fact I'm doing a little SAS dance in my chair! Woohoo!

Here is the code I used to get this.


title 'educational data for 78 seventh-grade students';
data students;
input obs gpa iq gender concept;
datalines;
1 7.94 111 2 67
2 8.292 107 2 43
3 4.643 100 2 52
4 7.47 107 2 66
5 8.882 114 1 58
6 7.585 115 2 51
7 7.65 111 2 71
8 2.412 97 2 51
9 6 100 1 49
10 8.833 112 2 51
11 7.47 104 1 35
12 5.528 89 1 54
13 7.167 104 2 54
14 7.571 102 1 64
15 4.7 91 1 56
16 8.167 114 1 69
17 7.822 114 1 55
18 7.598 103 1 65
19 4 106 2 40
20 6.231 105 1 66
21 7.643 113 2 55
22 1.76 109 2 20
24 6.419 108 1 56
26 9.648 113 2 68
27 10.7 130 1 69
28 10.58 128 2 70
29 9.429 128 2 80
30 8 118 2 53
31 9.585 113 2 65
32 9.571 120 1 67
33 8.998 132 1 62
34 8.333 111 1 39
35 8.175 124 2 71
36 8 127 2 59
37 9.333 128 1 60
38 9.5 136 2 64
39 9.167 106 2 71
40 10.14 118 1 72
41 9.999 119 1 54
43 10.76 123 2 64
44 9.763 124 2 58
45 9.41 126 2 70
46 9.167 116 2 72
47 9.348 127 2 70
48 8.167 119 2 47
50 3.647 97 2 52
51 3.408 86 1 46
52 3.936 102 2 66
53 7.167 110 2 67
54 7.647 120 2 63
55 0.53 103 2 53
56 6.173 115 2 67
57 7.295 93 2 61
58 7.295 72 1 54
59 8.938 111 1 60
60 7.882 103 1 60
61 8.353 123 2 63
62 5.062 79 2 30
63 8.175 119 2 54
64 8.235 110 2 66
65 7.588 110 2 44
68 7.647 107 2 49
69 5.237 74 1 44
71 7.825 105 2 67
72 7.333 112 1 64
74 9.167 105 2 73
76 7.996 110 2 59
77 8.714 107 1 37
78 7.833 103 1 63
79 4.885 77 2 36
80 7.998 98 1 64
83 3.82 90 2 42
84 5.936 96 1 28
85 9 112 1 60
86 9.5 112 1 70
87 6.057 114 2 51
88 6.057 93 1 21
89 6.938 106 2 56
;
run;
PROC SORT data=students out=nsort;
by gender;
RUN;
PROC BOXPLOT data=nsort;
plot gpa * gender /boxstyle=schematic;
RUN;

Can I get an honorary computer science degree for this? Maybe not, but seriously this is my biggest acheivement of the day. I can think of about a million things I'd rather acheive today, but whatever...I'll take it.

No comments: