I have data for three commodities for which I conducted a time series analysis using VARselect and VAR functions in "vars" package in R.

  • How do I describe their joint evolution using the VAR model?
  • Also, I know how to generate scatter plots for pairwise correlation but would like to know how to create pair-wise correlation plots using a three-month window for the data?

1 Answer 1


I think you may find this link helpful regarding the interpretation of VAR models.

As windows, you can do this using the window function of the ts{} package. Create a time series object, and then a window using

foo_ts <- ts(data, start = c(2000, 1), end = c(2016, 1))
foo_window <- window(data, start = c(2002, 1), end = c(2005, 1)

To make correlograms, one package that makes pretty plots is corrplot. Make a dataframe of your time series windows, and try using


This is a great website for that package.

Alternatively, you could use the corrgram package, in which case

corrgram(dataframe, order=NULL, lower.panel=panel.pts, upper.panel=NULL)

might give what you're looking for.

  • $\begingroup$ I have daily data for 10 years so does a 3-month window mean that I need to convert that into quarterly data by setting frequency as 4? $\endgroup$
    – user120973
    Jul 5, 2016 at 8:50
  • $\begingroup$ For daily data over a long period, frequency = 7 is a good place to start. You could also make a multiple seasonality ts object, as seen here $\endgroup$ Jul 5, 2016 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.