Author |
Topic |
|
dylee
USA
7 Posts |
Posted - 06/05/2015 : 8:51:07 PM
|
Origin Ver . and Service Release (Select Help-->About Origin): Operating System:
Hello ,
I am working on the weighted linear regression. I just wonder how could I assign the data points with the weighting value I defined or prepared. As follows, the Xi, Yi and SD denotes the independant variable, dependant variable and the standard deviation of Yi. Now, I got a linear curve with the linear fitting at the "No weighting" mode. I want to add weighting to do the weighted linear regression. For the Weighting data, I want to use the data of the wi column as "weighting factor". how could I realize it? Thanks. What's versions of OriginPro is required. Thanks very much.
Xi Yi SD wi 0 0 0.02 2.833879608 0.1 12.36 0.02 2.833879608 0.2 24.83 0.07 0.231337111 0.3 35.91 0.13 0.067074074 0.4 48.79 0.22 0.023420493 0.5 60.42 0.33 0.010409108
|
Edited by - dylee on 06/07/2015 03:05:04 AM |
|
snowli
USA
1381 Posts |
Posted - 06/06/2015 : 12:23:07 PM
|
Hello, You can right click the wi column header and choose the context menu Set as: YError. Then highlight column Yi and wi and open Linear Fit dialog.
If you expand Input Data node, you will see X, Y and Y Error columns are assigned correctly.
Then under Fit Options node, choose Direct Weighting from Error as Weight dropdown list.
Click OK to do the fit.
You can read more explanation of different weighting methods on our online help http://www.originlab.com/doc/Origin-Help/LR-Dialog
Thanks, Snow |
|
|
dylee
USA
7 Posts |
Posted - 06/07/2015 : 03:03:27 AM
|
Hi Snow,
Thanks very much for the reply, which provides help information,especially the tutorial I am learning.
I am sorry I did not make my question clear. The Wi column should be the data of the "Weighting factor" accounting for the variance in measuring Yi. Values of Wi are calculated using the equation: Wi=(nSi^-2)/(ΣSi^-2) Where Si is the standard deviation with Yi (Si namely the SD column). The use of a weighting factor ensures that the contribution of each pair of XY values to the regression line is proportional t the precision with which Yi is measured.
The blue section is cited from <Modern Analytical Chemistry> by Dr.Harvey.
In this case, how can I realize the weighting fitting in Origin with the Wi column as the 'weighting factor' instead of the weighting data.
Thanks very much.
By the way, could you have a email address left for me please?Thanks a lot.
Dylee.
quote: Originally posted by snowli
Hello, You can right click the wi column header and choose the context menu Set as: YError. Then highlight column Yi and wi and open Linear Fit dialog.
If you expand Input Data node, you will see X, Y and Y Error columns are assigned correctly.
Then under Fit Options node, choose Direct Weighting from Error as Weight dropdown list.
Click OK to do the fit.
You can read more explanation of different weighting methods on our online help http://www.originlab.com/doc/Origin-Help/LR-Dialog
Thanks, Snow
|
Edited by - dylee on 06/07/2015 03:07:09 AM |
|
|
cdrozdowski111
USA
247 Posts |
Posted - 06/07/2015 : 2:39:11 PM
|
Dylee,
I reviewed Harvey's methodology for weighted linear fitting (which can be found in the electronic version of his text found here: http://acad.depauw.edu/harvey_web/eText%20Project/pdf%20file/AC2.0.pdf)
His method of weighting may not easily be adapted for use by Origin's built in linear fitting. So, using the steps he outlines in his text, I produced an analysis template (for Origin 2015) that exactly follows his weighted linear fitting calculations.
You can (for a brief time) download the analysis template here:
https://dl.dropboxusercontent.com/u/88808916/Harvey%20Weighted%20Linear%20Fit.ogw
To use it, open the analysis template from the File->Open menu. Then simply fill in your X, Y, and standard deviation values and it will do all the rest of the calculations and produce a plot that includes the original XY data points as a scatter plot and his weighted fitting points as a line plot.
It should be noted that in his text, Harvey applies sig figs manually as he goes which is a process that does not lend itself to automation via software. Therefore, the values calculated by the analysis template may not exactly match those he presents in the text.
I hope this helps. |
Edited by - cdrozdowski111 on 06/07/2015 2:41:33 PM |
|
|
dylee
USA
7 Posts |
Posted - 06/07/2015 : 8:11:57 PM
|
Hi Christopher,
Thanks very much for helping me on this. I am so surprised that you spent so much time finding Harvey's book, review it and preparing a worksheet for according to Harvey's calculation. Thanks more than I can say. Also, I admire you deeply for your sophisticated skill of Origin. Using the worksheet you provided, I put the dataset above and got the graph you showed. I calculated the residual error of the weighted fitting, as follows: Residual -0.044459048 0.05142991 0.257318869 -0.926792173 -0.310903215 -0.945014256
The residual does not show to be appropriate as the Figure 5.13(a) in Harvey's book. Harvey compared the fitting curve with weighting and no-weighting in Figure 5.14 without giving respective residual plot.
[1] How to do think of his weighting ? Successful? [2] It seems results I used in your worksheet provide the same result of the "Instrumental weighting" in Origin. Do you think they can be the same?
Thanks very much.
Best,
DY
quote: Originally posted by cdrozdowski111
Dylee,
I reviewed Harvey's methodology for weighted linear fitting (which can be found in the electronic version of his text found here: http://acad.depauw.edu/harvey_web/eText%20Project/pdf%20file/AC2.0.pdf)
His method of weighting may not easily be adapted for use by Origin's built in linear fitting. So, using the steps he outlines in his text, I produced an analysis template (for Origin 2015) that exactly follows his weighted linear fitting calculations.
You can (for a brief time) download the analysis template here:
https://dl.dropboxusercontent.com/u/88808916/Harvey%20Weighted%20Linear%20Fit.ogw
To use it, open the analysis template from the File->Open menu. Then simply fill in your X, Y, and standard deviation values and it will do all the rest of the calculations and produce a plot that includes the original XY data points as a scatter plot and his weighted fitting points as a line plot.
It should be noted that in his text, Harvey applies sig figs manually as he goes which is a process that does not lend itself to automation via software. Therefore, the values calculated by the analysis template may not exactly match those he presents in the text.
I hope this helps.
|
|
|
cdrozdowski111
USA
247 Posts |
Posted - 06/07/2015 : 9:41:58 PM
|
Dylee,
I think we can say that Harvey's method is instrumental weighting using the standard deviation data as Y-Errors. He broke it down in a way where it was not so easy to deduce what he was doing without actually doing it and testing. I'm glad you went a step further.
To be sure, you could create some different test data and compare.
If you use Origin to Linear Fit the original data (using the std dev as Y error) both with and without weighting, you can look in the Report Sheets generated in the workbook. In those reports, you'll see the residual plots for both fittings. The residual plot for No Weighting actually looks better than that of the Instrumental weight fit. Perhaps it is simply that the example data doesn't lend itself to deeper scrutiny.
Cheers, Chris |
|
|
|
Topic |
|
|
|