by turkhanali » Mon Oct 25, 2010 8:05 pm
Dear Tom,
Thank you fro your reply. Sorry for not making myself clear. In fact I have 10 countries data series in 10 worksheet of excel. every data series with its own date and corresponding data. If I combine all the series into one sheet. the dates will not match each other. part of the series after combine in excel looks as follows:
price1 price2 price3 price4 price5
1999-11-1 1493.096 1999-10-6 714.19 1999-10-21 367.23 1999-10-6 588.749 1999-10-12 1542.8
1999-11-2 1487.469 1999-10-7 734.73 1999-10-22 377.16 1999-10-7 585.345 1999-10-13 1526.96
1999-11-3 1475.684 1999-10-8 743.84 1999-10-26 379.54 1999-10-8 588.237 1999-10-14 1536.74
1999-11-4 1464.828 1999-10-11 747.39 1999-10-27 379.61 1999-10-11 584.06 1999-10-15 1510.26
1999-11-5 1465.232 1999-10-12 745.57 1999-10-28 389.76 1999-10-12 571.382 1999-10-18 1460.23
1999-11-8 1471.375 1999-10-13 737.28 1999-10-29 395.55 1999-10-13 571.947 1999-10-19 1471.8
1999-11-9 1464.03 1999-10-14 738.05 1999-11-1 391.55 1999-10-14 567.777 1999-10-20 1507.31
In this case, simply drop out the na or empty series may lead to spurious results if I am going to do multivariate analysis. I mean the return I got for price1 will not match same return for price2 and others will not match too.
I want try to read the whole data series including the data into RATS. Then create a matrix of length*var where length equals to number of entry created by the data wizard, say it from Nov 29, 1980 to Oct. 25, 2010 with 5 days per week. using loops to fill the matrix with the data if the corresponding date of that data match with the reference date of the matrix. Then we should end up a matrix with data that match dates each other. For instance, the dat shown above should look as follows:
date price1 price2 price3 price4 price5
1999-10-6 na 714.19 na 588.749 na
1999-10-7 na 734.73 na 585.345 na
1999-10-8 na 743.84 na 588.237 na
1999-10-11 na 747.39 na 584.06 na
1999-10-12 na 745.57 na 571.382 1542.8
1999-10-13 na 737.28 na 571.947 1526.96
1999-10-14 na 738.05 na 567.777 1536.74
1999-10-15 na na na na 1510.26
1999-10-18 na na na na 1460.23
1999-10-19 na na na na 1471.8
1999-10-20 na na na na 1507.31
1999-10-21 na na 367.23 na na
1999-10-22 na na 377.16 na na
1999-10-26 na na 379.54 na na
1999-10-27 na na 379.61 na na
1999-10-28 na na 389.76 na na
1999-10-29 na na 395.55 na na
1999-11-1 1493.096 na 391.55 na na
1999-11-2 1487.469 na na na na
1999-11-3 1475.684 na na na na
1999-11-4 1464.828 na na na na
1999-11-5 1465.232 na na na na
1999-11-8 1471.375 na na na na
1999-11-9 1464.03 na na na na
(note: This is special case where there is no date with prices available across different countries. However, giving 9000 observations, there are plenty price available for same date)
Then we can drop out all the entry with nas and do the analysis with data commonly available for the same day across prices. In this case we take log difference. It should represent returns on same days.
I hope I made myself clear in this case.
Thanks in advance.