Notes Regarding the Use of WRDS and the creation of an S-Plus Finmetrics Time Series This file tells you how to (1) Access WRDS and download data as a text file (2) convert the text file to an S-Plus object of type data.frame (3) Convert the S-Plus data.frame object to an object of type timeSeries This three step process seems like a pain, but it's really not so bad. The good part is at the end of this drill you get to analyze some real data that matters to many people. =================================================================================== Note: if you find a typo --- or suspect a typo --- send me e-mail =================================================================================== First you go to http://wrds-web.wharton.upenn.edu/wrds/ If you are a Wharton Student you probably will not need to register. You can just use your usual Wharton login and password. If you are NOT a Wharton Student will will need to register. There are instructions on the day 6 blog page. After you are in go to CRSP then to Annual Up-dates:Daily Stocks Let's do our search by ticker, say IBM We are affter Holding Period Returns Almost all of the buttons are left unpressed. Follow instuctions to download the file and save it as ibm.txt (perhaps to your desktop, though later you will want to have a special WRDs Downloads File) ================================================================================== S-Plus File/Import ... Use this to create an R data.frame called ibm from the file ibm.txt Use the GUI data editor to 1. Remove the fluff at the top 2. Delete the name tag column 2. Change the (new) first column to type character (using "Change Data Type in the right-click menu provided by the GUI) 3. Change the (new) second column to type double (again using "Change Data Type") These steps give you an object of type data.frame which can be made into an object of type timeSeries that is appropriate for the Finmetrics tools. ================================================================================= Finmetrics module(finmetrics) ibm.td<-timeDate(ibm[,1], in.format="%4Y%2m%2d") ibm.ts<-timeSeries(data<-ibm[,2], pos<-ibm.td) Note: Z&W pages 19--31 have more than you want to know about timeDate, but most people just look at the examples given by format.timeDate (as discussed on p.19) ================================================================================ Test Drive --- with a message --- and useful for HW3 plot(ibm.ts) autocorTest(ibm.ts) qqnorm(ibm.ts) temp<-rt(df=5, length(ibm.ts)) qqplot(seriesData(ibm.ts), temp) normalTest(seriesData(ibm.ts)) normalTest(temp) temp2<-rnorm(100) normalTest(temp2) ================================================================================