如何获得每年的平均费用?

时间:2019-05-06 10:49:05

标签: r

我需要计算具有此表的年平均索赔成本(由Loss_ID标识)

LOSS_ID         DATE_OF_LOSS    PAID
9338915         07/04/16    32407,8705
11090192    05/03/16    538,5223116
11141663    27/12/15    24391,16819
11194916    19/12/15    18696,16086
12021280    20/11/15    226332,6824
12200329    27/07/15    570,2798236
12803527    06/07/15    290431,0683
13161530    05/05/15    26300,71844
13273193    28/10/14    309157,5554
13290764    23/10/14    9750,473454
15021924    06/10/14    858913,8386

that I transformed to this

     lossYear           V2
  1:     2016   32407.8705
  2:     2016     538.5223
  3:     2015   24391.1682
  4:     2015   18696.1609
  5:     2015  226332.6824
 ---                      
104:     2000  937630.6532
105:     2000  862384.5857
106:     2000  826491.8463
107:     2000 2557670.2650
108:     1999  778954.6528

我不仅应该计算每年的索赔总额,而且还要将每笔索赔的总数除以得出平均费用

0 个答案:

没有答案