%TABLE1   This program generates Table 1 in 
%
%           Taxes, Regulations, and the Value of US and UK Corporations,
%           by Ellen McGrattan and Ed Prescott
%
%

%         Ellen McGrattan 8-28-03


%
% Data to load:
%     NIPA Table 1.9,   annually  1929-2002
%     NIPA Table 1.16,  annually  1929-2002
%     NIPA Table 6.16B, annually  1948-1987
%     NIPA Table 6.16C, annually  1987-2002
%     NIPA Table 8.25,  annually  1929-2001
%     FOF  Table F.6,   quarterly 1952:1-2003:1
%     Tax on dividends, annually  1960-2000 

load us/raw/nipa109a.dat; 
load us/raw/nipa116a.dat; 
load us/raw/nipa616Ba.dat;
load us/raw/nipa616Ca.dat;
load us/raw/nipa825a.dat;
load us/raw/atab6d.dat;
load us/taxrates/taud.dat

%
% Years to load: Y0 through Y1
%

Y0  = 1960;
Y1  = 2001;

%
% Extract data:
%

nipa109a       = nipa109a(2:30,Y0-1928:Y1-1928)/1000;
nipa116a       = nipa116a(2:39,Y0-1928:Y1-1928)/1000;
nipa616a       = [nipa616Ba(:,1:39),nipa616Ca]/1000;
nipa616a       = nipa616a(2:35,Y0-1947:Y1-1947);
nipa825a       = nipa825a(2:38,Y0-1928:Y1-1928);
fof6a          = qtr2ann(atab6d);
fof6a          = fof6a(Y0-1951:Y1-1951,2:37)'/1000;
taud           = taud(Y0-1959:Y1-1959,2);

%
% Intermediate variables:
%
gdp            = nipa109a(1,:)';
x1m            = (sum(fof6a([10,13,16,20],:))'+ ...
                  .1*sum(fof6a([12,22],:))')./gdp;
ptxc           = nipa116a(11,:)'./gdp;
pbtc           = nipa116a(10,:)'./gdp;
aprffr         = nipa616a(11,:)'./gdp;
tau1           = (ptxc-aprffr)./(pbtc-aprffr)*100;
itc            = nipa825a(25,:)'./gdp;
i              = find(isnan(itc));
if ~isempty(i);
  itc(i)       = zeros(length(i),1);
end;
taux           = itc./x1m*100;


%
% Generate Table:
%

t              = Y0:Y1;
t60            = find(t==1960);
t69            = find(t==1969);
t90            = find(t==1990);
t00            = find(t==2000);
t01            = find(t==2001);

clc
disp('TABLE 1. U.S. Tax Rates and Credits Across and Within Periods')
disp('======================================================================')
disp('                                         1960-1969        1990-2001   ')
disp('                                   -----------------------------------')
disp(' Tax on Corporate Income ')
disp(sprintf( ...
    '    End of period                          %5.1f            %5.1f', ...
         tau1(t69),tau1(t01)))
disp(sprintf( ...
    '    Average for period                     %5.1f            %5.1f', ...
         mean(tau1(t60:t69)),mean(tau1(t90:t01))))
disp(' ')
disp(' Tax on Corporate Distributions ')
disp(sprintf( ...
    '    End of period                          %5.1f            %5.1f', ...
         taud(t69),taud(t00)))
disp(sprintf( ...
    '    Average for period                     %5.1f            %5.1f', ...
         mean(taud(t60:t69)),avgnan(taud(t90:t01))))
disp(' ')
disp(' Investment Tax Credit ')
disp(sprintf( ...
    '    End of period                          %5.1f            %5.1f', ...
         taux(t69),taux(t01)))
disp(sprintf( ...
    '    Average for period                     %5.1f            %5.1f', ...
         mean(taux(t60:t69)),mean(taux(t90:t01))))
disp('======================================================================')
 
