I cannot see why the code below produces this error:-
Error in model.frame.default(formula = secA ~ secB + 0, data = t,
drop.unused.levels = TRUE) :
variable lengths differ (found for 'secB')*
I thought the merge would match up dates in secA and secB, therefore making
the different lengths of secA and secB irrelevant.
Any ideas.
library(zoo)
library(tseries)
library(quantmod) #for access to FRED
require(quantmod)
require(TTR)
secA <- getSymbols("DEXUSEU",src="FRED") secB <-
getSymbols("DEXUSUK",src="FRED")
secA <- zoo(DEXUSEU[,1])
secB <- zoo(DEXUSUK[,1])
t.zoo <- merge(secA, secB, all=FALSE)
t <- as.data.frame(t.zoo)
cat("Date range is", format(start(t.zoo)), "to", format(end(t.zoo)), "\n")
m <- lm(secA ~ secB + 0, data=t)
Thanks
Stuart
[[alternative HTML version deleted]]
_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should
go.