%PROGRAM NAME xiaoxin.m
% This code addresses the data that xiaoxin and her team are using for
% their STAT447 project. It is included in the Excel file named
% 'data set for STAT 447 project xiaoxin' and is also in the Matlab format
% in the filename 'data'
load data
% X(j,k) = Number of freshman/transfers for jth year & kth county
X = data(:,3); 
X = reshape(X,20,59);
J = 1976:1995; J = J';
figure(1)
plot(J,X)
xlabel('Year')
ylabel('No. of Students')
title('Trends of Entering ISU Students for 59 IA Counties')
pause
Xsum = sum(X,2);
figure(2)
plot(J,Xsum,'-*')
xlabel('Year')
ylabel('No. of Students')
title('Trends of TOTAL No. of Entering ISU Students')
grid
pause
Y = data(:,4);
Y = reshape(Y,20,59);
for j = 1:59
    j
    figure(1)
    plot(J,X(:,j),J,Y(:,j),'r')
    xlabel('Year')
    ylabel('No. of Students')
    title('Trends of Entering ISU Students(BLUE) & HS Grads (RED) for jth County')
    grid
    pause
    plot(Y(:,j),X(:,j),'*')
    xlabel('County HS Graduates')
    ylabel('No. of Entering ISU Students')
    title(' Scatter Plot of HS Grads vs Entering ISU Students for jth County')
    grid
    pause
end