Chapter 6 : Hubble example
Raw data listing

Obs VELOCITY DISTANCE anotherx
1 -220 0.27500 -220
2 -185 0.27500 -185
3 -130 0.21400 -130
4 -70 0.26300 -70
5 -30 0.90000 -30
6 150 0.90000 150
7 170 0.03200 170
8 200 0.45000 200
9 200 0.63000 200
10 270 0.50000 270
11 290 0.03400 290
12 290 0.50000 290
13 300 0.80000 300
14 450 1.10000 450
15 500 0.90000 500
16 500 1.10000 500
17 500 1.40000 500
18 500 2.00000 500
19 650 0.90000 650
20 800 2.00000 800
21 850 2.00000 850
22 920 1.00000 920
23 960 1.70000 960
24 1090 2.00000 1090
25 1200 . .


Chapter 6 : Hubble example
Raw data listing

                        Plot of DISTANCE*VELOCITY.  Legend: A = 1 obs, B = 2 obs, etc.                         
                                                                                                               
    2.00 +                                                        A                 A  A             A         
         |                                                                                                     
         |                                                                                                     
         |                                                                                                     
         |                                                                                                     
    1.75 +                                                                                                     
         |                                                                                    A                
         |                                                                                                     
         |                                                                                                     
         |                                                                                                     
    1.50 +                                                                                                     
         |                                                                                                     
DISTANCE |                                                        A                                            
         |                                                                                                     
         |                                                                                                     
    1.25 +                                                                                                     
         |                                                                                                     
         |                                                                                                     
         |                                                     A  A                                            
         |                                                                                                     
    1.00 +                                                                                 A                   
         |                                                                                                     
         |                        A          A                    A        A                                   
         |                                                                                                     
         |                                            A                                                        
    0.75 +                                                                                                     
         |                                                                                                     
         |                                      A                                                              
         |                                                                                                     
         |                                                                                                     
    0.50 +                                          AA                                                         
         |                                      A                                                              
         |                                                                                                     
         |                                                                                                     
         |             A A                                                                                     
    0.25 +                      A                                                                              
         |                  A                                                                                  
         |                                                                                                     
         |                                                                                                     
         |                                    A      A                                                         
    0.00 +                                                                                                     
         ---+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+--
          -400        -200          0          200         400         600         800        1000        1200 
                                                                                                               
                                                        VELOCITY                                               
                                                                                                               
NOTE: 1 obs had missing values.                                                                                


Chapter 6 : Hubble example
Regression without labels and with output statement

The REG Procedure
Model: MODEL1
Dependent Variable: DISTANCE

Number of Observations Read 25
Number of Observations Used 24
Number of Observations with Missing Values 1

Analysis of Variance
Source DF Sum of
Squares
Mean
Square
F Value Pr > F
Model 1 5.97547 5.97547 36.44 <.0001
Error 22 3.60782 0.16399    
Corrected Total 23 9.58329      

Root MSE 0.40496 R-Square 0.6235
Dependent Mean 0.91137 Adj R-Sq 0.6064
Coeff Var 44.43383    

Parameter Estimates
Variable DF Parameter
Estimate
Standard
Error
t Value Pr > |t| 95% Confidence Limits
Intercept 1 0.39910 0.11847 3.37 0.0028 0.15341 0.64479
VELOCITY 1 0.00137 0.00022744 6.04 <.0001 0.00090125 0.00184


Chapter 6 : Hubble example
Regression without labels and with output statement

The REG Procedure
Model: MODEL1
Dependent Variable: DISTANCE

