Re: [R] predict.lm[e] with formula passed as a variable

2010-12-13 Thread David L Lorenz
)) Dave From: "Thaler, Thorn, LAUSANNE, Applied Mathematics" To: Date: 12/13/2010 12:16 PM Subject: [R] predict.lm[e] with formula passed as a variable Sent by: r-help-boun...@r-project.org Dear all, In a function I paste a string and convert it to a formula which I pass to lm[e]. T

[R] predict.lm[e] with formula passed as a variable

2010-12-13 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Dear all, In a function I paste a string and convert it to a formula which I pass to lm[e]. The idea is to write a function which takes the name of the response variable and the explanatory variable and the data frame as an argument and calculates an lm[e]. (see example below) This works fine, bu