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) I cannot see why this produces the 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 Thanks Stuart *Stuart* *t: 01483 212979 m: 07766 573333* [[alternative HTML version deleted]]