Page 1 of 1

using interpol to get quarterly data (from annual)

Posted: Thu Aug 19, 2010 11:29 am
by KOBE24
Hello,

I am trying to get a quarterly series from my annual one. I am following the steps contained in the manual, using either distrib or interpol
but I can not succed. I go on getting just 36 values (my sample is 35 years).

here is my code

cal(q) 1970
all 2005:04
open data hours.xls
data(for=xls,org=col)
close data
@distrib(factor=4) hoursus hoursusq


I am sure to make some stupid mistake... Sorry for that, I read the manual and your post and I am knuckling my head right now!

Re: using interpol to get quarterly data (from annual)

Posted: Thu Aug 19, 2010 11:42 am
by moderator
First, make sure that your source file has date information that RATS can process. RATS needs to be able to determine that the source file is annual data, so that it knows it needs to expand the data to quarterly rather than just read the 35 observations.

Add a VERBOSE option to the DATA instruction. This will cause RATS to report on what it is doing. It should say something like "File contains dates..." and "expanding from annual .... to quarterly ...".

If it says the source file is undated, then that's the problem.

Re: using interpol to get quarterly data (from annual)

Posted: Thu Aug 19, 2010 12:29 pm
by KOBE24
Thanks a lot for your help!

this is what adding verbose produces

Spreadsheet is rows 0 through 36, columns 0 through 2.
Copy without dates from Undated 1 to Quarterly 1970:01
Processing DATE
Processing HOURSUSA
Processing HOURSEA


however, I still go on having 36 datas!

I feel really stupid, cause I did it a couple of months ago for another series!!!! It's driving me crazy! :evil:

Hope you can figure a solution...


But thanks again, really, I really LOVE this forum!

Hope you find an idea, cause I've finishede mine...

Re: using interpol to get quarterly data (from annual)

Posted: Thu Aug 19, 2010 2:15 pm
by moderator
The reason for the problem is right there in your output:

"Copy without dates from Undated 1 to Quarterly 1970:01"

The file doesn't contain dates, at least not dates that RATS can recognize. Thus it has no way of knowing that the data on the file should be treated as being anything different than the frequency specified by your CALENDAR instruction, so it just reads in the data exactly as is, with no attempt to expand it. This is discussed as point (1) on page 76 in the User's Guide.

You need to either add (annual) dates to the file that RATS can recognize, or else:

1) Read the data in as annual (i.e. setting an annual CALENDAR)
2) Use OPEN COPY and COPY(DATES,...) to write the data to a new file that contains dates.
3) In a separate session, set your quarterly CALENDAR and read the data in from the new (dated) file.

Regards,
Tom

Re: using interpol to get quarterly data (from annual)

Posted: Fri Aug 20, 2010 9:24 am
by KOBE24
Wonderful,

it works now!

Thanks a lot for your help: I was missing the final step after open copy!

Regards,

KOBE24