Re: [R] model matrix with a spline

2009-12-19 Thread David Winsemius
On Dec 19, 2009, at 2:22 AM, David Hugh-Jones wrote: Hi all I want to get the design matrix for a model, evaluated at a single value. For example, if I pass in a data frame with a=2, b=2, y=3, and my model is y ~ a+b+a:b, then I would like to get the values 3, 2, 2, 4 out. I can do this wit

[R] model matrix with a spline

2009-12-18 Thread David Hugh-Jones
Hi all I want to get the design matrix for a model, evaluated at a single value. For example, if I pass in a data frame with a=2, b=2, y=3, and my model is y ~ a+b+a:b, then I would like to get the values 3, 2, 2, 4 out. I can do this with: tmp <- model.matrix(fit, data=mydata) or tmp <- predic