Skip to content

Converting irregular time series data into ts object

4 messages · Upananda Pani, Jeff Newmiller, Gabor Grothendieck

#
Dear All,

I want to convert irregular time series daily data in to ts objects. For
some years I have 305 days data and some years I have 256 days.

I need your suggestion regarding the same.

I have read tutorial on the same but not able to find solutions.

With regards,
Upananda
#
You should read about statistical imputation and decide what approach is appropriate for your data. This mailing list is for questions about R, not about statistics. Once you know what algorithm you need to apply, look up R functions that implement that algorithm using Google or the CRAN Task Views.

If you find yourself with some example code that doesn't work the way you think it should, that would be an appropriate time to first read the Posting Guide and then come back and post a question using plain text email setting rather than html format (so we don't receive a scrambled version of your broken example code).
On February 19, 2020 5:35:29 AM PST, Upananda Pani <upananda.pani at gmail.com> wrote:

  
    
#
Assuming that they both cover the same period of time then
if you are willing to throw away some points then
consider using only these 256 elements from the 305 series

  round(seq(1, 305, length = 50))
  ## [1]   1   7  13  20  26  32  38  44 ...etc...

That is use the 1st ,7th, 13th, etc. point in each year from the
305 series.  This aligns them by throwing away 305-256=49
points per year in the 305 series so that both series can be
set up with a frequency of 256 points per year.
On Wed, Feb 19, 2020 at 8:36 AM Upananda Pani <upananda.pani at gmail.com> wrote:
--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com
#
Sorry there were some errors in my email. Use this instead.

Assuming that they both cover the same period of time then
if you are willing to throw away some points then
consider using only these 256 elements from the 305 series

  round(seq(1, 305, length = 256))
  ##  [1]   1   2   3   5

That is use the 1st 2nd, 3rd, 5th, etc. point in each year from the
305 series.  This aligns them by throwing away 305-256=49
points per year in the 305 series so that both series can be
set up with a frequency of 256 points per year.

On Wed, Feb 19, 2020 at 10:37 AM Gabor Grothendieck
<ggrothendieck at gmail.com> wrote: