delete.response {base} | R Documentation |
delete.response
returns a terms
object for the same
model but with no response variable.
drop.terms
removes variables from the right-hand side of the
model.
reformulate
creates a formula from a vector of strings.
delete.response(termobj) reformulate(termlabels,response=NULL) drop.terms(termobj, dropx = NULL, keep.response = FALSE)
termobj |
A terms object |
termlabels |
vector of strings giving the right-hand side of a model formula |
response |
string giving the left-hand side of a model formula |
dropx |
vector of positions of variables to drop from the right-hand side of the model |
keep.response |
Keep the response in the resulting object? |
delete.response
and drop.terms
return a terms
object.
reformulate
returns a formula
.
ff <- y ~ z + x + w tt <- terms(ff) tt delete.response(tt) drop.terms(tt, 2:3, keep.response = T) reformulate(attr(tt, "term.labels"))