1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 /* describemath0.sas */
74 title 'Gender, Ethnicity and Math performance';
75 title2 'Basic descriptive statistics on the combined sample';
76
77 proc format;
78 value ynfmt 0 = 'No' 1 = 'Yes';
NOTE: Format YNFMT is already on the library WORK.FORMATS.
NOTE: Format YNFMT has been output.
79 value crsfmt 4 = 'No Resp';
NOTE: Format CRSFMT is already on the library WORK.FORMATS.
NOTE: Format CRSFMT has been output.
80 value nfmt
81 1 = 'Chinese'
82 2 = 'Japanese'
83 3 = 'Korean'
84 4 = 'Vietnamese'
85 5 = 'Other Asian'
86 6 = 'Eastern European'
87 7 = 'Hispanic'
88 8 = 'English-speaking'
89 9 = 'French'
90 10 = 'Italian'
91 11 = 'Greek'
92 12 = 'Germanic'
93 13 = 'Other European'
94 14 = 'Middle-Eastern'
95 15 = 'Pakistani'
96 16 = 'East Indian'
97 17 = 'Sub-Saharan'
98 18 = 'OTHER or DK';
NOTE: Format NFMT is already on the library WORK.FORMATS.
NOTE: Format NFMT has been output.
99
100 value ncfmt
101 1 = 'Asian'
102 2 = 'Eastern European'
103 3 = 'European not Eastern'
104 4 = 'Middle-Eastern and Pakistani'
105 5 = 'East Indian'
106 6 = 'Other and DK' ;
NOTE: Format NCFMT is already on the library WORK.FORMATS.
NOTE: Format NCFMT has been output.
107
NOTE: PROCEDURE FORMAT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 248.37k
OS Memory 27044.00k
Timestamp 02/13/2024 06:18:54 PM
Step Count 34 Switch Count 0
Page Faults 0
Page Reclaims 27
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 32
108 data math;
109 infile '/home/u1407221/441s24/data/math.data.txt';
110 input id course precalc calc gpa calculus english mark lang $ sex $
111 nation1 nation2 sample;
112
113 /* Computed Variables: totscore, passed, grade, hsgpa, hscalc, hsengl,
114 tongue, class, ethnic */
115
116 totscore = precalc+calc;
117 if (50<=mark<=100) then passed=1; else passed=0;
118 /* Some missing final marks were zero, and 998=SDF and 999=WDR */
119 if mark=0 then grade=.;
120 else if mark > 100 then grade=.;
121 else grade=mark;
122 /* Missing HS marks were zeros */
123 if 65 le gpa le 100 then hsgpa = gpa; /* Else missing is automatic */
124 if 1 le calculus le 100 then hscalc = calculus;
125 if 1 le english le 100 then hsengl = english;
126 /* There were just a few French speakers */
127 if lang='French' then tongue='Other '; else tongue=lang;
128 label tongue = 'Mother Tongue (Eng or Other)';
129 class = course;
130 if class = 4 then class = .;
131
132
133 /********* Nationality According to the 2 raters **********/
134 if 1 <= nation1 <= 5 then rater1 = 1;
135 else if nation1 = 6 then rater1 = 2;
136 else if 7 <= nation1 <= 13 then rater1 = 3;
137 else if 14 <= nation1 <= 15 then rater1 = 4;
138 else if nation1 = 16 then rater1 = 5;
139 else rater1 = 6;
140 if 1 <= nation2 <= 5 then rater2 = 1;
141 else if nation2 = 6 then rater2 = 2;
142 else if 7 <= nation2 <= 13 then rater2 = 3;
143 else if 14 <= nation2 <= 15 then rater2 = 4;
144 else if nation2 = 16 then rater2 = 5;
145 else rater2 = 6;
146 /* Rater 1 knows Middle Eastern names -- otherwise believe Rater 2 */
147 if rater1=4 then ethnic=rater1; else ethnic=rater2;
148 /********************************************************************/
149
150 label
151 precalc = 'Number precalculus correct'
152 calc = 'Number calculus correct'
153 totscore = 'Total # right on diagnostic test'
154 passed = 'Passed the course'
155 grade = 'Final mark'
156 hsgpa = 'High School GPA'
157 hscalc = 'HS Calculus'
158 hsengl = 'HS English'
159 lang = 'Mother Tongue'
160 rater1 = 'Nationality of name acc to rater1'
161 rater2 = 'Nationality of name acc to rater2'
162 tongue = 'Mother Tongue (Eng or Other)'
163 ethnic = 'Judged Nationality of name' ;
164
165 format course crsfmt.;
166 format passed ynfmt.;
167 format nation1 nation2 nfmt.;
168 format rater1 rater2 ethnic ncfmt.;
169
170 /*********************************************************************/
171
172 /* Check created variables */
173
174 /* Do this for transformed quantitative variables - Lots of output
175 proc print data=math;
176 var mark grade;
177 */
178
179 /* Check created variables
180 proc freq data=math;
181 tables lang*tongue / norow nocol nopercent missing;
182 tables course*class / norow nocol nopercent missing;
183 tables nation1*rater1 / norow nocol nopercent missing;
184 tables nation2*rater2 / norow nocol nopercent missing;
185 tables (rater1 rater2) * ethnic / norow nocol nopercent missing;
186 */
187
188 /* Could use "by" , like this to get separate results for each sample.
189 proc sort data=math;
190 by sample;
191 proc means data=math;
192 title3 'Quantitative Variables';
193 by sample;
194 var precalc calc totscore hsgpa hscalc hsengl grade;
195 */
196
NOTE: The infile '/home/u1407221/441s24/data/math.data.txt' is:
Filename=/home/u1407221/441s24/data/math.data.txt,
Owner Name=u1407221,Group Name=oda,
Access Permission=-rw-r--r--,
Last Modified=10Feb2024:16:04:10,
File Size (bytes)=90324
NOTE: 1158 records were read from the infile '/home/u1407221/441s24/data/math.data.txt'.
The minimum record length was 76.
The maximum record length was 76.
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
180 at 116:24
NOTE: The data set WORK.MATH has 1158 observations and 24 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 968.14k
OS Memory 27816.00k
Timestamp 02/13/2024 06:18:54 PM
Step Count 35 Switch Count 2
Page Faults 0
Page Reclaims 152
Page Swaps 0
Voluntary Context Switches 16
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 536
197 proc means data=math;
198 title3 'Quantitative Variables';
199 class sample;
200 var precalc calc totscore hsgpa hscalc hsengl grade;
201
NOTE: There were 1158 observations read from the data set WORK.MATH.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.06 seconds
user cpu time 0.06 seconds
system cpu time 0.01 seconds
memory 9823.56k
OS Memory 35772.00k
Timestamp 02/13/2024 06:18:55 PM
Step Count 36 Switch Count 2
Page Faults 0
Page Reclaims 1982
Page Swaps 0
Voluntary Context Switches 18
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 8
202 proc freq data=math;
203 title3 'Categorical variables';
204 tables sample * (course sex ethnic tongue passed) / norow nocol nopercent missing;
205
206 run;
NOTE: There were 1158 observations read from the data set WORK.MATH.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.07 seconds
user cpu time 0.07 seconds
system cpu time 0.00 seconds
memory 1817.29k
OS Memory 31408.00k
Timestamp 02/13/2024 06:18:55 PM
Step Count 37 Switch Count 5
Page Faults 0
Page Reclaims 285
Page Swaps 0
Voluntary Context Switches 33
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 568
206 ! quit;
207
208 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
220