%This MATLAB scriptfile answers exercise 15 (a) og (b) in 
%Eriksen og Lauritzen (2004).
% (a) is obtained by adding 1412 to aa and ab
% (b) is obtained by ba and bb
x=[0.80,1.09,0.86,0.80,0.78,0.85,0.50,0.84,0.84,1.02,0.87,0.80,0.66,0.84,0.72];
m=mean(x)
s=std(x)
aa=[m-tinv(0.975,14)*s/sqrt(15),m+tinv(0.975,14)*s/sqrt(15)]
ab=[m-tinv(0.995,14)*s/sqrt(15),m+tinv(0.995,14)*s/sqrt(15)]
ba=[s*sqrt(14/chi2inv(0.75,14)),s*sqrt(14/chi2inv(0.25,14))]
bb=[s*sqrt(14/chi2inv(0.975,14)),s*sqrt(14/chi2inv(0.025,14))]
