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
 Basic Binning

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
AndreaP88 Posted - 09/18/2014 : 05:04:16 AM
Hi!

I guess my question is a common issue, so I ask it again in case something changed with the new version of Origin.

I have a set of data (X and Y) and I need to do the following two types of binning:

Procedure A (constant steps)

-Finds the max and min in X
-Divide this interval in a number of bins chosen by me
-For each bin it creates a new set X, say X', where each entry is the central point of each bin (for "central" I mean the following: if I have (0,0,0,1,1) the central is 0.5)
-Of all the points falling in a bin, it takes the mean and standard deviation, and writes these two set of datas in Y' and another column for the error

Procedure B (constant information)

-Does the same thing but this time instead of fixing the number of bins, it allows me to fix the number of points per bin. However the X intervals should be calculated in the following way: if I have (3 ; 3.5 ; 4 ; 4.5 ; 5 ; 5.5) and I want three datas per bin the results should be (3 ; 3.5 ; 4) and ( 4 ; 4.5 ; 5) discarding 5 (so not (3 ; 3.5 ; 4) and ( 4.5 ; 5 ; 5.5) otherwise there is a hole of 0.5 between 4 and 4.5)

Is there a way to do these two calculations with Origin?

Thanks in advance!

Origin 9.1.0
Windows 8.1
1   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 09/18/2014 : 5:50:51 PM
Hi AndreaP88,

For Procedure A, please try the following for your XY worksheet (col(1) for the 1st column, col(2) for 2nd column):

1) Sort the worksheet on the X column ascending
2) Get min and max of X column by:
sum(col(1));
  sum.min=;
  sum.max=;
3) Run the freq counts with:
- Set the Input to X column
- Turn OFF the "Auto" check box of the bin begin and end
- Enter the above min and max values there
- Select "Number of Bins" for Step By option, and enter the number of bins of your choice

4) Add extra column in the original XY worksheet, and run the following
script to set the group# in this extra column
/////////////////////////
range dest=1!col(3);
range ref=2!col(3);
NB=ref.getSize();
start=0;
gg=1;
for(ii=1; ii<=NB; ii++) {
  NJ=ref[ii];
  for(jj=1; jj<=NJ; jj++) {
    dest[start+jj]=gg;
  }
  start=start+jj-1;
  gg++;
}
dest[start+1]=gg-1; //for the last cell as max
/////////////////////////////
5) For col(2), run Stats on Column such that:
- Set the Recalculate mode to None
- Grouping Range set to col(3) for mean and SD.

6) In the result, insert a column before the Mean, then
- copy-and-paste the bin centers in freq table in 3) into this new column.
- Set the designation of this column as X.

Hope this helps.

--Hideo Fujii
OriginLab

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