reverse-shooting

Matlab scripts for reverse shooting
Log | Files | Refs | README

Ftest.m (567B)


      1 % Ftest.m  function [F Pval]=Ftest(uR,uU,J,TK,tle);
      2 %     Conducts an F-Test given 
      3 %
      4 %     uR = Restricted residuals
      5 %     uU = Unrestricted residuals
      6 %     J  = # of restrictions (d.o.f. for numerator)
      7 %     TK = T-K (d.o.f. for denomenator)
      8 %     tle= Title to be printed (optional)
      9 
     10 function [F,Pval]=Ftest(uR,uU,J,TK,tle);
     11 
     12 if exist('tle')~=1; tle=[]; end;
     13 num=(uR'*uR - uU'*uU)/J;
     14 den=uU'*uU/TK;
     15 F=num/den;
     16 fprintf(['F-Test ' tle '\n']);
     17 Pval=1-Fcdf(F,J,TK);
     18 fprintf(['   Statistic: %5.2f   J: %3.0f   TK: %3.0f' ...
     19       '   PValue: %4.2f\n'],[F J TK Pval]);