% close all
clear all
aa=load('../Données/hurruc.data');
t=0.5*(aa(:,1)+aa(:,2));
h=aa(:,8);
mu=mean(h(t<1970));
xb2=mean(h(t>=1970));
s=std(h(t>=1970));
n=length(h(t>=1970));
ts=abs(xb2-mu)/(s/sqrt(n))
ts1=tp(ts,n-1)

aa=load('../Données/hurruc.data');
t=0.5*(aa(:,1)+aa(:,2));
h=aa(:,8);
n1=length(h(t<1970));
n2=length(h(t>=1970));
xb1=mean(h(t<1970));
xb2=mean(h(t>=1970));
s2=((n1-1)*var(h(t<1970))+(n2-1)*var(h(t>=1970)))/(n1+n2-2);
ts=abs(xb1-xb2)/sqrt(s2)/sqrt(1/n1+1/n2)
tp(ts,n1+n2-2)