Re: [R] Could dynlm function work for xts objects?

2012-04-11 Thread Achim Zeileis

On Thu, 12 Apr 2012, jpm miao wrote:


It seems to only works for zoo or ts objects?


It was tested for zoo, ts, and plain numeric vectors.


I tried to run it for xts objects, and error message occurs.


I had a quick look if this can be avoided. But xts' merge() method is not 
fully compatible with zoo's, so it currently does not work. I'll 
investigate whether this can be improved.



Once I coerce it to be an zoo object (by as.zoo), it works.


Yes, that is recommended at the moment.
Z


Error message:


Error in model.frame.default(formula = dynformula(PIh - PI ~ L(X, 0:i) +  :
 variable lengths differ (found for 'L(X, 0:i)')
In addition: Warning messages:
1: In zoo(coredata(x), order.by = index(x), ...) :
 some methods for ?zoo? objects do not work if the index entries in
?order.by? are not unique
2: In zoo(coredata(x), order.by = index(x), ...) :
 some methods for ?zoo? objects do not work if the index entries in
?order.by? are not unique

__
R-help@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.



__
R-help@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.


[R] Could dynlm function work for xts objects?

2012-04-11 Thread jpm miao
It seems to only works for zoo or ts objects?

I tried to run it for xts objects, and error message occurs. Once I
coerce it to be an zoo object (by as.zoo), it works.

Error message:


Error in model.frame.default(formula = dynformula(PIh - PI ~ L(X, 0:i) +  :
  variable lengths differ (found for 'L(X, 0:i)')
In addition: Warning messages:
1: In zoo(coredata(x), order.by = index(x), ...) :
  some methods for “zoo” objects do not work if the index entries in
‘order.by’ are not unique
2: In zoo(coredata(x), order.by = index(x), ...) :
  some methods for “zoo” objects do not work if the index entries in
‘order.by’ are not unique

__
R-help@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.