Lack of Fit Test

Example from the Coral Reef data on page 179. Steps for the LOF test:
  1. Get an estimate of the Pure Error Sum of Squares from the One-way ANOVA: Here are the SAS commands for doing fitting a One-way analysis of variance model.
    	proc anova data=sasuser.rwg179;
    	class reef;
    	model dens = reef;
    	run;
    

    The Pure ERROR sum of squares will be on the line for "ERROR" in the ANOVA TABLE. i.e. SS(Pure Error) = 0.0369080 with 18 df

    This is equivalent to finding the sample Variance in each "group" (reef in this case) and summing over the groups: Sum (nj - 1)*VARj where nj is the number of observations in group j and Varj is the sample Variance in group j. You would only do this for groups where there is more than one observation. The df = Sum (nj - 1) summing over the groups. You may want to verify this by hand.

  2. Break down the residual Sum of Squares from regression model:

    RSS = Pure ERROR + Lack of Fit

    Same for df: RESIDUAL df = PE df + LAF df.

  3. Form the analysis of Variance table for the Lack of Fit test.
    		      DF      SS      MS         F
    	Residual:     25   0.2407   
    	   LOF         7   0.2038    .2038/7     F = (.2038/7)/(.0369/18) = 14.2
               PE         18   0.0369    .0369/18
    
  4. Compare F = 14.2 (with 7 and 18 df) to F in tables.

    F (alpha = .05) is between 2.66 and 2.51

    F (alpha = .001) is between 6.35 and 5.76

  5. Since F > F(alpha) ==> significant Lack of Fit of the linear model.