Testing For Independent Observations

oneway-last-stepIn this final step of developing the oneway advisor I want to check the assumption of “independence”.  Specifically I want to test whether there is any evidence of serial correlation on the residuals.  

The Durbin-Watson Test

Detecting the presence of serial correlation in the residuals can be performed using the Durbin-Watson test that is found under row diagnostics within the Fit Model platform.  Here are the steps:

Specify the model appropriate to the oneway analysis of variance:


Select Durbin-Watson from the Row Diagnostics options:



This adds an additional outline to the Fit Model window:


From the red triangle turn on the option to show the p-value:


So now we just want to do the same thing in JSL in a function that I will call Test Independent Observations.

Test Independent Observations

This function should be added to the JSL file Analysis Components. (This file was first introduced in step 4).

Invoking the Function

Open file step6.jsl.  The block of code that checks the assumptions can now be extended:

Save the revisions as step7.jsl (no, no, we’ve finished!) “oneway advisor.jsl“.

Final Output


The code is now complete, but you may want to think about packaging it as an add-in.


2 thoughts on “Testing For Independent Observations”

Leave a Reply

Your email address will not be published. Required fields are marked *