1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 /* MathReg2.sas */
74 %include '/home/u1407221/441s24/SAS08/ReadLabelMath2.sas';
NOTE: Format YNFMT is already on the library WORK.FORMATS.
NOTE: Format YNFMT has been output.
NOTE: Format CRSFMT is already on the library WORK.FORMATS.
NOTE: Format CRSFMT has been output.
NOTE: Format NFMT is already on the library WORK.FORMATS.
NOTE: Format NFMT has been output.
NOTE: Format NCFMT is already on the library WORK.FORMATS.
NOTE: Format NCFMT has been output.
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 250.09k
OS Memory 30116.00k
Timestamp 02/23/2024 08:05:49 PM
Step Count 124 Switch Count 0
Page Faults 0
Page Reclaims 26
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 32
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 120:24
NOTE: The data set WORK.MATH has 1158 observations and 37 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 1176.40k
OS Memory 30888.00k
Timestamp 02/23/2024 08:05:49 PM
Step Count 125 Switch Count 2
Page Faults 0
Page Reclaims 167
Page Swaps 0
Voluntary Context Switches 19
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 776
NOTE: There were 1158 observations read from the data set WORK.MATH.
NOTE: The data set WORK.REPLIC has 579 observations and 37 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1411.71k
OS Memory 31276.00k
Timestamp 02/23/2024 08:05:49 PM
Step Count 126 Switch Count 2
Page Faults 0
Page Reclaims 155
Page Swaps 0
Voluntary Context Switches 15
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 520
NOTE: There were 1158 observations read from the data set WORK.MATH.
NOTE: The data set WORK.EXPLORE has 579 observations and 28 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 1407.28k
OS Memory 31276.00k
Timestamp 02/23/2024 08:05:49 PM
Step Count 127 Switch Count 2
Page Faults 0
Page Reclaims 130
Page Swaps 0
Voluntary Context Switches 14
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 520
235 title2 'Basic Regression Diagnostics';
236
237 proc reg data = explore plots(only) = ResidualPlot;
238 title3 'Model I: hsgpa hscalc hsengl totscore mtongue';
239 model grade = hsgpa hscalc hsengl totscore mtongue;
240 output out = Explor H = hatval
241 predicted = yhat
242 residual = resid
243 rstudent = delstud;
244 /* Deleted Studentized Residual */
245 /* Could have included LCL and UCL for upper and lower limits of a
246 95% prediction interval for each case in the file */
247
248 /* proc contents; */
249
250 /* Rules of thumb say investigate x values for outliers if
251 * Hat value > 3p/n (Is residual close to the error term?)
252 * Hat value > 0.2 (Is betahat approximtely multivariate normal?) */
253
NOTE: The data set WORK.EXPLOR has 579 observations and 32 variables.
NOTE: PROCEDURE REG used (Total process time):
real time 0.43 seconds
user cpu time 0.23 seconds
system cpu time 0.03 seconds
memory 26998.03k
OS Memory 54212.00k
Timestamp 02/23/2024 08:05:49 PM
Step Count 128 Switch Count 4
Page Faults 0
Page Reclaims 6457
Page Swaps 0
Voluntary Context Switches 354
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 3288
254 proc iml;
NOTE: IML Ready
255 n = 289;
255 ! p = 6;
255 ! ceiling = 3*p/n;
256 print "Investigate x if hat values are > 0.2 or greater than " ceiling;
257
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
real time 0.03 seconds
user cpu time 0.03 seconds
system cpu time 0.00 seconds
memory 1121.06k
OS Memory 52656.00k
Timestamp 02/23/2024 08:05:49 PM
Step Count 129 Switch Count 0
Page Faults 0
Page Reclaims 199
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 144
258 proc univariate plot data=Explor;
259 var hatval;
260 where grade ne .;
261
NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 0.25 seconds
user cpu time 0.12 seconds
system cpu time 0.01 seconds
memory 4784.62k
OS Memory 54448.00k
Timestamp 02/23/2024 08:05:50 PM
Step Count 130 Switch Count 3
Page Faults 0
Page Reclaims 933
Page Swaps 0
Voluntary Context Switches 342
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 928
262 proc sgplot;
263 histogram hatval;
264 where grade ne .;
265
266 proc sort data=Explor;
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.16 seconds
user cpu time 0.06 seconds
system cpu time 0.00 seconds
memory 3407.06k
OS Memory 55216.00k
Timestamp 02/23/2024 08:05:50 PM
Step Count 131 Switch Count 7
Page Faults 0
Page Reclaims 689
Page Swaps 0
Voluntary Context Switches 265
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 592
NOTE: There were 393 observations read from the data set WORK.EXPLOR.
WHERE grade not = .;
267 by hatval;
NOTE: There were 579 observations read from the data set WORK.EXPLOR.
NOTE: The data set WORK.EXPLOR has 579 observations and 32 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1711.56k
OS Memory 55220.00k
Timestamp 02/23/2024 08:05:50 PM
Step Count 132 Switch Count 2
Page Faults 0
Page Reclaims 131
Page Swaps 0
Voluntary Context Switches 11
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 520
268 proc print data = Explor;
269 where hatval > 0.06228 and grade ne .;
270 var id hatval hsgpa hscalc hsengl totscore mtongue grade delstud;
271
272 /* Try re-running the analysis without the two suspect observations */
273
NOTE: There were 2 observations read from the data set WORK.EXPLOR.
WHERE (hatval>0.06228) and (grade not = .);
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 1129.53k
OS Memory 54700.00k
Timestamp 02/23/2024 08:05:50 PM
Step Count 133 Switch Count 0
Page Faults 0
Page Reclaims 99
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 8
274 proc reg plots=none data=explore;
275 title3 'Re-running without participants 50 and 340';
276 model grade = hsgpa hscalc hsengl totscore mtongue;
277 where id ne 340 and id ne 50;
278
279 /* What is a big (Studentized deleted) residual? If the model is correct,
280 each one has a t distribution with n-p-1 = 283 df (practically standard
281 normal), so the Studentized deleted residual can be treated directly as
282 a t-test statistic. Values that are too big in absolute value will cause
283 rejection of the null hypothesis that x_i*beta is the same for this case
284 and the other n-1 cases. Tests are NOT independent, but use a Bonferroni
285 correction for n = 289 tests. Get the critical value from proc iml. */
286
NOTE: PROCEDURE REG used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.00 seconds
memory 3358.37k
OS Memory 56516.00k
Timestamp 02/23/2024 08:05:50 PM
Step Count 134 Switch Count 4
Page Faults 0
Page Reclaims 309
Page Swaps 0
Voluntary Context Switches 17
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 80
287 proc iml;
NOTE: IML Ready
288 title3 'Critical value for Joint t-test on Studentized Deleted Residuals';
289 Alpha = 0.05/289;
289 ! print Alpha;
290 Critval = tinv(1-Alpha/2,283);
290 ! print Critval;
291
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 577.21k
OS Memory 54436.00k
Timestamp 02/23/2024 08:05:50 PM
Step Count 135 Switch Count 1
Page Faults 0
Page Reclaims 56
Page Swaps 0
Voluntary Context Switches 7
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 72
292 proc univariate data=Explor normal plot;
293 title3 'Studentized Deleted Residuals';
294 var delstud;
295
296 /* Tests for normality indicate residuals are not normal. One st resid
297 greater than critical value. */
298
NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 0.24 seconds
user cpu time 0.13 seconds
system cpu time 0.01 seconds
memory 4142.53k
OS Memory 56236.00k
Timestamp 02/23/2024 08:05:50 PM
Step Count 136 Switch Count 1
Page Faults 0
Page Reclaims 787
Page Swaps 0
Voluntary Context Switches 365
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 944
299 proc print data=Explor;
300 title3 'Large Negative Studentized Deleted Residual';
301 where delstud < -3.81 and delstud ne .;
302
303 /* Next, a few more plots. */
304
NOTE: There were 1 observations read from the data set WORK.EXPLOR.
WHERE (delstud<-3.81) and (delstud not = .);
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.02 seconds
user cpu time 0.03 seconds
system cpu time 0.00 seconds
memory 1428.78k
OS Memory 55468.00k
Timestamp 02/23/2024 08:05:50 PM
Step Count 137 Switch Count 1
Page Faults 0
Page Reclaims 99
Page Swaps 0
Voluntary Context Switches 10
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 40
305 proc sgplot data=Explor;
306 title3 'Plot of Y-hat by Y';
307 scatter y=grade x=yhat;
308
309 proc sgplot data=Explor;
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.16 seconds
user cpu time 0.08 seconds
system cpu time 0.01 seconds
memory 2849.96k
OS Memory 56236.00k
Timestamp 02/23/2024 08:05:50 PM
Step Count 138 Switch Count 2
Page Faults 0
Page Reclaims 571
Page Swaps 0
Voluntary Context Switches 249
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 832
NOTE: There were 579 observations read from the data set WORK.EXPLOR.
310 title3 'Calculus sub-test by deleted studentized residual';
311 scatter x=calc y=delstud;
312
313 proc sgplot data=Explor;
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.16 seconds
user cpu time 0.07 seconds
system cpu time 0.01 seconds
memory 3403.25k
OS Memory 56236.00k
Timestamp 02/23/2024 08:05:50 PM
Step Count 139 Switch Count 2
Page Faults 0
Page Reclaims 562
Page Swaps 0
Voluntary Context Switches 252
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 864
NOTE: There were 579 observations read from the data set WORK.EXPLOR.
314 title3 'Pre-calculus sub-test by deleted studentized residual';
315 scatter x=precalc y=delstud;
316
317 proc sgplot data=Explor;
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.14 seconds
user cpu time 0.07 seconds
system cpu time 0.00 seconds
memory 3387.75k
OS Memory 56236.00k
Timestamp 02/23/2024 08:05:51 PM
Step Count 140 Switch Count 2
Page Faults 0
Page Reclaims 552
Page Swaps 0
Voluntary Context Switches 250
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 856
NOTE: There were 579 observations read from the data set WORK.EXPLOR.
318 title3 'Mother tongue by deleted studentized residual';
319 scatter x=mtongue y=delstud;
320
321 quit;
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.15 seconds
user cpu time 0.07 seconds
system cpu time 0.01 seconds
memory 3501.25k
OS Memory 56236.00k
Timestamp 02/23/2024 08:05:51 PM
Step Count 141 Switch Count 2
Page Faults 0
Page Reclaims 554
Page Swaps 0
Voluntary Context Switches 253
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 856
NOTE: There were 579 observations read from the data set WORK.EXPLOR.
322
323
324 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
336