<<"LinearRegression`"

<<"MultivariateStatistics`"

data1={{5,6},{6,7},{11,6},{13,8},{20,13},{21,20},{22,21},{22,23},{25,15},{26,20},{27,22},{31,17},{34,30},{37,31},{37,33},{41,14},{42,39},{44,31},{49,39},{50,41}};
n=Length[data1]
g1=ListPlot[data1,PlotStyle->PointSize[Large]];
striebro=Table[data1[[j,1]],{j,1,n}]
olovo=Table[data1[[j,2]],{j,1,n}]
r=Correlation[striebro, olovo]//N
Regress[data1, {x},x]
Regress[data1 ,{x},x,IncludeConstant->False]
f1=Regress[data1,{x},x,IncludeConstant->False,RegressionReport->{BestFit}]
func=Fit[data1,{1,x},x]
g2=Plot[BestFit/.f1,{x,-20,100}];
Show[g1,g2]

data1={{18.6,18.58},{27.6,27.37},{27.5,27.27},{25,24.64},{24.5,24.1},{26.8,26.33},{29.7,29.33},{26.5,26.63}};
n=Length[data1]
g1=ListPlot[data1,PlotStyle->PointSize[Large]];
tytracne=Table[data1[[j,1]],{j,1,n}]
polygraficky=Table[data1[[j,2]],{j,1,n}]
r=Correlation[tytracne, polygraficky]//N
Regress[data1, {x},x]
f1=Regress[data1,{x},x,RegressionReport->{BestFit}]
func=Fit[data1,{1,x},x]
g2=Plot[BestFit/.f1,{x,-20,100}];
Show[g1,g2]

data1={{5.6,6.2},{5.9,5.7},{5.9,5.6},{5.7,6},{5.8,6.3},{5.7,5.8},{6,5.7},{5.5,6},{5.7,6},{5.5,5.8}};
n=Length[data1]
g1=ListPlot[data1,PlotStyle->PointSize[Large]];
tytracne=Table[data1[[j,1]],{j,1,n}]
polygraficky=Table[data1[[j,2]],{j,1,n}]
r=Correlation[tytracne, polygraficky]//N
Regress[data1, {x},x]
Regress[data1 ,{x},x,IncludeConstant->False]
f1=Regress[data1,{x},x,IncludeConstant->False,RegressionReport->{BestFit}]
func=Fit[data1,{1,x},x]
g2=Plot[BestFit/.f1,{x,-20,100}];
Show[g1,g2]