x=[2,2,3,4,4,5,6,7,8,9,5]';
y=[10,11,12,13,14,15,20,18,22,25,20]';
[b0,b1,rsq,StdErrEst,StdRes] = linfit(x,y);
disp([b0,b1,StdErrEst,rsq])
fit=b0+b1*x;
plot(x,fit)
hold on
plot(x,y,'*')
hold off
xp=5;
yp=b0+xp*b1;
pptdist=2.262;
[sb1,db1,hxp,dypbar,dypran] = inference(x,StdErrEst,pptdist,xp);
disp([sb1,db1,hxp,dypbar,dypran])
b1p=b1+db1;
b1m=b1-db1;
disp([b1,b1m,b1p])
ypbarp=yp+dypbar;
ypbarm=yp-dypbar;
ypranp=yp+dypran;
ypranm=yp-dypran;
disp([yp,ypbarm,ypbarp,ypranm,ypranp])