nanmean of a variable that should meet 2 conditions
1 回表示 (過去 30 日間)
古いコメントを表示
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
for m=1:92
B(m:92:end,1)=nanmean(A(m:92:end,1));
end
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.
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Shifting and Sorting Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!