%Spring 2000, TAM 203 Prelim 1, 2, and 3 scores.
%Run this MATLAB file to get histograms and stats.
%  -A. Ruina   4/7/2000
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Prelim 1&2 scores
AB=[86	71
87	82
72.5	38
83.5	53
85.5	78
89.5	84
97.5	90
96.5	93
78	    86
82	    61
62.5	50
92	    81
87	    74
66.5	60
84	    83
84.5	64
71.5	56
87.5	87
95.5	83
94	    89
65   	43
87.5	64
86	    67
90	    86
61.5	68
94.5	79
95.5	85
89	    70
60.5	60
65	    52
96.5	90
80	    82
82.5	65
73	    46
76.5	75
91   	90
84.5	91
92.5	61
60.5	52
66.5	57
78.5	83
77.5	72
98	    95
89	    72
69	    24
63.5	71
91.5	57
86.5	67
92.5	99
86	    79
81	    66
92.5	92
72	    41
77	    62
87	    46
74.5	61
86	    61
70	    87
77.5	86
93	    91
76.5	62
46	    74.5
57	    75
80	    62
96	    64
98	    71
78	    75
83	    39
80.5	62
87	    98
78.5	48
80	    67
78	    93
89.5	99
60	    0
96.5	98
92.5	87
78	    78
61.5	34
76	    61
94.5	90
87.5	51
83	    86
91.5	93
76	    35
86	    76
90	    86
94	    65
65.5	71
93.5	78
92	    88
92	    76
84.5	89.5
62.5	70
59	    30
74 	    52
60  	53
73  	52
74  	68
67  	17
71	    71
54.5	61
88.5	71
99	    97
93.5	95
92.5	90
97	    87
92.5	84
75.5	50
90	    56
67  	57
68	    70
69.5	48
87.5	61
65	    72
99.5	97 ];

%prelim 2 scores
A=AB(:,1);


%prelim 2 scores
B=AB(:,2);

%prelim 3 scores
C=[1];

fprintf('\n\n***************************************************************\n')
fprintf('       PRELIM I,II,II STATISTICS, TAM 203, SPRING 2000 \n')
fprintf('       ------------------------------------------------ \n ')
fprintf('                                      Prel I   Prel 2   Prel 3 \n')
fprintf('Number of students                 = %8i %8i %8i \n',...
          [length(A) length(B) length(C)])
fprintf('Number with scores of 100          = %8i %8i %8i \n',... 
          [sum(A==100) sum(B==100) sum(C==100)])
fprintf('Number with scores of above 90     = %8i %8i %8i \n',... 
          [sum(A>90) sum(B>90) sum(C>90)])
fprintf('Number with scores less than 60    = %8i %8i %8i \n',... 
          [sum(A<60) sum(B<60) sum(C<60)])
fprintf('Mean                               = %8.1f %8.1f %8.1f \n',... 
          [mean(A) mean(B) mean(C)])
fprintf('Median                             = %8.0f %8.0f %8.0f \n', ...
          [median(A) median(B) median(C)])
fprintf('Sandard dev                        = %8.1f %8.1f %8.1f \n',...
          [std(A) std(B) std(C)])
fprintf('***************************************************************\n')
fprintf('           (See Figure window for histograms)                  \n')
fprintf('    (Do more calculations with the matrix A if you want.)      \n')

figure(1)
subplot(2,1,1)
A=sort(A);
i=1:length(A);
plot(A,i)
xlabel('Score on Prelim 1');  ylabel('# students with at least that score')
title('Prelim 1 cumulative  distribution')
axis([50 100 0 120])

subplot(2,1,2)
hist(A, 2.5 + 5*[0:19])
xlabel('Score on Prelim 1');  ylabel('# students (in 5 point bins)')
title('Prelim 1  distribution')
axis([50 100 0 25])

figure(2)
subplot(3,1,1)
B=sort(B);
i=1:length(B);
plot(B,i)
xlabel('Score on Prelim 1');  ylabel('# students with at least that score')
title('Prelim 1 cumulative  distribution')
axis([30 100 0 120])

subplot(3,1,2)
hist(B, 2.5 + 5*[0:19])
xlabel('Score on Prelim 1');  ylabel('# students (in 5 point bins)')
title('Prelim 1  distribution')
axis([30 100 0 25])

subplot(3,1,3)

plot(AB(:,1), AB(:,2),'*')
axis('equal')
axis([50 100 30 100])
xlabel('prelim 1 score')
ylabel('prelim 2 score')
title('Cross plot')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
