% data for Exercise Set 7.6

ex = input('Exercise number (1-4, 7, 10-13, 17)? ');

if ex==1
   X = [1 0;1 1; 1 2;1 3], y = [1;1;2;2] 
elseif ex==2
   X = [1 1;1 2;1 4;1 5], y = [0;1;2;3] 
elseif ex==3
   X = [1 -1;1 0;1 1;1 2], y = [0;1;2;4] 
elseif ex==4
   X = [1 2;1 3;1 5;1 6], y = [3 2 1 0] 
elseif ex==7
   disp('Try to construct X, "beta", and y yourself.  That is the point of the')
   disp('exercise. After that, if you want the data here, select Exercise 27.') 
elseif ex==27
   X = [1 1;2 4;3 9;4 16;5 25], y = [1.8 2.7 3.4 3.8 3.9]' 
elseif ex==10
   disp('Try to construct X, "beta", and y yourself.  That is the point of the')
   disp('exercise. After that, if you want the data here, select Exercise 28.') 
elseif ex==28
   X = [exp(-.2) exp(-.7);exp(-.02*11) exp(-.07*11);exp(-.02*12) exp(-.07*12)]
   y = [21.34; 20.68; 20.05] 
elseif ex==11
   disp('Try to construct X, "beta", and y yourself.  That is one point of the')
   disp('exercise. After that, if you want the data here, select Exercise 29.') 
elseif ex==29   
   X = [1 3*cos(.88); 1 2.3*cos(1.1); 1 1.65*cos(1.42); 1 1.25*cos(1.77); 1 1.01*cos(2.14)]
   r = [3.00; 2.30; 1.65; 1.25; 1.01] 
elseif ex==12
   disp('Try to construct X, "beta", and y yourself.  That is one point of the')
   disp('exercise. After that, if you want the data here, select Exercise 30.') 
elseif ex==30
   X = [1 3.78;1 4.11;1 4.41;1 4.73;1 4.87], p = [91;98;103;110;112] 
elseif ex==13
   X = [1 -1;1 3;1 6;1 12], X1 = X(:,1), X2 = X(:,2) 
elseif ex==17
   X = [1 -3.5;1 -.5;1 1.5;1 2.5], y = [1;2;3;3] 
else
   disp('No data for this exercise in Section 7.6.') 
end