Output Statistics
Obs VELOCITY Dependent
Variable
Predicted
Value
Std Error
Mean Predict
95% CL Mean 95% CL Predict Residual
1 -220 0.2750 0.0971 0.1582 -0.2311 0.4252 -0.8046 0.9987 0.1779
2 -185 0.2750 0.1451 0.1515 -0.1691 0.4593 -0.7516 1.0418 0.1299
3 -130 0.2140 0.2206 0.1412 -0.0721 0.5134 -0.6688 1.1100 -0.006617
4 -70 0.2630 0.3030 0.1303 0.0327 0.5733 -0.5793 1.1853 -0.0400
5 -30 0.9000 0.3579 0.1234 0.1019 0.6139 -0.5201 1.2359 0.5421
6 150 0.9000 0.6050 0.0970 0.4039 0.8062 -0.2585 1.4686 0.2950
7 170 0.0320 0.6325 0.0947 0.4361 0.8289 -0.2300 1.4950 -0.6005
8 200 0.4500 0.6737 0.0916 0.4838 0.8636 -0.1873 1.5347 -0.2237
9 200 0.6300 0.6737 0.0916 0.4838 0.8636 -0.1873 1.5347 -0.0437
10 270 0.5000 0.7698 0.0859 0.5916 0.9480 -0.0887 1.6283 -0.2698
11 290 0.0340 0.7972 0.0848 0.6214 0.9731 -0.0608 1.6553 -0.7632
12 290 0.5000 0.7972 0.0848 0.6214 0.9731 -0.0608 1.6553 -0.2972
13 300 0.8000 0.8110 0.0843 0.6361 0.9858 -0.0469 1.6688 -0.0110
14 450 1.1000 1.0169 0.0845 0.8417 1.1921 0.1590 1.8748 0.0831
15 500 0.9000 1.0856 0.0876 0.9040 1.2671 0.2263 1.9448 -0.1856
16 500 1.1000 1.0856 0.0876 0.9040 1.2671 0.2263 1.9448 0.0144
17 500 1.4000 1.0856 0.0876 0.9040 1.2671 0.2263 1.9448 0.3144
18 500 2.0000 1.0856 0.0876 0.9040 1.2671 0.2263 1.9448 0.9144
19 650 0.9000 1.2915 0.1039 1.0760 1.5070 0.4245 2.1586 -0.3915
20 800 2.0000 1.4974 0.1275 1.2330 1.7619 0.6170 2.3779 0.5026
21 850 2.0000 1.5661 0.1364 1.2833 1.8489 0.6799 2.4523 0.4339
22 920 1.0000 1.6622 0.1493 1.3525 1.9719 0.7671 2.5573 -0.6622
23 960 1.7000 1.7171 0.1570 1.3915 2.0427 0.8164 2.6179 -0.0171
24 1090 2.0000 1.8956 0.1828 1.5165 2.2747 0.9742 2.8170 0.1044
25 1200 . 2.0466 0.2054 1.6206 2.4727 1.1049 2.9883 .

Sum of Residuals 0
Sum of Squared Residuals 3.60782
Predicted Residual SS (PRESS) 4.20513


Chapter 6 : Hubble example
Regression without labels and with output statement

The REG Procedure
Model: MODEL1

Test 1 Results for Dependent Variable DISTANCE
Source DF Mean
Square
F Value Pr > F
Numerator 1 0.05118 0.31 0.5820
Denominator 22 0.16399    


Chapter 6 : Hubble example
Regression without labels and with output statement

The UNIVARIATE Procedure
Variable: resid

Moments
N 24 Sum Weights 24
Mean 0 Sum Observations 0
Std Deviation 0.39605753 Variance 0.15686157
Skewness 0.09440336 Kurtosis 0.24944333
Uncorrected SS 3.60781603 Corrected SS 3.60781603
Coeff Variation . Std Error Mean 0.0808449

Basic Statistical Measures
Location Variability
Mean 0.00000 Std Deviation 0.39606
Median -0.00880 Variance 0.15686
Mode . Range 1.67768
    Interquartile Range 0.48319

Tests for Location: Mu0=0
Test Statistic p Value
Student's t t 0 Pr > |t| 1.0000
Sign M -1 Pr >= |M| 0.8388
Signed Rank S -2 Pr >= |S| 0.9559

Tests for Normality
Test Statistic p Value
Shapiro-Wilk W 0.981984 Pr < W 0.9294
Kolmogorov-Smirnov D 0.122752 Pr > D >0.1500
Cramer-von Mises W-Sq 0.03757 Pr > W-Sq >0.2500
Anderson-Darling A-Sq 0.220155 Pr > A-Sq >0.2500

