load nipa.dat
load cequity.dat

t0    = 1945;
t1    = 1999;
n     = length(t0:t1);
i0    = find(nipa(:,1)==t0);
i1    = find(nipa(:,1)==t1);

gnp   = nipa(i0:i1,2);
prof  = nipa(i0:i1,3);
ptax  = nipa(i0:i1,4);
e     = prof-ptax;

j0    = find(cequity(:,1)==t0);
j1    = find(cequity(:,1)==t1);

v     = cequity(j0:j1,2);


figure(1)
plot(t0:t1,e./v*100,t0:t1,mean(e./v*100)*ones(n,1)) 
title('After-tax Corporate Profits / Stock Market Value x 100')
axis([1940,2000,0,20])
print -deps figure1

figure(2)
plot(t0:t1,e./gnp*100,t0:t1,mean(e./gnp*100)*ones(n,1)) 
title('After-tax Corporate Profits / GNP x 100')
axis([1940,2000,0,10])
print -deps figure2

figure(3)
plot(t0:t1,v./gnp,t0:t1,mean(v./gnp)*ones(n,1)) 
title('Stock Market Value / GNP')
axis([1940,2000,0,2])
print -deps figure3

