Thanks a lot.
 
When testing if the residuals of ARIMA is autocorrelated,
degree of freedom of Ljung-Box Q stat.  is just the number of lag, or the number of lag minus the number of parameter in gretl?