Quantiles (Definition 5)
Quantile Estimate
100% Max 0.91443373
99% 0.91443373
95% 0.54208985
90% 0.50255290
75% Q3 0.23645454
50% Median -0.00879778
25% Q1 -0.24673821
10% -0.60049735
5% -0.66219944
1% -0.76324968
0% Min -0.76324968

Extreme Observations
Lowest Highest
Value Obs Value Obs
-0.763250 11 0.314434 17
-0.662199 22 0.433906 21
-0.600497 7 0.502553 20
-0.391507 19 0.542090 5
-0.297250 12 0.914434 18

Missing Values
Missing
Value
Count Percent Of
All Obs Missing Obs
. 1 4.00 100.00

   Stem Leaf                     #  Boxplot                        Normal Probability Plot                                          
      8 1                        1     |         0.9+                                            * +++++                            
      6                                |            |                                         +++++                                 
      4 304                      3     |            |                                   *+*++*                                      
      2 91                       2  +-----+         |                               +*+*+                                           
      0 18038                    5  |  +  |      0.1+                         ++*****                                               
     -0 944211                   6  *-----*         |                    ***** *                                                    
     -2 9072                     4  +-----+         |               **+**                                                           
     -4                                |            |          +++++                                                                
     -6 660                      3     |        -0.7+     +*+++*  *                                                                 
        ----+----+----+----+                         +----+----+----+----+----+----+----+----+----+----+                            
    Multiply Stem.Leaf by 10**-1                         -2        -1         0        +1        +2                                 
                                                                                                                                    
                                                                                                                                    


Chapter 6 : Hubble example
Regression without labels and with output statement

                          Plot of resid*VELOCITY.  Legend: A = 1 obs, B = 2 obs, etc.                          
                                                                                                               
 resid |                                                                                                       
       |                                                                                                       
  1.00 +                                                                                                       
       |                                                                                                       
       |                                                        A                                              
       |                                                                                                       
       |                                                                                                       
  0.75 +                                                                                                       
       |                                                                                                       
       |                                                                                                       
       |                                                                                                       
       |                        A                                                                              
  0.50 +                                                                          A                            
       |                                                                             A                         
       |                                                                                                       
       |                                                                                                       
       |                                   A                    A                                              
  0.25 +                                                                                                       
       |             A                                                                                         
       |               A                                                                                       
       |                                                     A                                     A           
       |                                                                                                       
  0.00 +------------------A-------------------------A-----------A---------------------------A----------------  
       |                      A               A                                                                
       |                                                                                                       
       |                                                                                                       
       |                                      A                 A                                              
 -0.25 +                                          A                                                            
       |                                           A                                                           
       |                                                                                                       
       |                                                                 A                                     
       |                                                                                                       
 -0.50 +                                                                                                       
       |                                                                                                       
       |                                    A                                                                  
       |                                                                                 A                     
       |                                                                                                       
 -0.75 +                                           A                                                           
       |                                                                                                       
       ---+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+--  
        -400        -200          0          200         400         600         800        1000        1200   
                                                                                                               
                                                      VELOCITY                                                 
                                                                                                               
NOTE: 1 obs had missing values.                                                                                


Chapter 6 : Hubble example
Test of Lack of Fit

The GLM Procedure

Class Level Information
Class Levels Values
anotherx 19 -220 -185 -130 -70 -30 150 170 200 270 290 300 450 500 650 800 850 920 960 1090

Number of Observations Read 25
Number of Observations Used 24


Chapter 6 : Hubble example
Test of Lack of Fit

The GLM Procedure
 
Dependent Variable: DISTANCE

Source DF Sum of Squares Mean Square F Value Pr > F
Model 18 8.76851166 0.48713954 2.99 0.1146
Error 5 0.81477801 0.16295560    
Corrected Total 23 9.58328967      

R-Square Coeff Var Root MSE DISTANCE Mean
0.914979 44.29325 0.403678 0.911375

Source DF Type I SS Mean Square F Value Pr > F
VELOCITY 1 5.97547364 5.97547364 36.67 0.0018
anotherx 17 2.79303802 0.16429635 1.01 0.5484

