Author |
Topic  |
|
sandram
Germany
Posts |
Posted - 04/27/2006 : 04:40:50 AM
|
Origin Version 7 Operating System: windows XP
I have multiple curves (each with its own x-values) and use "average multiple curves". And now I want to add the y-error of this averaging. I can't find the values for that and I don't find a button where I can calculate them. |
|
Mike Buess
USA
3037 Posts |
Posted - 04/27/2006 : 09:29:39 AM
|
You can create a button that averages the curves and then adds error bars by assigning the following script to the Custom Routine button as explained here
if( run.section(GRANALY,AveCurves) ) return; %P=%H; // find name of graph window %Z=""; layer -c; // count dataplots %W=%[%[%Z,#count],#1,_]; // find name of wks containing the averages win -a %W; // activate that wks loop(i,1,count-1) { wks.addCol(); // add col to wks %A=%[%Z,#i]; // find name of ith dataplot %(%H,i+2)=%A(col(1)); // interpolate that dataset at X values in col(1) }; wo -s 3 0 wks.ncols 0; // select col 3 and greater run.section(WKS,StatRow); // find statistics on rows %S=%H; // find name of stats wks win -a %W; // activate average wks loop(i,4,wks.ncols) {del col(4)}; // delete all cols beyond 3 wks.col3.name$=sd; // rename col3 "sd" wks.col3.type=3; // set as Y-err %W_sd=%S_sd; // copy sd col from stats wks win -cd %S; // close stats wks win -a %P; // activate graph layer -i %W_sd; // plot error bars layer -a; // rescale to show all data
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 04/27/2006 10:26:50 AM |
 |
|
easwar
USA
1965 Posts |
Posted - 04/27/2006 : 8:36:31 PM
|
Hi sandram,
There is also a worksheet template in Origin that is set up to perform averaging with error bars.
To open the template, do the following: 1> Invoke the menu command File->New 2> In the dialog, select Worksheet in the list on top. 3> The click the Path button and navigate to the Origin Exe path and the Buttons subfolder. Then click OK. 4> Set the Name drop-down to ASSAYS (this may show by default already) and click OK.
The template will open and then you can first pick your data format XYYYY or XYXYXY and then specify the number of replicates and then click Display button to update the worksheet. Then you can paste in your data and click the Average button.
A couple of points to note:
In the graphical average curve method, Origin takes the x values of the active curve and then finds y values for other curves at these x values using interpolation.
In the ASSAYS template case as well interpolation of the data is done.
So in either case the x values you end up with are not necessarily the x values that existed in the raw data (for every curve). If you are interested in getting y average and y error only at the x values that existed in your data, you may need to code that using LabTalk or Origin C for now. We will be addressing this issue in the next version.
Easwar OriginLab
Edited by - easwar on 04/27/2006 8:38:23 PM |
 |
|
|
Topic  |
|
|
|