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
 Statistics on rows for non contiguous data

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
jasonjensen Posted - 02/17/2010 : 1:19:07 PM
Origin Ver.8 and Service Release (Select Help-->About Origin):
Operating System:Vista

I was wondering if it is possible to do statistics on rows for non contiguous data?

I have a data set with 20 columns and I would like to get the mean, standard deviation and standard error of the values in certain columns for each row (i.e. the mean the values row1 col 4, row 1 col 8, row 1 col 12 etc...) and then have the statistical values placed in colums at the end of the workbook.

I would like to use the built in statistics tool because some of the values may be blank so using Set Column Values could get tricky.

Also, I know I could move the columns so that they are contiguous, but I have a lot of data generated this way so it would be easier to use the statistics package if possible.

Thanks,

Jason
6   L A T E S T    R E P L I E S    (Newest First)
Zisternas Posted - 02/14/2011 : 1:38:35 PM
Ok, I have found the reason why it was not working. When I rename books and sheets, the books have still a short name, which is the one to be used in the code, while the sheets are renamed.
So in my case:
rowstats irng:=([Book1]MyName!B,[Book1]MyOthername!D,[Book2]AnotherNweName!A)
mean:=[Results]RowStats!<new name:=Mean>
sd:=[Results]RowStats!<new name:=StdDev>
min:=[Results]RowStats!<new name:=Min>
max:=[Results]RowStats!<new name:=Max>
n:=[Results]RowStats!<new name:=N>;

now is working, thanks greg for the code!

(I write it down in case some other newbie has the same question)
Zisternas Posted - 02/10/2011 : 09:20:57 AM
Hi Greg,

Thanks for your fast answer.

But I'm having a problem when running the script, it says:

Failed to resolve range string, VarName = irng, VarValue = ([Book61]Sheet1!B,[Book61]Sheet1!D,[Book61]Sheet2!A,[Book61]Sheet3!C)
#Command Error!


I am totally newbie with the Labtalk expressions and I have tried solve it by myself, but I didnīt understand the use of irng. Could you help me?
Also I have a question, do I have to write the Long name of the book or the short one, or both are valid? By the way, do the sheets have such a thing like short and long name, or if I rename a sheet I have to indicate this modified name in the code?

Sorry for extending the question, but I don't find these answers in the manuals.

Thanks in advance!
greg Posted - 02/09/2011 : 5:17:58 PM
You cannot do stats on rows from multiple sheets in the GUI, but it can be done with script:

rowstats irng:=([Book1]Sheet1!B,[Book1]Sheet1!D,[Book2]Sheet3!A,[Book2]Sheet3!C)
mean:=[Results]RowStats!<new name:=Mean>
sd:=[Results]RowStats!<new name:=StdDev>
min:=[Results]RowStats!<new name:=Min>
max:=[Results]RowStats!<new name:=Max>
n:=[Results]RowStats!<new name:=N>;

Above gets stats of columns B and D of Sheet1 in Book1 along with columns A and C of Sheet3 in Book2 and puts the results in a sheet named RowStats in a book named Results.
Zisternas Posted - 02/09/2011 : 08:01:08 AM
Hi,



I have the same situation, but my columns are in different sheets of the book. I would like to have statisitcs in rows from columns in different sheets, and if possible to be created in a new sheet inside the book. I have tried the same code and it works fine, but only inside each sheet, how could I modify it?


Thanks in advance!

Madoro
jasonjensen Posted - 02/17/2010 : 3:28:19 PM
That worked perfectly.

Thank you for the fast reply.

Jason
easwar Posted - 02/17/2010 : 3:00:55 PM
Hi Jason,

Try this:
1> Hold CTRL key down and click and select desired columns by clicking on header, so you will then end up with only the desired columns selected/highlighted
2> Open script window (menu: Window->Script window) and then copy paste the following line of code and press Enter key:
rowstats mean:=<new> sd:=<new> sem:=<new> n:=<new>;

This will then add new columns for mean, sd etc. You can look up the rowstats X-function for more details.

Does this do what you wanted?

Easwar
OriginLab

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