%TABLE4b  This program generates estimates for the UK in the recent
%         period displayed in Tables 4 and 5 of
%
%           Taxes, Regulations, and the Value of US and UK Corporations,
%           by Ellen McGrattan and Ed Prescott
%

%         Ellen McGrattan 9-2-03


%
% Data to load:
%
%     BLUE BOOK 2002, Table 3.3.7, annually 1987-2001
%     BLUE BOOK 2002, Table 3.3.9, annually 1987-2001
%     BLUE BOOK 2002, Table 4.2.7, annually 1987-2001
%     BLUE BOOK 2002, Table 4.2.9, annually 1987-2001
%     BLUE BOOK 2002, Table 4.3.7, annually 1987-2001
%     BLUE BOOK 2002, Table 4.3.9, annually 1987-2001
%     BLUE BOOK 2002, Table 10.5,  annually 1987-2001
%     BLUE BOOK 2002, Table 10.6,  annually 1987-2001
%     BLUE BOOK 1997, Table 5.2,   annually 1986-1996
%     Inland revenue, Table 11.2,  annually 1990-2000
%     NSF, R&D/GDP,                annually 1970-2001
%     Tax rate on dividends,       annually 1990-2000
%     Equity value,                annually 1957-2002
%

load uk/raw/gdp.dat
load uk/raw/bb02_tab337.dat
load uk/raw/bb02_tab339.dat
load uk/raw/bb02_tab427.dat
load uk/raw/bb02_tab429.dat
load uk/raw/bb02_tab437.dat
load uk/raw/bb02_tab439.dat
load uk/raw/bb02_tab105.dat
load uk/raw/bb02_tab106.dat
load uk/raw/bb97_tab52.dat
load uk/raw/nsf.dat
load uk/raw/prftax.dat
load uk/value/equity.dat
load uk/taxrates/taud.dat
bb97_tab52    = [bb97_tab52,[1997:2001;NaN*ones(28,5)]];

%
% Years to load: Y0 through Y1
%

Y0  = 1990;
Y1  = 2001;

%
% Extract data:
%

gdp            = gdp(Y0-1947:Y1-1947,2);
bb02tab337     = bb02_tab337(2:21, Y0-1986:Y1-1986);
bb02tab339     = bb02_tab339(2:53, Y0-1986:Y1-1986);
bb02tab427     = bb02_tab427(2:18, Y0-1986:Y1-1986);
bb02tab429     = bb02_tab429(2:48, Y0-1986:Y1-1986);
bb02tab437     = bb02_tab437(2:17, Y0-1986:Y1-1986);
bb02tab439     = bb02_tab439(2:53, Y0-1986:Y1-1986);
bb02tab105     = bb02_tab105(2:15, Y0-1986:Y1-1986);
bb02tab106     = bb02_tab106(2:15, Y0-1986:Y1-1986);
bb97tab52      = bb97_tab52(2:29,  Y0-1985:Y1-1985);
nsf            = nsf(Y0-1969:Y1-1969,2:15);
corprate       = prftax(Y0-1989:Y1-1989,2:7)';
equity         = equity(Y0-1956:Y1-1956,2);
taud           = taud(Y0-1983:Y1-1983,2);

%
% Intermediate variables
%

tau1           = (sum(corprate([2,5],:))-sum(corprate([3,6],:)))'./ ...
                  sum(corprate([1,4],:))';
AIBR           = bb02tab337(2,:)';
FDCL           = bb02tab337(17,:)';
NHKM           = bb02tab427(2,:)';
NHKS           = bb02tab427(14,:)';
NHNG           = bb02tab437(2,:)';
NHNM           = bb02tab437(14,:)';
taux           = (AIBR+NHKM+NHNG)./(FDCL+NHKS+NHNM);

TMPH           = bb02tab105(8,:)';
CGUP           = bb02tab106(8,:)';
k1m            = (TMPH+CGUP)./gdp;
rdratio        = avgnan(nsf(:,12)./nsf(:,8));
k1u            = rdratio*.650;
AIAD           = bb97tab52(4,:)';
AIAL           = bb97tab52(17,:)';
EXAB           = -bb97tab52(28,:)';
AIAP           = bb97tab52(7,:)';
HDVF           = bb97tab52(11,:)';
fdrat          = (AIAP-HDVF)./(AIAD-EXAB-AIAL);

NKZA           = bb02tab339(36,:);
NLBC           = bb02tab339(46,:);
NLBL           = bb02tab339(41,:);
NLBM           = bb02tab339(42,:);
NLCO           = bb02tab339(51,:);
NKJZ           = bb02tab339(8,:);
NKKI           = bb02tab339(20,:);
NKXO           = bb02tab339(23,:);
NKYJ           = bb02tab339(30,:);
NKYK           = bb02tab339(31,:);
NKXH           = bb02tab339(21,:);
NKXI           = bb02tab339(22,:);
nfdebtl        = NKZA+NLBC-NLBL-NLBM+NLCO;
nfdfil         = NLBL+NLBM;
nfdebta        = NKJZ+NKKI+NKXO+NKYJ+NKYK;
nfdfia         = NKXH+NKXI;

