The resulting "plot data" (i.e. the red fit curve) is generated by Origin using internally stored parameter results. These results are a lot more accurate (i.e. they have more precision to the right of the decimal point) than the results reported to the Results Log. This is most likely the reason why your manual calculations do not always match our fit results. Therefore, it is recommended that you use these internal values at ALL times (for manual calculations).
To get at them (for polynomial regression), use the stat.pr sub-object properties. In the case of a 6th order polynomial regression, the specific properties are:
- stat.pr.a
- stat.pr.b1
- stat.pr.b2
- stat.pr.b3
- stat.pr.b4
- stat.pr.b5
- stat.pr.b6
As a simple example, suppose you have just performed a 2nd order polynomial fit. You now have access to stat.pr.a, stat.pr.b1, and stat.pr.b2. Suppose further that column 3 of the active worksheet is an X column which is full of arbitrary values. To calculate the 2nd order polynomial result using that X column and then place it in column 4, you could execute the following in the Script window (or the right-hand side of it in the Set Column Values dialog box after selecting column 4 and Column:Set Column Values):
col(4)=stat.pr.a+stat.pr.b1*col(3)+stat.pr.b2*(col(3)^2);
Note: If you were performing a linear fit, the stat.lr sub-object would need to be used. If you were performing a nonlinear fit, the nlsf object would need to be used. Objects, object properties, and object methods are all described in the LabTalk Manual and LabTalk Help File (Help:LabTalk).
I hope this information proves helpful.
- rtoomey