%TABLE2   This program generates Table 2 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
%     FOF  Table F.6,   quarterly 1952:1-2003:1

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

%
% Years to load: Y0 through Y1
%

Y0  = 1952;
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);
fof6a          = qtr2ann(atab6d);
fof6a          = fof6a(Y0-1951:Y1-1951,2:37)'/1000;
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);
profit         = nipa116a(9,:)'./gdp;
t              = Y0:Y1;
t69            = find(t==1969);
t01            = find(t==2001);
t60s           = find(t==1960):t69;
t90s           = find(t==1990):t01;


%
% Assumptions:
%
beta           = 0.98;
gam60s         = 0.03;
gam90s         = 0.02;
eta            = 0.01;
k1m            = 1;

%
% Generate Table:
%

g60s           = gam60s+eta;
g90s           = gam90s+eta;
i60s           = (1+gam60s)/beta-1;
i90s           = (1+gam90s)/beta-1;
del60s         = mean(x1m(t60s))/k1m-g60s;
del90s         = mean(x1m(t90s))/k1m-g90s;
x1m60s         = mean(x1m(t60s));
x1m90s         = mean(x1m(t90s));
prf60s         = mean(profit(t60s));
prf90s         = mean(profit(t90s));
tprf60s        = i60s*x1m60s/((1-tau1(t69))*(g60s+del60s));
tprf90s        = i90s*x1m90s/((1-tau1(t01))*(g90s+del90s));
iprf60s        = prf60s-tprf60s;
iprf90s        = prf90s-tprf90s;
k1u60s         = iprf60s/(i60s-g60s);
k1u90s         = iprf90s/(i90s-g90s);
clc
disp('TABLE 2. Estimating Intangible Capital ')
disp('======================================================================')
disp('                                         1960-1969        1990-2001   ')
disp('                                   -----------------------------------')
disp(' U.S. Values ')
disp(sprintf( ...
     '    Corporate tax rate                     %5.3f            %5.3f', ...
          tau1(t69),tau1(t01)))
disp(sprintf( ...
     '    Growth rate of real GDP                %5.3f            %5.3f', ...
          g60s,g90s))
disp(sprintf( ...
     '    Real interest rate                     %5.3f            %5.3f', ...
          i60s,i90s))
disp(sprintf( ...
     '    Tangible depreciation rate             %5.3f            %5.3f', ...
          del60s,del90s))
disp(sprintf( ...
     '    Average corporate investment           %5.3f            %5.3f', ...
          x1m60s,x1m90s))
disp('    Contributions to profits:')
disp(sprintf( ...
     '       Tangible assets                     %5.3f            %5.3f', ...
             tprf60s,tprf90s))
disp(sprintf( ...
     '       Intangible assets                   %5.3f            %5.3f', ...
             iprf60s,iprf90s))
disp(sprintf( ...
     '       Total                               %5.3f            %5.3f', ...
             prf60s,prf90s))
disp(' ------------------------------')
disp(' ')
disp(sprintf( ...
     ' Estimate of Intangible capital            %5.3f            %5.3f', ...
       k1u60s,k1u90s))
disp('======================================================================')
 
