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
 Data Reduction for non-equally spaced binns

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
Milkomeda Posted - 01/05/2018 : 08:04:35 AM
Origin Ver. and Service Release: Origin 2018
Operating System: Windows 7

Goal: getting the Mean of the user-defined bin-boundaries applied X-values and getting the Means of the Y-values corresponding to bin-boundaries imposed on X-values

Already tried method: Reduce by Group (given in Analysis --> Dada Manipulation) has been tried. This method is only relevant when intervals or the groups are equally spaced in X-values. However, my goal is to get the Mean of unequally spaced bin-boundaries defined by the user.
For example, From Col(A), the Mean of: row 1 to row 5, from row 5 to row 10, from row 10 to row 20, from row 20 to row 40 and so on. And the Mean of the Y-values corresponding to bin-boundaries imposed on X-values.

Method of 2D Binning or Logarithmic Binning is also not helping.

Warning: I am not good at programming

Thanks in Advance
MilkoMeda
1   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 01/05/2018 : 1:34:05 PM
Hi MilkoMeda,

You can run the following script, assuming your data is stored in col(A) in Book1, and col(A) in
Book2 contains the row# 's of bin boundaries. For example, when [Book2]!col(A) has {1, 5, 10, 20},
the means of bins correspond to: 1...5, 5...10, and 10...20.

////////////////////////////////////////////////////////
range r2A=[Book2]1!col(A);  //Bin boundaries 
range r2B=[Book2]1!col(B);  //Output column
nbin=r2A.getSize();         //number of bins
for(ibin=1; ibin<nbin; ibin++) {  //Repeat times of bins
  range rv=[Book1]1!col(A)[$(r2A[ibin]):$(r2A[ibin+1])]; //Target range
  r2B[ibin]=mean(rv);   //Assign mean value
}
////////////////////////////////////////////////////////
The output would be stored in col(B) of Book2.

Hope this helps.

--Hideo Fujii
OriginLab

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