0

Apologies, I am sure there is a quick answer, but google can't find it...

How do I change the sample period of a timeseries (GARCH specifically) regression. I have data from April 2019 to April 2020. How do I make it from January 2020 to April 2020?

Thank you in advance.

Roy
  • 41
  • 4
  • Does this answer your question? [How to subset by date in R](https://stackoverflow.com/questions/51447665/how-to-subset-by-date-in-r) – maydin Jul 29 '20 at 14:30
  • Yes, that's the way I have been doing it but was hoping there could be a more direct way, e.g. an option: smpl = (2000/09/01; 2010/01/01) – Roy Jul 29 '20 at 14:41
  • You must be sure that your date column is really in a date format firstly. Then you can filter them easily. Look [this one](https://stackoverflow.com/questions/19420155/subset-rows-according-to-a-range-of-time) or [this one](https://stackoverflow.com/questions/52285626/selecting-timestamps-within-range-in-r) please. – maydin Jul 29 '20 at 14:48

1 Answers1

0

Found it https://rdrr.io/cran/xts/man/subset.xts.html

It turns out it is quite straightforward.

Roy
  • 41
  • 4