This is probably a question about econometric methods rather than one about R, While I would probably use an information criterion this would only be my first step in determining an appropriate lag length. One needs to check 1. The whiteness of the residuals 2. Non-normality and 3. Structural Change. One then may need to amend the selected lag to take account of any problems that are revealed by the relevant tests. Only when you are satisfied that your model is correct you should proceed with your causality tests. These matters are well covered in texts such as Lutkepohl (2005), New introduction to multiple time series analysis, Springer (see Chapter 4)
Looking at the example you quote I might say that the automatic first differencing of I(1) series and doing granger causality tests on the differenced series is not a valid option if there is cointegration. When there is cointegration the usual test statistics do not have the standard distributions. This is covered in section 6.6 and chapter 7 of Lutkepohl's book. John C Frain 3 Aranleigh Park Rathfarnham Dublin 14 Ireland www.tcd.ie/Economics/staff/frainj/home.html mailto:fra...@tcd.ie mailto:fra...@gmail.com On Fri, 2 Nov 2018 at 09:00, John <miao...@gmail.com> wrote: > Hi, > > I see an R user chooses the lag of Granger causality by finding out the > lag for the most significant result > https://www.r-bloggers.com/granger-causality-test/ > > Is it generally legitimate to do so, without determining the lag first > by AIC or BIC? > > Thanks, > > John > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.