%PLOTS    plot final figures related to regulatory costs.

%         Ellen McGrattan, 2-10-2012


load emppop.dat
load spend.dat

t        = emppop(:,1);
gr       = 1.019.^(t-2004);

pop1664  = emppop(:,5);
ftetot   = emppop(:,2)./pop1664;
ftegov   = emppop(:,3)./pop1664;
ftereg   = emppop(:,4)./pop1664;

def      = spend(:,5);
gdp      = spend(:,4)./(def.*gr.*pop1664);
gdp0     = gdp(1);
gdp      = gdp/gdp0*100;
govtot   = spend(:,2)./(def.*gr.*pop1664)/gdp0*100;
govreg   = spend(:,3)./(def.*gr.*pop1664)/gdp0*100;

figure(1)
plot(t,ftegov/ftegov(1)*100,'-bo',t,ftereg/ftereg(1)*100,'-r+', ...
     t,ftetot/ftetot(1)*100,'-k')
legend('Total Government','Federal Regulatory Activities','U.S.~economy')
title('Full-time Equivalent Employment Relative to the Populuation 16-64', ...
      'Fontsize',16)
figure(2)
plot(t,govtot/govtot(1)*100,'-bo',t,govreg/govreg(1)*100,'-r+',t,gdp,'-k')
title('Detrended Government Spending and GDP','Fontsize',16)
legend('Total Government','Federal Regulatory Activities','GDP')

tab1 = [t,[ftegov/ftegov(1),ftereg/ftereg(1),ftetot/ftetot(1)]*100];
tab2 = [t,[govtot/govtot(1),govreg/govreg(1)]*100,gdp];
disp('=========================================================')
disp('             FTE Employment        Govt. Spending        ')
disp('         ----------------------   ----------------       ')
disp('   Year   Govt. Regulatory Total  Total Regulatory   GDP ')
disp('==========================================================')
disp(' ')
disp(sprintf('%7g%8.2f%8.2f%8.2f%10.2f%8.2f%8.2f\n',[tab1,tab2(:,2:4)]'))
disp('===========================================================')


