I have a matrix with time observations that are labelled as 1 till 92 for every firm in the matrix. S, assume time 1 refers to march 1996, then every firm in the matrix has a time 1 that refers to march 1996. I tried to take the average of each time period in the matrix by running the following
the issue is that I have different size groups that are equals to 1(large firms), 2(medium size) and 3 (small) and the data is stored in A second column
how can i take the average of each time period for each size group? (i.e when A(i,1)=1 and A(i,2)=3 I want B (i,1) to be the nanmean of the first column of A that have time 1 and size 3 where i is the row number.