Hi. I have monitoring data which were collected every three hours, as shown below. I am trying to fill the gaps using the moving average of the observations (Ex. For missing observations in row 4 and 5, I want to put the average of values in row 3 and 6).

Thank you very much for your help!


variable_a
1. .
2. .
3. 4.928571
4. .
5. .
6. 4.833333
7. .
8. .
9. 7.547619
10. .
11. .
12. 8.285714
13. .
14. .
15. 9
16. .
17. .
18. 9.619047
19. .
20. .
21. 9.380953
22. .
23. .
24. 8.476191
25. .
26. .
27. 7.285714
28. .
29. .
30. 5.357143