[R] Time series example in Koop

From: Ravi Kulkarni <ravi.kulk_at_gmail.com>
Date: Tue, 05 Apr 2011 07:35:04 -0500 (CDT)


I am trying to reproduce the output of a time series example in Koop's book "Analysis of Financial Data". Koop does the example in Excel and I used the ts function followed by the lm function. I am unable to get the exact coefficients that Koop gives - my coefficients are slightly different.
After loading the data file and attaching the frame, my code reads:

> y = ts(m.cap)
> x = ts(oil.price)
> d = ts.union(y,x,x1=lag(x,-1),x2=lag(x,-2),x3=lag(x,-3),x4=lag(x,-4))
> mod1 = lm(y~x+x1+x2+x3+x4, data=d)
> summary(mod1)

Koop gives an intercept of 92001.51, while the code above gives 91173.32. The other coefficients are also slightly off.

This is the example in Table 8.3 of Koop. I also attach a plain text version of the tab separated file "badnews.txt". http://r.789695.n4.nabble.com/file/n3427897/badnews.txt badnews.txt

Any light on why I do not get Koop's coefficients is most welcome...

Ravi

--
View this message in context: http://r.789695.n4.nabble.com/Time-series-example-in-Koop-tp3427897p3427897.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 05 Apr 2011 - 13:17:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 05 Apr 2011 - 15:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive