% TAXSIM      compute an estimate of the average marginal rate on 
%             dividends for the period 1960-2000 using rates from
%             TAXSIM (for Federal plus State) and adjustments for 
%             nontaxed entities.

%             Ellen McGrattan, 9-17-03
%             Revised, ERM, 6-15-11

%
% Data to load:
%     Tax rates from TAXSIM, NBER,       annually 1979-2010
%     Fraction of nontaxed equities,     annually 1952-2010

load taxsim_fsl.dat
load nontaxed.dat
load orddiv.dat
q        = zeros(32,1);
q(25:30) = orddiv(:,3)./orddiv(:,2);
q(31:32) = q(30);

Tau      = ((1-q).*taxsim_fsl(1:32,4)+q.*taxsim_fsl(1:32,5))/100;
Nontx    = nontaxed(28:59,3);
Taud     = Tau.*(1-Nontx);

tem     = [ [1979:2010]',Tau,Nontx,Taud];


clc
disp('     Table X.  Derivation of the Tax Rate on Dividends          ')
disp('----------------------------------------------------------------')
disp('                Avg. Marginal    Fraction     Estimate of       ') 
disp('                Rate from        of Equity    Avg. Marginal     ')
disp(' Year           TAXSIM           Sheltered    Tax rate (a)')
disp('----------------------------------------------------------------')
disp(sprintf(' %4g         %8.3f %16.3f %16.3f \n',tem'))
disp('---------------------------------------------------------')
disp(' (a) estimates for nonprofit equities only available 1987-2000')

