1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 /* MathReg2.sas */
57 %include '/folders/myfolders/441s16/Lecture/readmath2b.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: PROCEDURE FORMAT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
159 title2 'Residual analysis';
160
NOTE: The infile '/folders/myfolders/exploremath.data.txt' is:
Filename=/folders/myfolders/exploremath.data.txt,
Owner Name=root,Group Name=vboxsf,
Access Permission=-rwxrwx---,
Last Modified=18Jan2016:17:34:49,
File Size (bytes)=44583
NOTE: 579 records were read from the infile '/folders/myfolders/exploremath.data.txt'.
The minimum record length was 75.
The maximum record length was 75.
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).
99 at 80:24 99 at 117:13
NOTE: The data set WORK.MATHEX has 579 observations and 34 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
161 proc reg plots(only) = ResidualPlot;
162 title3 'Model H: hsgpa hscalc hsengl totscore';
163 model grade = hsgpa hscalc hsengl totscore;
164 output out = Explor predicted = yhat
165 residual = resid
166 rstudent = delstud;
167 /* Deleted Studentized Residual */
168
169 /* Could have included LCL and UCL for upper and lower limits of a
170 95% prediction interval for each case in the file */
171
172
173 /* What is a big (Studentized deleted) residual? If the model is correct,
174 each one has a t distribution with n-p-1 = 283 df (practically standard
175 normal), so the Studentized deleted residual can be treated directly as
176 a t-test statistic. Values that are too big in absolute value will cause
177 H0: mu=0 to be rejected. Tests are NOT independent, but use a Bonferroni
178 correction for n = 289 tests. Get the critical value from proc iml. */
179
NOTE: The data set WORK.EXPLOR has 579 observations and 37 variables.
NOTE: PROCEDURE REG used (Total process time):
real time 0.59 seconds
cpu time 0.27 seconds
180 proc iml;
NOTE: IML Ready
181 title3 'Critical value for Joint t-test on Studentized Residuals';
182 Alpha = 0.05/289;
182 ! print Alpha;
183 Critval = tinv(1-Alpha/2,283);
183 ! print Critval;
184
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
real time 0.04 seconds
cpu time 0.04 seconds
185 proc univariate normal plot;
186 var delstud;
187
188 /* Tests for normality indicate residuals are not normal. No st resids
189 greater than critical value. Next, a few more plots. */
190
NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 0.49 seconds
cpu time 0.19 seconds
191 proc sgplot;
192 title3 'Plot of Y-hat by Y';
193 scatter y=grade x=yhat;
194
195 proc sgplot;
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.24 seconds
cpu time 0.10 seconds
NOTE: There were 579 observations read from the data set WORK.EXPLOR.
196 title3 'Calculus sub-test by deleted studentized residual';
197 scatter x=calc y=delstud;
198
199 proc sgplot;
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.22 seconds
cpu time 0.10 seconds
NOTE: There were 579 observations read from the data set WORK.EXPLOR.
200 title3 'Pre-calculus sub-test by deleted studentized residual';
201 scatter x=precalc y=delstud;
202
203 proc sgplot;
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.24 seconds
cpu time 0.10 seconds
NOTE: There were 579 observations read from the data set WORK.EXPLOR.
204 title3 'Mother tongue by deleted studentized residual';
205 scatter x=mtongue y=delstud;
206
207
208
209 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
221