Summing over observations in unbalanced panel data
古いコメントを表示
Hello, I have an unbalanced panel data set. For each id, I'd like to sum all values of x up to the latest time I observe that id, and record the summation to a new variable. How can I do this? Ideally, I'd like to avoid looping as I have a large dataset and I try to speed up the process.
Thank you in advance!
Selcen
3 件のコメント
the cyclist
2024 年 8 月 16 日
Can you upload the data, or a small representative sample? You can use the paper clip icon in the INSERT section of the toolbar.
dpb
2024 年 8 月 17 日
As @the cyclist notes, w/o a sample dataset we're pretty-much without recourse to a direct reponse, but look at rowfun and/or splitapply
Selcen Cakir
2024 年 9 月 25 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!