hi Zeliglist
I've seen this question come up on the list before but can't find an
answer. When supplying a vector of x values to a logit.gam model, Zelig
(3.5.5, in R 2.15) throws the following error:
Error in coef %*% t(x) : non-conformable arguments
error. This is not consistent with the behavior of a logit model, which
provides estimates of results in this situation. To provide a reproducible
example:
set.seed(0)
n <- 400
x0 <- runif(n, 0, 1)
x1 <- runif(n, 0, 1)
y <- rbinom(n, 1,.25)
dat <- as.data.frame(cbind(y, x0, x1))
z.out <- zelig(y ~ s(x0) + s(x1), model = "logit.gam",
data = dat)
x1r <- seq(quantile(dat$x1, .2),
quantile(dat$x1, .8),
length.out = 100)
x.1 <- setx(z.out,
x0 = mean(dat$x0),
x1 = x1r)
x.2 <- setx(z.out,
x0 = mean(dat$x0)+ sd(dat$x0),
x1 = x1r)
z.res <- sim(z.out, x = x.1, x1 = x.2)
But the "logit" model accepts vectors of x values--is there fundamental
mistake I'm making, or this just a limitation of GAMs themselves?
Thanks
Tom