%TABLE2   computations for Table 1: 
%         `Returns to the Value-Weighted Stock Portfolio'
%

%         Ellen McGrattan, 6-15-00

% Subperiods for calculations;

T0       = [1926,1945,1926,1945,1972];
T1       = [1999,1999,1945,1972,1999];
nper     = length(T0);


% Load data

load /usr/people/erm/work/equity/data/ibbotson/tablea1.dat
load /usr/people/erm/work/equity/data/ibbotson/tablea2.dat
load /usr/people/erm/work/equity/data/ibbotson/tablea4.dat
load /usr/people/erm/work/equity/data/ibbotson/tablea6.dat
load /usr/people/erm/work/equity/data/ibbotson/tablea10.dat
load /usr/people/erm/work/equity/data/ibbotson/tablea14.dat
load /usr/people/erm/work/equity/data/ibbotson/tablea15.dat
load /usr/people/erm/work/equity/data/crsp/totmkt.dat

% Nominal returns, with and without dividends, and dividend yields

mrlg     = tablea1(:,2:13)';    
arlg     = tablea1(:,14);       
mdlg     = tablea2(:,2:13)';    
adlg     = tablea2(:,14);       
mrlgx    = mrlg-mdlg;

mrvw     = zeros(12,74);
mrvw(:)  = totmkt(2:889,2);
arvw     = prod(1+mrvw)'-1;
mrvwx    = zeros(12,74);
mrvwx(:) = totmkt(2:889,3);
arvwx    = prod(1+mrvwx)'-1;
mdvw     = mrvw-mrvwx;
advw     = sum( ( mdvw'./(1+mrvwx') .*cumprod(1+mrvwx)')' )';

% Cumulated Returns 

crlg     = cumprod(1+mrlg(:));
crlgx    = cumprod(1+mrlgx(:));
crvw     = cumprod(1+mrvw(:));
crvwx    = cumprod(1+mrvwx(:));

nper     = length(T0);
T0       = T0-1925;
T1       = T1-1925;
divy     = zeros(nper,2);
comp     = zeros(nper,4);
for i = 1:nper;

  t0         = T0(i);
  t1         = T1(i);
  lt         = length(T0(i):T1(i));
  C          = [ones(1,4);crvw,crvwx,crlg,crlgx];
  value      = C(12*t1+1,:)./C(12*(t0-1)+1,:);
  comp(i,:)  = (value.^(1/lt)-1)*100; 
  divy(i,:)  = [mean(advw(t0:t1)),mean(adlg(t0:t1))]*100;

end;

% Add Siegel's estimates:

T0     = T0+1925;
T1     = T1+1925;
T0     = [1802,1802,1871,T0];
T1     = [1997,1870,1925,T1];
nper   = nper+3;

comp   = [8.4, 3.0, NaN, NaN;
          7.1, 0.7, NaN, NaN;
          7.2, 1.9, NaN, NaN;
          comp];

divy   = [5.4, NaN;
          6.4, NaN;
          5.2, NaN;
          divy];
                   

disp('STOCK MARKET RETURNS AND DIVIDEND YIELDS, 1802-1999')
disp(' ')

rlab1 = [' ';' '];
rlab2  = [int2str(T0'),ones(nper,1)*'-', ...
          int2str(T1')];
clab2 = ['3 Value-Weighted'; 
         '3  S&P 500      '];
clab3 = ['Total Return';
         'Cap. Apprec.';
         'Dividend Yld';
         'Total Return';
         'Cap. Apprec.';
         'Dividend Yld'];
A     = [comp(:,1:2),divy(:,1),comp(:,3:4),divy(:,2)];

disp(mattab1(A,1,0,0,clab2,clab3,rlab1,rlab2,0))

