|
find and graph the least squares regression line.
First, we'll plot the data points:
> with(plots):
> plot([[80,824], [81,972], [82,882], [83,1027], [84,1252], [85,1198], [86,1537], [87,1927], [88,2015], [89,2144]], style=point, symbol=diamond, color=blue);

We'll store this information using the name dataplot:
> dataplot:=":
We'll now use the Maple command fit:
> with(stats):
> fit[leastsquare[[x,y], y=a*x+b, {a,b}]]([[80, 81, 82, 83, 84, 85, 86, 87, 88, 89], [824, 972, 882, 1027, 1252, 1198, 1537, 1927, 2015, 2144]]);

We now plot the graph of the least squares line:
> plot(25882/165*x-1959692/165, x=80..89);

We'll store this information using the name lineplot:
> lineplot:=":
Finally, we combine these plots:
> plots[display]({dataplot, lineplot},view=[79..90, 800..2150]);
