statistics - Unbalanced Anova in Matlab -


I'm new to Mattel and I'm pretty sure how this is done.

Looking at an unbalanced dataset:

  G1G2G ____________ 3 4 2 2 6 6 3 1 5 6 9  

How would you do ANOVA on this dataset? It is currently saved as three arrays.

anova1 (some dataset) works fine if all the columns are the same length, but Matlab does not like concatenating arrays of different lengths is. Do I Need To Use A Different Data Structure? Thanks!

You can use anova1 in general, but you can group your data and use MATLAB Will tell that they are grouped and should work:

  clack x 1 = [3; 2; 6; 5]; X2 = [4; 1; 3; 6; 9]; X3 = [2; 6; 1]; Data = [x1 'x2' x3 ']; % // Your Data Group = {'G1', 'G1', 'G1', 'G1', 'G2', 'G2', 'G2', 'G2', 'G2', 'G Create line vector with 3. ',' G3 ',' G3 '}; % // Set the groups according to above data [p1] = anova1 (data, group, 'closed') Use the 'off' option to prevent showing // table / box plot. P1 = 0.711 9  

Edit: After playing around, Mhh looks like you fill vectors with NaN so that they work from the same length Can; This means that it gives the same P-value and the box plot looks the same. I do not know that it is valid, although I had to go with the first method :)

Code:

  z1 = [3; 2; 6; 5; NaN]; Z2 = [4; 1; 3; 6; 9]; Z3 = [2; 6; 1; Nain; Nan]; Z = [z1 z2 z3] [p2] = anova1 (Z)  

Comments