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 for Programming
 LabTalk Forum
 Group data with colstats function

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
robbcc Posted - 06/09/2023 : 09:02:23 AM
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2018
Operating System: Windows 10 Pro

Hi,

I want to calculate the statistics of different columns by grouping the data according to a reference column. With the user interface, I can easily do that with the "Group" option inside the "Statistics on Column" dialog (as shown in the next image).



Is it possible to achieve the same result with the "colstats" function? I would imagine it should be something as follows:


Range inputdat = [StatsCol]input!;
Range colref = [StatsCol]input!wcol(1);
Range colout = [StatsCol]output!wcol(1);

colstats inputdat ref:=colref col:=<none> mean:=<none> sd:=<none> median:=colout n:=<none> max:=<none> min:=<none>;


However, the "ref" variable does not work for this function, and I do not find any equivalent variable in the variables list of https://www.originlab.com/doc/en/X-Function/ref/colstats . In other words, I need a variable like "ref" for "colsplit" function or "irng2" for "wunstackcol" function, but that works for "colstats" function. Does it exists?

I also tried the alternative proposed in here: https://www.originlab.com/doc/LabTalk/Tutorials/Tutorial-Statistics#Statistics_on_columns_with_grouping . However, this option generates a report in a new sheet every time that it calculates the statistics, and i would like to have the output data (calculated statistics) in a specific sheet defined by me.

I am new both in this Forum and in working with LabTalk, so I am sorry if I am asking something basic or that it has already been answered before. I already serached in this Forum and in the OriginLab guides and I did not find the solution.

Thanks in advance for any help
3   L A T E S T    R E P L I E S    (Newest First)
paulinasayre Posted - 06/27/2023 : 10:00:48 PM
Thank you very much. Now it works.

....
robbcc Posted - 06/23/2023 : 04:35:14 AM
Hi,

Understood. I wanted to do all by just using colstats function, but I see that I need to use wunstackcol too.

Thank you very much, ChaoC!

Best regards,

robbcc
ChaoC Posted - 06/09/2023 : 11:45:15 AM
Hello,

You can unstack your data first with something like:

wunstackcol -r 2 irng1:=[Book1]Sheet1!D:G irng2:=[Book1]Sheet1!A sort:=data pos:=append;

Then you can just use colstats on the unstacked data.


Best,
Chao

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