The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Averageing ys for xs with degeneracy.

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
total Posted - 09/10/2005 : 01:32:21 AM
in my set of date there are few (x,y) pairs with the same x, it looks like:
x y
1 5
1 4
1 4
2 5
3 5
3 7
I need to simply average the ys for all the ones, all the twos and so on, this is in order to make a graph for which each x has only one y.
as I have 10000 points of data for which x is changing over 200 different numbers, I cannot do it manually and I wonder what function can do this very simple analyzis.
(if any of you is aware of such a matlab/mathematica/exel function, he is welcome to sugest it)
Thanks
Tal
4   L A T E S T    R E P L I E S    (Newest First)
minimax Posted - 12/20/2005 : 12:47:26 AM
Hi mbst,

Origin's next version, version 8, will support grouped descriptive statistics.

quote:

till now i use MSAccess to solve such jobs...
but i'm also looking for an xls or origin-tool which calculates mean, stDev and number of values, grouped by one (ore more) alphanumeric columns WITHOUT sorting
greetings
mbst





Max
OriginLab GZoffice
mbst Posted - 12/16/2005 : 07:40:16 AM
till now i use MSAccess to solve such jobs...
but i'm also looking for an xls or origin-tool which calculates mean, stDev and number of values, grouped by one (ore more) alphanumeric columns WITHOUT sorting
greetings
mbst

total Posted - 09/11/2005 : 11:39:58 PM
Mike,
Thanks alot for your help


Mike Buess Posted - 09/10/2005 : 10:14:15 AM
Hi Tal,

Since you didn't indicate your Origin version I'll give you a LabTalk solution that will work in all versions. To try it out just copy the lines of code below to the script window, select all lines and press Enter. If you need to use it more than once you can assign the code to the Custom Routine button as explained here...

http://www.originlab.com/www/support/resultstech.aspx?ID=769&language=English

# Code starts here
%W=%H; // remember name of active wks
get col(1) -e npt; // how many rows?
win -t D; %N=%H; // create new wks and save its name
wo -a 1; // create third column for counts
set %N -er npt; // make sure the wks has enough rows
rr=1; // initialize row number
nn=1; // initialize count
xx=%(%W,1,1); // initialize X value from first row
yy=%(%W,2,1); // initialize Y value (sum) from first row
# loop over remaining rows
loop (i,2,npt) {
if(%(%W,1,i)==xx) {
# if X value matches previous X value...
yy+=%(%W,2,i); // add Y value to sum
nn++; // increment count
} else {
# else record results...
%(%N,1,rr)=xx; // X value to 1st column
%(%N,2,rr)=yy/nn; // average Y value to 2nd column
%(%N,3,rr)=nn; // count to 3rd column
rr++; // increment row #
nn=1; // reset count
xx=%(%W,1,i); // new X value
yy=%(%W,2,i); // new Y value (sum)
};
};
%(%N,1,rr)=xx; // record final X value
%(%N,2,rr)=yy/nn; // record final Y value
%(%N,3,rr)=nn; // record final count

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000