Skip to content

"Template" for model.matrix functions

2 messages · Gregor Gorjanc, Thomas Lumley

#
Hello!

I would like to write a function that would create a (part) of a model
matrix to be used in lm() like functions i.e

lm(y ~ myFunc(x))

Where can I find a good example or a template for this as well as for
predict method?

Thanks!
#
On Mon, 3 Jul 2006, Gregor Gorjanc wrote:

            
I would look at bs() and ns() in the splines package.

 	-thomas