I hope that this will help. The Excel table has the columns titles. I use the following code:
Clear["`*"];
data = Import[SystemDialogInput["FileOpen"], "XLSX"][[1]];
dataDRO = Drop[data, {1}];
xlab = data[[1, 1]];
ylab = data[[1, 2]];
xcol = dataDRO[[All, 1]];
ycol = dataDRO[[All, 2]];
(* Linear model weighted *)
weight = 1/xcol^2;
model = LinearModelFit[dataDRO, x, x, Weights -> weight];
equation = Normal[model];
slope = Select[equation[[2]], # Epsilon Reals &, 1];
intercept = equation[[1]];
predicted = (ycol - intercept)/slope;
(* The table *)
accuracy = predicted*100/xcol;
qwerty = Transpose[Flatten /@ {xcol, ycol, predicted, accuracy}];
Grid[Prepend[qwerty, {xlab, ylab, "Predicted", "% Accuracy"}],
Alignment -> Right, Background -> None,
Dividers -> {All, {1 -> True, 2 -> True, -1 -> True}}]
Print["y = ", model["BestFit"]]
Print["R2 = ", model["RSquared"]]
(* The plot *)
Show[
ListPlot[dataDRO, PlotStyle -> PointSize[0.01]],
Plot[model["BestFit"], {x, 0, Max[xcol]}],
Frame -> {{True, False}, {True, False}},
FrameLabel -> {xlab, ylab},
AspectRatio -> 1/GoldenRatio,
ImageSize -> 500]
Fit,ListPlot,Plot,Show,AxesLabelandEpilog. – wxffles Jul 30 '12 at 20:16