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
 Average and SEM in Matrix

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
luismramirezr Posted - 10/03/2015 : 11:00:53 AM
Origin Ver. and Service Release (Select Help-->About Origin): 2015
Operating System: Windows 10


Hi,

I have 9 matrices with 8 columns and 6 rows. Each cell corresponds to the same cell in the other matrices.

What I want is to create 2 new matrices, one with the average result of each cell and the other one with the SEM.

I know I can do this like

(Mat(1)+Mat(2)+(Mat(3)+Mat(4)+Mat(5)+Mat(6)+Mat(7)+Mat(8)+Mat(9))/9)


for example, but what if i have like 100 matrices??

Is there an easier way? Isn't there an option like "Statistics on Columns/Rows"?

Thank you,

Luis
1   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 10/06/2015 : 11:38:09 AM
Hi Luis,

Here is probably the least script involved procedure for many matrices to calculate
the mean and SE at each cell position:

We assume that all matrices are stored in matrix objects in a matrix sheet in a matrix.

1) "Matrix Set Dimension/Labels" menu. Change the matrix size with 1 column and NxM rows,
e.g., when originally 8 columns by 6 rows, you set them as 1 column by 48 rows.
Also, turn ON "Rearranged" radio button for "Data will be" option.
==> Every matrix becomes 1-column format.

2) Run the following script to copy all matrices into the columns in a worksheet:
(In this sample, the matrix is in MBook1, worksheet is in Book1)
for(ii=1; ii<=MBook1!wks.nmats; ii++) {
  range mm=[MBook1]1!$(ii);
  range ww=[Book1]1!wcol(ii);
  ww=mm;
}
3) Highlight all columns in the worksheet, and seelect "Statistics: Descriptive Stats: Stats on Rows" menu.
Turn ON Mean and SE of mean check boxes under Quantities to Compute branch.

4) Add 2 new matrix objects in the matrix, and copy-and-paste the Mean column into the first added matrix object.
Do the same for the the SE column.

5) Reconvert the matrices back to NxM dimensions - select "Matrix Set Dimension/Labels" menu,
turn ON "Rearranged" radio button for "Data will be" option.

Note that one matrix sheet in a matrix book can contain 65527 matrix objects!

--Hideo Fujii
OriginLab

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