How to group data for MANOVA1 analysis

6 views (last 30 days)
Makunda Aryal
Makunda Aryal on 20 Sep 2021
Answered: Jeff Miller on 21 Sep 2021
I have the data whose dimension is 84*84. Here 84 is the observation from 3 different groups (each group has 28 that is first 28 rows 1st group , 2nd 28 rows is 2nd group and so on). I would like to perform the MANOVA1 in attached data ( the attached data has 85*84 and first row was added just for grouping so in the last part of code X = table2array(t2(:,2:85)); I used from 2 to 85). I used the following code but when I run I got the error "The within-group sum of squares and cross products matrix
is singular." can anybody help me on this why I got that error and how to solve? or is there another way I can do the MANOVA1 on this data set?
t10 = load("Manova1Data.txt");
t = t10';
t2 = array2table(t);
t2.Group = repmat({'Group?'},height(t2),1);
GroupA = t2.t1>=1 & t2.t1<=28;
t2.Group(GroupA) = repmat({'GroupA'},sum(GroupA),1);
GroupB = t2.t1>=29 & t2.t1<=56;
t2.Group(GroupB) = repmat({'GroupB'},sum(GroupB),1);
GroupC = t2.t1>=57 & t2.t1<=84;
t2.Group(GroupC) = repmat({'GroupC'},sum(GroupC),1);
X = table2array(t2(:,2:85));
[d,p,statsTrain] = manova1(X,t2.Group);

Answers (1)

Jeff Miller
Jeff Miller on 21 Sep 2021
84*84 is not going to work, sorry. For MANOVA, you need to have more cases in each group than the number of variables. Some possible alternatives:
  • Select out different subsets of the variables for different MANOVAs.
  • Use principal components analysis to reduce the number of variables by summarizing the 84 into a much smaller number of "components" that represent the variables almost as well. (This could be very helpful if there are reasonable correlations among variables within certain subsets of the 84.)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by