fitting a function I have a data consists of three independent variables and dependent variable, I want to fit a model to these data, p=f(x1,x2,x3), how can I find the best fit for these data?
it might be linear, quadratic,...
could you please guide me to find the optimum way to find the model.
 A: As whuber remarks, this is a very broad question, and there are a lot of answers on this site to questions very similar to this. Advice-wise...
THe first step is, you need some domain knowledge about what functions are reasonable for your data. Does quadratic make sense physically? Are you working with a time series? In which case many models and "curve fitting" may not make sense at all, over the long run. And so on.
If you simply want to fit curves, you can fit your data arbitrarily closely with unrealistic models, but what have you accomplished?
So knowing something about your data would help to answer the question in more detail. Also, your goal. Are you simply wanting to smooth the data for clearer display? (There are all kinds of smoothing functions.) Or are you trying to predict future data? Or are you wanting to create a model for understanding how your data comes about? Is it a series over time? (In which case there are specialized methods because the "over time" part introduces relationships between data points that otherwise would not exist.) The answer can be radically different, depending on your answer to these questions.
[EDIT] The second step is: Are you looking for a tool that you can use without understanding its underlying assumptions and what its answers mean? You can easily run a linear model in R and look at its output and see some stars in the summary and say, "Woot, here are your numbers, Mr. CEO" and have it all crash and burn because some other numbers indicate that your answer is +/- 80% which isn't too useful for your career. That is, a simple answer, like "use ABC in program XYZ", or even "use technique PQR" might well make you worse off than you are now.
