code works correctly for calculating significance

rationale for F-stat may be wrong, however