nYear GrpMeanTally y1
1910 4.1 1915
1911 7.2 1915
1912 4.6 1915
1913 5.6 1915
1914 2.3 1915
1915 1.7 1915
1916 4.2 1915
1917 5.2 1915
1918 6.0 1915
1919 1.9 1915
如何使用y1的值爲每個nYear填充y1列作爲前5年的GrpMeanTally值。即Y1每年= GrpMeanTally在nYear-5根據公式從現有列中填充新列
預期了把爲nyear = 1918將GrpMeanTally在nyear = 1918 - 5 = 1913,即Y1 = 5.6
你能把期望的輸出呢? –