Source DF Type III SS Mean Square F Value Pr > F
VELOCITY 0 0.00000000 . . .
anotherx 17 2.79303802 0.16429635 1.01 0.5484


Chapter 6 : Hubble example
Regression forced through the origin

The REG Procedure
Model: MODEL1
Dependent Variable: DISTANCE

Number of Observations Read 25
Number of Observations Used 24
Number of Observations with Missing Values 1


No intercept in model. R-Square is redefined.

Analysis of Variance
Source DF Sum of
Squares
Mean
Square
F Value Pr > F
Model 1 24.04889 24.04889 101.14 <.0001
Error 23 5.46890 0.23778    
Uncorrected Total 24 29.51780      

Root MSE 0.48763 R-Square 0.8147
Dependent Mean 0.91137 Adj R-Sq 0.8067
Coeff Var 53.50434    

Parameter Estimates
Variable DF Parameter
Estimate
Standard
Error
t Value Pr > |t| 95% Confidence Limits
VELOCITY 1 0.00192 0.00019109 10.06 <.0001 0.00153 0.00232


Chapter 6 : Hubble example
Box-Cox transformation with PROC TRANSREG

The TRANSREG Procedure

Transformation Information for
BoxCox(DISTANCE)
Lambda   R-Square Log Like  
-3.00   0.02 -142.489  
-2.75   0.02 -126.999  
-2.50   0.02 -111.702  
-2.25   0.02 -96.634  
-2.00   0.02 -81.840  
-1.75   0.02 -67.378  
-1.50   0.03 -53.325  
-1.25   0.04 -39.778  
-1.00   0.05 -26.873  
-0.75   0.09 -14.787  
-0.50   0.15 -3.762  
-0.25   0.24 5.880  
0.00   0.36 13.735  
0.25   0.48 19.364  
0.50   0.56 22.467 *
0.75   0.61 23.099 <
1.00 + 0.62 21.695 *
1.25   0.62 18.836  
1.50   0.61 15.022  
1.75   0.59 10.597  
2.00   0.57 5.776  
2.25   0.55 0.688  
2.50   0.53 -4.589  
2.75   0.51 -10.009  
3.00   0.49 -15.541  
< - Best Lambda
* - Confidence Interval
+ - Convenient Lambda


Chapter 6 : Hubble example
Box-Cox transformation with PROC TRANSREG

The TRANSREG Procedure

TRANSREG Univariate Algorithm Iteration History for BoxCox(DISTANCE)
Iteration
Number
Average
Change
Maximum
Change
R-Square Criterion
Change
Note
1 0.22699 2.41957 0.50355    
2 0.00000 0.00000 0.67509 0.17154 Converged

Algorithm converged.


Chapter 6 : Hubble example
Box-Cox transformation with PROC TRANSREG

The TRANSREG Procedure

Transformation Information for
BoxCox(DISTANCE)
Lambda   R-Square Log Like  
0.250   0.48 19.36384  
0.500   0.56 22.46662 *
0.600   0.58 22.99847 *
0.650   0.59 23.12123 *
0.675   0.60 23.14838 *
0.676   0.60 23.14900 *
0.677   0.60 23.14958 *
0.678   0.60 23.15014 *
0.679   0.60 23.15065 *
0.680   0.60 23.15113 *
0.681   0.60 23.15158 *
0.682   0.60 23.15199 *
0.683   0.60 23.15236 *
0.684   0.60 23.15270 *
0.685   0.60 23.15300 *
0.686   0.60 23.15327 *
0.687   0.60 23.15351 *
0.688   0.60 23.15371 *
0.689   0.60 23.15387 *
0.690   0.60 23.15400 *
0.691   0.60 23.15409 *
0.692   0.60 23.15415 *
0.693   0.60 23.15418 <
0.694   0.60 23.15417 *
0.695   0.60 23.15412 *
0.696   0.60 23.15404 *
0.697   0.60 23.15393 *
0.698   0.60 23.15378 *
0.699   0.60 23.15359 *
0.700   0.60 23.15338 *
0.750   0.61 23.09910 *
0.800   0.61 22.96291 *
0.900   0.62 22.46393 *
1.000 + 0.62 21.69528 *
1.250   0.62 18.83617  
< - Best Lambda
* - Confidence Interval
+ - Convenient Lambda


