Re: [R] Names of variables needed in newdata for predict.glm

2018-03-31 Thread David Winsemius
> On Mar 31, 2018, at 8:48 AM, Bendix Carstensen > wrote: > > all.vars works fine, EXCEPT, it give a bit too much. > I only want the regression variables, but in the following example I also get > "k" the variable holding the chosen knots. Any machinery to find

Re: [R] Names of variables needed in newdata for predict.glm

2018-03-31 Thread Bendix Carstensen
all.vars works fine, EXCEPT, it give a bit too much. I only want the regression variables, but in the following example I also get "k" the variable holding the chosen knots. Any machinery to find only "real" regression variables? cheers, Bendix library( splines ) y <- rnorm(100) x <- rnorm(100)

Re: [R] Names of variables needed in newdata for predict.glm

2018-03-08 Thread Marc Schwartz
Hi Bendix, If the 'model' argument to glm() is TRUE (the default), you can get the structure of the model frame that was used to fit the model, by using: > str(mx$data) 'data.frame': 200 obs. of 4 variables: $ D: int 0 1 0 1 1 0 1 1 1 1 ... $ x: num 0.705 2.15 0.572 1.249 0.807 ... $ f:

Re: [R] Names of variables needed in newdata for predict.glm

2018-03-07 Thread Marc Girondot via R-help
Hi, Some try: > names(mi$xlevels) [1] "f" > all.vars(mi$formula) [1] "D" "x" "f" "Y" > names(mx$xlevels) [1] "f" > all.vars(mx$formula) [1] "D" "x" "f" When offset is indicated out of the formula, it does not work... Marc Le 07/03/2018 à 06:20, Bendix Carstensen a écrit : I would like to