read data from not first entry .Rats can't do it right

For questions and discussion related to reading in and working with data.
lizhengeconomic
Posts: 5
Joined: Mon Dec 16, 2013 5:32 am

read data from not first entry .Rats can't do it right

Unread post by lizhengeconomic »

Code: Select all

open data txch.xls
data(format=xls,org=columns,left=2) 4 3065 date eurusd yenusd $
  gbpusd r_eurusd r_yenusd r_gbpusd 
Though the entry is 4 3065,but the data in Rats is 1 3062, you can look at the excel file.
Attachments
read data.RPF
(122 Bytes) Downloaded 750 times
txch.xls
(451.04 KiB) Downloaded 763 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: read data from not first entry .Rats can't do it right

Unread post by TomDoan »

It's doing exactly what it's supposed to do. From Page Int-116 in the RATS v8 "Introduction to RATS":

Whether you can select specific observations out of the file depends in part on whether
or not the file includes a date column:
• If there is no date column or row on the file, RATS assumes the first observation on
the file corresponds to the first observation you request on DATA. You can ask only
for entries at the beginning of the file, never a block in the middle or end. If you
need to be able to read in a subset of the data, you could first convert the file to
rats format.
• If there are dates on the file, and the frequency on the file matches the current
CALENDAR seasonal, DATA will locate the entries requested and fill in any skipped
dates with missing values.
• If the frequency of the current CALENDAR does not match the frequency of the data
on the file, RATS will compact or expand the data as it reads it in. See Section 2.4.
• If you don’t use a CALENDAR instruction, RATS will read observations from the
beginning of the file. Any dates on the file are ignored.

What's the point of not reading entries 1 to 3?
lizhengeconomic
Posts: 5
Joined: Mon Dec 16, 2013 5:32 am

Re: read data from not first entry .Rats can't do it right

Unread post by lizhengeconomic »

TomDoan wrote:It's doing exactly what it's supposed to do. From Page Int-116 in the RATS v8 "Introduction to RATS":

Whether you can select specific observations out of the file depends in part on whether
or not the file includes a date column:
• If there is no date column or row on the file, RATS assumes the first observation on
the file corresponds to the first observation you request on DATA. You can ask only
for entries at the beginning of the file, never a block in the middle or end. If you
need to be able to read in a subset of the data, you could first convert the file to
rats format.
• If there are dates on the file, and the frequency on the file matches the current
CALENDAR seasonal, DATA will locate the entries requested and fill in any skipped
dates with missing values.
• If the frequency of the current CALENDAR does not match the frequency of the data
on the file, RATS will compact or expand the data as it reads it in. See Section 2.4.
• If you don’t use a CALENDAR instruction, RATS will read observations from the
beginning of the file. Any dates on the file are ignored.

What's the point of not reading entries 1 to 3?
thank you, TomDoan! I know your meaning ,thanks.
Post Reply