Chapter 6 : Hubble example
Box-Cox transformation with PROC TRANSREG

The TRANSREG Procedure

TRANSREG Univariate Algorithm Iteration History for BoxCox(DISTANCE)
Iteration
Number
Average
Change
Maximum
Change
R-Square Criterion
Change
Note
1 0.22988 2.43057 0.49746    
2 0.00000 0.00000 0.66899 0.17154 Converged

Algorithm converged.


Plot of DISTANCE * VELOCITY


Simple Linear Regression Example
Hubbles nebula distance data
Listing of results from the regression output statement

Obs VELOCITY DISTANCE anotherx yhat stdp lclm uclm lcli ucli resid stdi
1 -220 0.27500 -220 0.09705 0.15821 -0.23106 0.42517 -0.80460 0.99871 0.17795 0.43477
2 -185 0.27500 -185 0.14511 0.15148 -0.16905 0.45926 -0.75156 1.04177 0.12989 0.43236
3 -130 0.21400 -130 0.22062 0.14117 -0.07214 0.51338 -0.66878 1.11001 -0.00662 0.42886
4 -70 0.26300 -70 0.30299 0.13035 0.03267 0.57332 -0.57928 1.18526 -0.03999 0.42542
5 -30 0.90000 -30 0.35791 0.12345 0.10189 0.61393 -0.52008 1.23590 0.54209 0.42336
6 150 0.90000 150 0.60504 0.09700 0.40388 0.80620 -0.25855 1.46863 0.29496 0.41641
7 170 0.03200 170 0.63250 0.09470 0.43611 0.82889 -0.22999 1.49499 -0.60050 0.41588
8 200 0.45000 200 0.67369 0.09156 0.48380 0.86357 -0.18735 1.53472 -0.22369 0.41518
9 200 0.63000 200 0.67369 0.09156 0.48380 0.86357 -0.18735 1.53472 -0.04369 0.41518
10 270 0.50000 270 0.76979 0.08593 0.59159 0.94799 -0.08874 1.62832 -0.26979 0.41397
11 290 0.03400 290 0.79725 0.08480 0.62139 0.97311 -0.06080 1.65530 -0.76325 0.41374
12 290 0.50000 290 0.79725 0.08480 0.62139 0.97311 -0.06080 1.65530 -0.29725 0.41374
13 300 0.80000 300 0.81098 0.08432 0.63611 0.98584 -0.04687 1.66882 -0.01098 0.41364
14 450 1.10000 450 1.01692 0.08449 0.84170 1.19214 0.15900 1.87484 0.08308 0.41368
15 500 0.90000 500 1.08557 0.08755 0.90399 1.26714 0.22633 1.94480 -0.18557 0.41432
16 500 1.10000 500 1.08557 0.08755 0.90399 1.26714 0.22633 1.94480 0.01443 0.41432
17 500 1.40000 500 1.08557 0.08755 0.90399 1.26714 0.22633 1.94480 0.31443 0.41432
18 500 2.00000 500 1.08557 0.08755 0.90399 1.26714 0.22633 1.94480 0.91443 0.41432
19 650 0.90000 650 1.29151 0.10392 1.07600 1.50702 0.42446 2.15855 -0.39151 0.41808
20 800 2.00000 800 1.49745 0.12751 1.23300 1.76189 0.61696 2.37793 0.50255 0.42456
21 850 2.00000 850 1.56609 0.13637 1.28328 1.84891 0.67992 2.45227 0.43391 0.42730
22 920 1.00000 920 1.66220 0.14935 1.35247 1.97192 0.76707 2.55732 -0.66220 0.43162
23 960 1.70000 960 1.71712 0.15700 1.39151 2.04272 0.81637 2.61786 -0.01712 0.43433
24 1090 2.00000 1090 1.89560 0.18281 1.51648 2.27471 0.97416 2.81704 0.10440 0.44431
25 1200 . . 2.04662 0.20543 1.62058 2.47266 1.10490 2.98834 . 0.45409