Skip to content
Back to formatted view

Raw Message

Message-ID: <CAEezrQSjJuFWNV5YnwFQ0eid7TD21xT62PX=3gE=nMXxieTj7Q@mail.gmail.com>
Date: 2017-09-22T09:45:04Z
From: Upananda Pani
Subject: Treating NA in timeSeries package

Dear All,

I am facing problem with NA treatment in my financial time series data.

# data reading

aluminum = read.csv(file="alu.csv", header=T, sep=",")

fut = aluminum [,2]
spt = aluminum [,3]


# Missing Value Treatment (Linear Interpolation)
spt = interpNA(spt, method = c("linear"))
fut = interpNA(fut, method = c("linear"))


fut=fut[,1]
spt =spt[,1]

spt = interpNA(spt, method = c("linear"))
Error in interpNA(spt, method = c("linear")) : spt is not a tis object
> fut = interpNA(fut, method = c("linear"))
Error in interpNA(fut, method = c("linear")) : fut is not a tis object

Then i want to convert my data into time series as following
# Making Time Series
fut = ts(fut, start=c(2006,4), frequency=305)
spt = ts(spt, start=c(2006,4), frequency=305)

Would you please guide me what is the problem with my code?

With best regards,
Upananda Pani