function [r] = reg(x,y);
%calculates a regression coefficient
covar=cov(x,y);
r=covar(2,1)/var(x);


