Question: Assigning operator to the output of an entered command

My problem is as follows:

With the Statistics package (or whichever other package) I will do a PolynomialFit on some data. This will result in a function, e.g. x^2. How do I assign this output (which appears to be the function only, no other bells attached) to an actual function which I can later refer to (I want to do as follows):

with(Statistics)

f(x):=PolynomialFit(n, DATA, variable)

f(3) = 3^2

See the attached screenshot for what actually happens:

It appears as if it tries to run PolynomialFit but with a different argument when I do this.

Help would be appreciated as to how I can define the output of PolyFit as a function.

Please Wait...