I'm using xts time series, originally converted from type ts, in a logstic regression, but I get
Error in `*.default`(x[good, , drop = FALSE], w) : non-conformable arrays
Example:
success <- as.xts(ts(sample(0:10, 100, replace=T), start=1970, fr=12))
failure <- 10-success
x <- as.xts(ts(rnorm(100), start=1970, fr=12))
glm(cbind(success, failure) ~ x, family=binomial)
However, if the series are converted to class ts
or just a vector than there is no error:
glm(cbind(as.ts(success), as.ts(failure)) ~ as.ts(x), family=binomial)
glm(cbind(as.vector(success), as.vector(failure)) ~ as.vector(x), family=binomial)
Is there a way to avoid the error while working with the original xts series?