Skip to content
Prev 46535 / 63421 Next

model.frame(), model.matrix(), and derived predictor variables

On 13-08-28 05:43 PM, Gabriel Becker wrote:
That's because x and y are still lying around in your global
environment.  If you rm(x); rm(y) then it won't work any more.  And it
wouldn't have worked if you had constructed your model frame directly as

 d = data.frame(x=rpois(100,5)+1)
 d = transform(d,y=rnorm(100,x))
Yes, if I want to refit the same model.  But if I want to do
something else with the model (e.g. try fitting vs. x instead of log(x),
or some other function of x) then it doesn't work.

  cheers
    Ben