SetDirectory["~/Desktop"]

data = Import["Data1.txt", "Table"]

dataplot = ListPlot[data]

Needs["ErrorBarPlots`"]

darg = Table[{{data[[i,1]], data[[i,2]]}, ErrorBar[0.3]}, {i, 1, Length[data]}]

dataplot2 = ErrorListPlot[darg]

a = (data[[Length[data], 2]] - data[[1, 2]])/(data[[Length[data], 1]] - data[[1, 1]])
b = data[[1, 2]]
f[x_] := a*x + b

theoryplot = Plot[f[x], {x, -1, 11}]

Show[dataplot2, theoryplot]

residuals = Table[{{data[[i, 1]], data[[i, 2]] - f[data[[i,1]]]}, ErrorBar[0.3]}, {i, 1, Length[data]}]

ErrorListPlot[residuals]

rchisq = Sum[((data[[i, 2]] - f[data[[i,1]]])/0.3)^2, {i, 1, Length[data]}]/Length[data]

lsq = Fit[data, {1, x}, x]

a = 0.617003
b = 3.6771
f[x_] := a*x + b

theoryplot2 = Plot[f[x], {x, -1, 11}]

Show[dataplot2, theoryplot2]

residuals2 = Table[{{data[[i, 1]], data[[i, 2]] - f[data[[i,1]]]}, ErrorBar[0.3]}, {i, 1, Length[data]}]
ErrorListPlot[residuals2]

rchisq2 = Sum[((data[[i, 2]] - f[data[[i,1]]])/0.3)^2, {i, 1, Length[data]}]/Length[data]