The function " Define rss" Is not summing up the equation correctly. It was working before I changed the scale of the Plot3D margins, but I really can't see why its not working. Any help would be amazing.
t = Import[
"http://www.doc.gold.ac.uk//~ma302jh//RegressionExample.xls"];
tp = t[[1]];
t1 = Table[tp[[i]], {i, 2, Length[tp]}];
xcol = Table[t1[[i]][[1]], {i, 1, Length[t1]}];
ycol = Table[t1[[i]][[2]], {i, 1, Length[t1]}];
zcol = Table[t1[[i]][[3]], {i, 1, Length[t1]}];
Clear[DefineRSS];
DefineRSS[a_?NumericQ, b_?NumericQ,
c_?NumericQ] := (rss = Total[(zcol - a*xcol + b*ycol + c)^2];
(a*x) + (b*y) + c)
Manipulate[
With[{plane = DefineRSS[a, b, c]},
Show[Plot3D[plane, {x, -10, 1000}, {y, -10, 100},
AxesLabel -> {X, Y, Z}, PlotLabel -> rss,
PlotStyle ->
Directive[Yellow, Specularity[White, 20], Opacity[0.5]]],
Graphics3D[{Red, PointSize[Medium],
Point[Transpose[{xcol, ycol, zcol}]],
Line[Transpose[{{xcol, ycol, zcol}, {xcol, ycol,
plane /. Thread[{x, y} -> {xcol, ycol}]}}, {2, 3, 1}]]}],
PlotRange -> {{0, 1000}, {0, 60}, {-100, 500}}]], {a, 0,
1}, {b, -1, 5}, {c, -60, 300}]