Re: [Rd] Issues with drop.terms

2021-08-23 Thread Ben Bolker
Small follow-up: (1) in order for lm() to actually work you need keep.response=TRUE in the drop.terms() call (I realize that this is *not* the problem in your example) test4 <- terms(mpg ~ hp + I(cyl==4) + disp + wt ) check4 <- drop.terms(test4, 3, keep.response = TRUE) formula(check4) lm( ch

[Rd] Issues with drop.terms

2021-08-23 Thread Therneau, Terry M., Ph.D. via R-devel
This is a follow-up to my earlier note on [.terms.   Based on a couple days' work getting the survival package to work around  issues, this will hopefully be more concise and better expressed than the prior note. 1. test1 <- terms( y ~ x1:x2 + x3) check <- drop.terms(termobj =test1, dropx = 1)