Make cell arrays the same size for ttest

6 views (last 30 days)
I have this cell array called Th. But the columns are not the same size. I want to conduct the ttest on this data. The first 4 columns is one group and the second 4 columns is the other group. I was thinking that perhaps I could look at the column with the lowest size which is 88276 X 1(4th column), and make the oher columns that size. Is this a good approach? I tried zeropadding ( look at the max and zeropad the rest of the columns to match the max size) but I dont think that's correct?

Accepted Answer

Star Strider
Star Strider on 3 Apr 2023
An acceptable alternative for unpaired data, (and the two vectors having unequal lengths would suggest this), that does not require the two vectors to have the same lengths is the Wilcoxon ranksum test. The advantage is that ranksum assumes that the two vectors have the same distribution, although the actual distribution is irrelevant. The ttest2 function for unpaired data requires that the arguments have the same lengths as well.
Generating multiple comparisions between the two groups could be a problem. I am not certain what to suggest with respect to that.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!