Residual Plots: Single Factor Experiment title 'Residual Plots: Wound Healing'; options linesize=79; data wounds; infile 'gpi.dat'; input Material Gpi; PROC GLM; CLASS Material; MODEL Gpi = Material; OUTPUT out=resstuff predicted=gpipred residual=resid; PROC PLOT data = resstuff; plot resid*gpipred; PROC UNIVARIATE plot data = resstuff; var resid; RUN; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Explanation of some commands: Under PROC GLM: the OUTPUT statement tells SAS we're going to save some of our results in a SAS data file called resstuff. In that file will be 2 variables: The fitted ( y ) values in "gpipred", and the residuals ( e ) in "resid". PROC PLOT is a plotting procedure that produces plots that are not flashy. It will be used to plot the residuals vs. fitted values, so we have to tell this procedure these values are stored in "resstuff". Then we give the command to plot these values. PROC UNIVARIATE computes a lot of summary statistics for univariate data. It will give a lot of information that we don't need about the residuals, so should be deleted if you use this for any assignment questions. However, it does give us a QQ-plot of the residuals. To use this procedure, you need to specify the SAS data file where your values are stored, then specify the name of the variable you want to examine in the VAR statement. The output starts on the next page. NOTE: I've deleted the first part of the output, since that is on your previous handout. Residual Plots: Wound Healing 3 Plot of resid*gpipred. Legend: A = 1 obs, B = 2 obs, etc. resid | | 5.00 + B | | | | 3.33 + A A | | | | 1.67 + B B B | | | | 0.00 + | | | | -1.67 + B B | | | | -3.33 + A A A | | | | -5.00 + | | | | -6.67 + | | | | -8.33 + | | | | -10.00 + A | ---+-------+-------+-------+-------+-------+-------+-------+-------+-- 0 10 20 30 40 50 60 70 80 gpipred Residual Plots: Wound Healing 4 The UNIVARIATE Procedure Variable: resid Moments N 18 Sum Weights 18 Mean 0 Sum Observations 0 Std Deviation 3.70479287 Variance 13.7254902 Skewness -1.0122023 Kurtosis 1.70216837 Uncorrected SS 233.333333 Corrected SS 233.333333 Coeff Variation . Std Error Mean 0.87322805 Basic Statistical Measures Location Variability Mean 0.000000 Std Deviation 3.70479 Median 1.666667 Variance 13.72549 Mode 1.666667 Range 15.00000 Interquartile Range 3.33333 Tests for Location: Mu0=0 Test -Statistic- -----p Value------ Student's t t 0 Pr > |t| 1.0000 Sign M 1 Pr >= |M| 0.8145 Signed Rank S 2 Pr >= |S| 0.9373 Quantiles (Definition 5) Quantile Estimate 100% Max 5.00000 99% 5.00000 95% 5.00000 90% 5.00000 75% Q3 1.66667 50% Median 1.66667 25% Q1 -1.66667 10% -3.33333 5% -10.00000 1% -10.00000 0% Min -10.00000 Extreme Observations ------Lowest------ -----Highest----- Value Obs Value Obs -10.00000 1 1.66667 12 -3.33333 10 3.33333 17 Residual Plots: Wound Healing 5 The UNIVARIATE Procedure Variable: resid Extreme Observations ------Lowest------ -----Highest----- Value Obs Value Obs -3.33333 8 3.33333 14 -3.33333 4 5.00000 2 -1.66667 18 5.00000 3 # Stem and Leaf plot of residuals # Appears to have bell-curve shape Stem Leaf # Boxplot 4 00 2 | 2 33 2 | 0 777777 6 +--+--+ -0 7777 4 +-----+ -2 333 3 | -4 -6 -8 -10 0 1 0 ----+----+----+----+ # HERE IS THE QQ-PLOT Normal Probability Plot 5+ ++*+++ * | ++*++* | *+**+** * | * **+++ -3+ * *++*++ | ++++++ | +++++ |++++ * -11+ +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2