NNWB           = bb02tab429(33,:);
NNWK           = bb02tab429(38,:);
NNXO           = bb02tab429(39,:);
NNYB           = bb02tab429(41,:);
NNYC           = bb02tab429(42,:);
NNYY           = bb02tab429(47,:);
NNXU           = bb02tab429(40,:);
NNSX           = bb02tab429(5,:);
NNTG           = bb02tab429(17,:);
NNUK           = bb02tab429(18,:);
NNUT           = bb02tab429(20,:);
NNUX           = bb02tab429(21,:);
LNPN           = bb02tab429(22,:);
NNVU           = bb02tab429(29,:);
NNUQ           = bb02tab429(19,:);
fmdebtl        = NNWB+NNWK+NNXO+NNYB+NNYC+NNYY;
fmdfil         = NNXU;
fmdebta        = NNSX+NNTG+NNUK+NNUT+NNUX+LNPN+NNVU;
fmdfia         = NNUQ;

NLSY           = bb02tab439(37,:);
NLUA           = bb02tab439(46,:);
NLUI           = bb02tab439(42,:);
NLVM           = bb02tab439(51,:);
NLPL           = bb02tab439(7,:);
NLPU           = bb02tab439(19,:);
NLQW           = bb02tab439(24,:);
NLRE           = bb02tab439(20,:);
NLSH           = bb02tab439(30,:);
NLSI           = bb02tab439(31,:);
fodebtl        = NLSY+NLUA-NLUI+NLVM;
fodfil         = NLUI;
fodebta        = NLPL+NLPU+NLQW-NLRE+NLSH+NLSI;
fodfia         = NLRE;

wgt            = 1;
debtl          = nfdebtl+fmdebtl+fodebtl+wgt*(nfdfil+fmdfil+fodfil);
debta          = nfdebta+fmdebta+fodebta+wgt*(nfdfia+fmdfia+fodfia);
netdebt        = (debtl-debta)'./gdp;

t98            = find([Y0:Y1]==1998);
t00            = find([Y0:Y1]==2000);
t01            = find([Y0:Y1]==2001);
vf1            = (1-taud(t00))*(1-taux(t01))*mean(k1m(t98:t01));
vf2            = (1-taud(t00))*(1-tau1(t01))*k1u;
vf3            = (vf1+vf2)*avgnan(fdrat); 


%
% Generate Table:
%

clc
disp('TABLE 4. A Comparison of Capital Stocks and Tax Rates for the US and UK')
disp('=====================================================================')
disp('                            United States          United Kingdom    ')
disp('                         ---------------------  ---------------------')
disp('                         1960-1969   1990-2001  1960-1969   1990-2001')
disp('---------------------------------------------------------------------')
disp('                                                                     ')
disp(sprintf( ....
     'Domestic tangible/GDP       0.99        1.03                  %5.2f', ...
      mean(k1m)))
disp(' ')
disp(sprintf( ....
     'Estimate of intangible/GDP  0.71        0.65                  %5.2f', ...
      k1u))
disp(' ')
disp(sprintf( ....
     'Foreign/Domestic Profits    0.11        0.29                  %5.2f', ...
      avgnan(fdrat)))
disp(' ')
disp('Tax Rates:')
disp('    Corporate Profits')
disp(sprintf( ....
     '       End of period        45.0        34.9                  %5.1f', ...
             tau1(t01)*100))
disp(sprintf( ....
     '       Average              43.2        35.3                  %5.1f', ...
             mean(tau1)*100))
disp('    Corporate Dividends')
disp(sprintf( ....
     '       End of period        41.8        17.3                  %5.1f', ...
             taud(t00)*100))
disp(sprintf( ....
     '       Average              41.1        17.4                  %5.1f', ...
             avgnan(taud)*100))
disp('    Investment subsidy')
disp(sprintf( ....
     '       End of period         2.2         0.0                  %5.1f', ...
             taux(t01)*100))
disp(sprintf( ....
     '       Average               2.0         0.0                  %5.1f', ...
             mean(taux)*100))
disp('=====================================================================')
disp(' ')
disp(' ')

disp('TABLE 5. Predicted and Actual Corporate Values for the US and UK     ')
disp('=====================================================================')
disp('                            United States          United Kingdom    ')
disp('                         ---------------------  ---------------------')
disp('                         1960-1969   1998-2001  1960-1969   1998-2001')
disp('---------------------------------------------------------------------')
disp(' Predicted Fundamental Values: ')
disp(' ')
disp(sprintf( ...
     '   Domestic tangible       0.563       0.838                  %5.3f',vf1))
disp(sprintf( ...
     '   Domestic intangible     0.229       0.350                  %5.3f',vf2))
disp(sprintf( ...
     '   Foreign capital         0.086       0.379                  %5.3f',vf3))
disp('                           -----       -----                  -----')
disp(sprintf( ...
     '   TOTAL                   0.877       1.567                  %5.3f', ...
         vf1+vf2+vf3))
disp(' ')
disp(' ')
disp(' Actual Market Values: ')
disp(' ')
disp(sprintf( ...
     '   Corporate equity        0.898       1.576                  %5.3f', ...
         mean(equity(t98:t01))))
disp(sprintf( ...
     '   Net Debt                0.041       0.028                  %5.3f', ...
         mean(netdebt(t98:t01))*(1-taud(t00)) ))
disp('                           -----       -----                  -----')
disp(sprintf( ...
     '   TOTAL                   0.940       1.604                  %5.3f', ...
         mean(equity(t98:t01))+mean(netdebt(t98:t01))*(1-taud(t00)) ))
disp('======================================================================')
disp('NOTES: Run table4a.m for third column in Table 4 and Table 5')
