dwarton/mvabund

Predict not working with poly formulas

Closed this issue · 1 comments

Hi Alice,
predict.manyglm is not working when the formula contains polynomial terms. This isn't urgent for me as I can work around.
Cheers,
Eve

#Minimal example below
#Simulate toy data
Y=rpois(100, 2)
X=data.frame(x1=rnorm(100), x2=rnorm(100))

#fit model and predict response from original data
mod= manyglm(Y~poly(x1,2)+poly(x2,2), data=X)
predict(mod)
predict(mod, newdata=X)
predict(mod, newdata=mod$x)

#This error is received for all 3 attempts
#Error in poly(x1, 2) : object 'x1' not found

all fixed!