Least Squares Fitting—Polynomial

data=Table[{x,-x^3+2x^2+5x+3+RandomReal[{-1,1}]},{x,-1,1,.02}]

data={{-1,4},{-0.92,1},{-0.84,5},{-0.8,7},{-0.72,6},{-0.64,3},{-0.56,2},{-0.48,2},{-0.36,5},{-0.24,12},{-0.12,13},{0,11},{0.12, 7}, {0.32,-2},{0.4,-6}, {0.52,-8},{0.64,-2},{0.76,4},{0.92,9}}

data//Transpose// MatrixForm

Fit[data,Table[x^i,{i,0,3}],x]

Manipulate[
fit=Fit[data,Table[x^i,{i,0,d}],x];
Plot[fit,{x,-1,1},PlotRange->{Min[data]-1,Max[data]+1},Epilog->{Point[data]}],
{d,0,15}]