The Ljung Box statistic, also known as the modified Box Pierce statistic, is a function of the accumulated autocorrelations, ρj, up to time lag m. It’s calculated as:
Q(m)=n(n+2)∑[n−jρj2]
In this case, time lag = 3
Thus,
Q(3)=333(335)[3320.122+331(−0.17)2+330(−0.09)2]=17.32