reverse-shooting

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

Ftest2.m (588B)


      1 % Ftest2.m  function [F Pval]=Ftest2(R,beta,q,Vhat,J,TK,tle);
      2 %     Conducts an F-Test of H0:  Rbeta=q
      3 %     Uses vcv matrix Vhat, which might be het/sc robust!
      4 %     J  = # of restrictions (d.o.f. for numerator)
      5 %     TK = T-K (d.o.f. for denomenator)
      6 %     tle= Title to be printed (optional)
      7 
      8 function [F,Pval]=Ftest2(R,beta,q,Vhat,J,TK,tle);
      9 
     10 if exist('tle')~=1; tle=[]; end;
     11 
     12 V=R*Vhat*R';
     13 bb=(R*beta-q);
     14 
     15 F = 1/J*bb'*inv(V)*bb;
     16 fprintf(['F-Test ' tle '\n']);
     17 Pval=1-fcdf(F,J,TK);
     18 fprintf(['   Statistic: %6.3f   J: %3.0f   T-K: %3.0f' ...
     19       '   PValue: %5.3f\n'],[F J TK Pval]);