The data for the following example are from Powell, Murphy, and Gramlich (1982). In order to calibrate an instrument for measuring atomic weight, 24 replicate measurements of the atomic weight of silver (chemical symbol Ag) are made with the new instrument and with a reference instrument.
Note: The results from this example vary from machine to machine, depending on floating-point configuration.
The following statements read the measurements for the two instruments into the SAS data set AgWeight
:
title 'Atomic Weight of Silver by Two Different Instruments'; data AgWeight; input Instrument AgWeight @@; datalines; 1 107.8681568 1 107.8681465 1 107.8681572 1 107.8681785 1 107.8681446 1 107.8681903 1 107.8681526 1 107.8681494 1 107.8681616 1 107.8681587 1 107.8681519 1 107.8681486 1 107.8681419 1 107.8681569 1 107.8681508 1 107.8681672 1 107.8681385 1 107.8681518 1 107.8681662 1 107.8681424 1 107.8681360 1 107.8681333 1 107.8681610 1 107.8681477 2 107.8681079 2 107.8681344 2 107.8681513 2 107.8681197 2 107.8681604 2 107.8681385 2 107.8681642 2 107.8681365 2 107.8681151 2 107.8681082 2 107.8681517 2 107.8681448 2 107.8681198 2 107.8681482 2 107.8681334 2 107.8681609 2 107.8681101 2 107.8681512 2 107.8681469 2 107.8681360 2 107.8681254 2 107.8681261 2 107.8681450 2 107.8681368 ;
Notice that the variation in the atomic weight measurements is several orders of magnitude less than their mean. This is a situation that can be difficult for standard, regression-based analysis-of-variance procedures to handle correctly.
The following statements invoke the ORTHOREG procedure to perform a simple one-way analysis of variance, testing for differences between the two instruments:
proc orthoreg data=AgWeight; class Instrument; model AgWeight = Instrument; run;
Output 72.1.1 shows the resulting analysis.
The mean difference between instruments is about (the value of the (Instrument=’1’)
parameter in the parameter estimates table), whereas the level of background variation in the measurements is about (the value of the root mean square error). At this level of error, the difference is significant, with a p-value of 0.0002.
The National Institute of Standards and Technology (1998) has provided certified ANOVA values for this data set. The following statements use ODS to examine the ANOVA values produced by ORTHOREG more precisely, for comparison with the NIST-certified values:
ods listing close; proc orthoreg data=AgWeight; class Instrument; model AgWeight = Instrument; ods output ANOVA = OrthoregANOVA FitStatistics = OrthoregFitStat; run; ods listing;
data _null_; set OrthoregANOVA (in=inANOVA) OrthoregFitStat(in=inFitStat); if (inANOVA) then do; if (Source = 'Model') then put "Model SS: " ss e20.; if (Source = 'Error') then put "Error SS: " ss e20.; end; if (inFitStat) then do; if (Statistic = 'Root MSE') then put "Root MSE: " nValue1 e20.; if (Statistic = 'R-Square') then put "R-Square: " nValue1 best20.; end; run;
Table 72.9 and Table 72.10 compare the ANOVA values certified by NIST with those produced by ORTHOREG. As you can see, the agreement is quite good.
Table 72.9: Accuracy Comparison for Sums of Squares
Values |
Model SS |
Error SS |
---|---|---|
NIST-certified |
3.6383418750000E–09 |
1.0495172916667E–08 |
ORTHOREG |
3.6383418747907E–09 |
1.0495172916797E–08 |
Table 72.10: Accuracy Comparison for Fit Statistics
Values |
Root MSE |
R Square |
---|---|---|
NIST-certified |
1.5104831444641E–05 |
0.25742654453832 |
ORTHOREG |
1.5104831444735E–05 |
0.25742654452494 |