Skip to content
Prev 299624 / 398503 Next

outer() or some other function for regression prediction with 2 IVs

On Jul 10, 2012, at 05:35 , Joseph Clark wrote:

            
You didn't take Michael's hint:

coef(m3) %*% cbind(1, s, s^2, d, d^2)

or even

predict(m3, newdata=data.frame(x1=s, x2=d))

(in which x1, x2 needs replacement to match the names used in m3). 

Also, a quick (but not fast) solution to the generic non-vectorized-function problem is to Vectorize() it.