Polyfit is a great tool to fit a line to a set of points. However my data has varying levels of statistical significance.
For example, for one point (x1,y2) I might only have 10 observations, while for another point (x2,y2) I might have 10,000 observations. I usually have at least 10 points and I'd like to weight each according to statistical significance when using polyfit. Is there any way (or a similar function) that allows for that?