Search code examples
xmgrace

xmgrace: finding the sum of residuals


I am using xmgrace's curve fitting option (DATA-->TRANSFORMATION-->REGRESSION), and I want to find the sum of all residuals^2. xmgrace has an option giving me all the residuals, and I already took the square of this, but I want to find the sum of the squares. How do I do this?


Solution

    • Identify the set where rediduals^2 is kept. Let's say it is s4.
    • Go to tab Window -> Commands. A small window will pop up.
    • Assuming you want to sum the y of residual^2 set, type in s5 point 0,sum(s4.y). Press enter. This will add all the y values in set s4 and place it in y of s5.
    • If no error pops up, type in updateall. This will update the new set s5.
    • The sum of residual^2 will be in s5(y).