load inc1977.dat
load inc2014.dat

[n,m]   = size(inc1977);
tot77   = inc1977(1,:);
nret77  = inc1977(2:n,1);
int77   = inc1977(2:n,2);
div77   = inc1977(2:n,3);

[n,m]   = size(inc2014);
tot14   = inc2014(1,:);
nret14  = inc2014(2:n,1);
int14   = inc2014(2:n,2);
div14   = inc2014(2:n,3);

lint77  = [[0;cumsum(nret77)/tot77(1)],[0;cumsum(int77)/tot77(2)]];
lint14  = [[0;cumsum(nret14)/tot14(1)],[0;cumsum(int14)/tot14(2)]];
ldiv77  = [[0;cumsum(nret77)/tot77(1)],[0;cumsum(div77)/tot77(3)]];
ldiv14  = [[0;cumsum(nret14)/tot14(1)],[0;cumsum(div14)/tot14(3)]];

figure(1)
plot(lint77(:,1),lint77(:,2),'-o',lint14(:,1),lint14(:,2),'-x')
figure(2)
plot(ldiv77(:,1),ldiv77(:,2),'-o',ldiv14(:,1),ldiv14(:,2),'-x')
