I have two separate files. One is 1000x50 and the other is 1000x30. The first table has 50 subjects (one column = one subject) and 1000 signals (rows = signals), whereas the second table has 30 subjects and 1000 signals. I want to perform a two sample ttest for each of the 1000 rows of data comparing the values between the 50 subject group (group1) and the 30 subject group (group2) and then find which of the 1000 rows have a p-value less than 0.05. I wanted to create a new variable that would find and contain all the p-values less than 0.05 but I'm having trouble doing so. I wrote some code below but not sure if I'm in the right direction. Any insights would be really appreciated!
for i=1:50
group1=data1(:,i)
for j=1:31
group2=data2(:,j)
[h(i,j),p(i,j)]=ttest2(group1,group2)
end
end