Sum series including NA
Posted: Fri Apr 11, 2014 7:02 am
Hello,
how can I sum series including NAs and finally divide r_Sum by the included available observations in a loop?
Here you can see my example:
year r1 r2 r3 r_Sum Division by included amount of observations (r_Sum/n_included)
1992 NA NA 0.2 0.2 0.2/1
1993 NA NA -0.4 -0.4 0.1/1
1994 NA 0.4 0.4 0.8 0.8/2
1995 0.2 0.4 -0.5 0.1 0.1/3
Thanks for your answer :D
how can I sum series including NAs and finally divide r_Sum by the included available observations in a loop?
Here you can see my example:
year r1 r2 r3 r_Sum Division by included amount of observations (r_Sum/n_included)
1992 NA NA 0.2 0.2 0.2/1
1993 NA NA -0.4 -0.4 0.1/1
1994 NA 0.4 0.4 0.8 0.8/2
1995 0.2 0.4 -0.5 0.1 0.1/3
Thanks for your answer :D